877 - | IPosition ImagePolarimetry::positionAngleShape(CoordinateSystem& cSys, |
878 - | Int& fAxis, Int& sAxis, LogIO&, Int spectralAxis) const |
879 - | { |
880 - | |
881 - | |
882 - | |
883 - | CoordinateSystem cSys0 = coordinates(); |
884 - | |
885 - | |
886 - | |
887 - | Int spectralCoord = -1; |
888 - | _findFrequencyAxis (spectralCoord, fAxis, cSys0, spectralAxis); |
889 - | |
890 - | |
891 - | |
892 - | Int afterCoord = -1; |
893 - | Int stokesCoord = cSys0.findCoordinate(Coordinate::STOKES, afterCoord); |
894 - | Vector<Int> pixelAxes = cSys0.pixelAxes(stokesCoord); |
895 - | sAxis = pixelAxes(0); |
896 - | _fiddleStokesCoordinate(cSys0, Stokes::Pangle); |
897 - | |
898 - | |
899 - | CoordinateSystem tmp; |
900 - | cSys = tmp; |
901 - | for (Int i=0;i<Int(cSys0.nCoordinates()); i++) { |
902 - | if (i!=spectralCoord) { |
903 - | cSys.addCoordinate(cSys0.coordinate(i)); |
904 - | } |
905 - | } |
906 - | |
907 - | |
908 - | |
909 - | |
910 - | IPosition shape0 = ImagePolarimetry::shape(); |
911 - | IPosition shape(shape0.nelements()-1); |
912 - | |
913 - | Int j = 0; |
914 - | for (Int i=0; i<Int(shape0.nelements()); i++) { |
915 - | if (i==sAxis) { |
916 - | shape(j) = 1; |
917 - | j++; |
918 - | } else { |
919 - | if (i!=fAxis) { |
920 - | shape(j) = shape0(i); |
921 - | j++; |
877 + | IPosition ImagePolarimetry::positionAngleShape( |
878 + | CoordinateSystem& cSys, Int& fAxis, Int& sAxis, LogIO&, Int spectralAxis |
879 + | ) const { |
880 + | CoordinateSystem cSys0 = coordinates(); |
881 + | Int spectralCoord = -1; |
882 + | _findFrequencyAxis (spectralCoord, fAxis, cSys0, spectralAxis); |
883 + | Int afterCoord = -1; |
884 + | Int stokesCoord = cSys0.findCoordinate(Coordinate::STOKES, afterCoord); |
885 + | Vector<Int> pixelAxes = cSys0.pixelAxes(stokesCoord); |
886 + | sAxis = pixelAxes(0); |
887 + | _fiddleStokesCoordinate(cSys0, Stokes::Pangle); |
888 + | CoordinateSystem tmp; |
889 + | cSys = tmp; |
890 + | for (Int i=0; i<Int(cSys0.nCoordinates()); ++i) { |
891 + | if (i != spectralCoord) { |
892 + | cSys.addCoordinate(cSys0.coordinate(i)); |
893 + | } |
894 + | } |
895 + | |
896 + | |
897 + | const auto shape0 = ImagePolarimetry::shape(); |
898 + | IPosition shape(shape0.size()-1); |
899 + | Int j = 0; |
900 + | for (Int i=0; i<Int(shape0.size()); ++i) { |
901 + | if (i == sAxis) { |
902 + | shape[j] = 1; |
903 + | ++j; |