Changeset 469 for trunk/src/SDPol.h
- Timestamp:
- 02/18/05 11:11:01 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDPol.h
r459 r469 155 155 const casa::Array<casa::Float>& U); 156 156 157 // Rotate phase of Complex correlation C3+iC4 by phase (degrees)157 // Rotate phase of Complex correlation C3+iC4 by phase (degrees) 158 158 static void rotateXYPhase (casa::Array<casa::Float>& C3, 159 159 casa::Array<casa::Float>& C4, … … 163 163 // already be setup to access the Array at the current cursor location 164 164 // (beam, IF, Pol; see SDMemTable). The desired Stokes 165 // is spec fied in the string from "I", "Q", "U", "V"165 // is specified in the string from "I", "Q", "U", "V" 166 166 static casa::Array<casa::Float> getStokesSlice (casa::Array<casa::Float>& input, const casa::IPosition& start, 167 167 const casa::IPosition& end, const casa::String& stokes); … … 173 173 174 174 175 // Compute value for STokes parameters by combining the raw correlation values 176 // The output shape may change from the input shape according to 177 // XX or YY -> I 178 // XX,YY -> I 179 // XX,YY,R(XY),I(XY) -> I,Q,U,V 180 // Bool for mask 181 // Float for TSys 175 // Compute value for auxilliary spectra when converting to Stokes parameters. 176 // This combines the raw correlation values, according to what was combined 177 // to actually convert to Stokes parameters. The output shape may change from 178 // the input shape according to 179 // XX or YY -> I (1 -> 1) 180 // XX,YY -> I (2 -> 1) 181 // XX,YY,R(XY),I(XY) -> I,Q,U,V (4 -> 4) 182 // 183 // It is meant for tSys (FLoat) and masks (Bool or uChar) 184 // The input array must be of shape [nBeam,nIF,nPol,nChan] 182 185 template <class T> 183 186 static casa::Array<T> stokesData (casa::Array<T>& rawData, casa::Bool doLinear); 184 187 188 // Find the number of STokes parameters given the input number 189 // of raw polarizations 190 static casa::uInt numberStokes (casa::uInt nPol) {casa::uInt nOut = nPol; if (nPol==2) nOut = 1; return nOut;}; 185 191 186 192 // Find the Stokes type for the given polarization axis (0,1,2,3) 187 // You can ask for STokes or raw correl tions (linear or circular)193 // You can ask for STokes or raw correlations (linear or circular) 188 194 static casa::Stokes::StokesTypes convertStokes(casa::Int val, casa::Bool toStokes, 189 195 casa::Bool linear); 196 197 198 // These two functions are explicitly for the SDWriter 199 // 200 // Compute value for auxilliary spectra (Tsys and flags) when converting to Stokes parameters. 201 // This combines the raw correlation values, according to what was combined 202 // to actually convert to Stokes parameters. The output shape may change from 203 // the input shape according to 204 // XX or YY -> I (1 -> 1) 205 // XX,YY -> I (2 -> 1) 206 // XX,YY,R(XY),I(XY) -> I,Q,U,V (4 -> 4) 207 // 208 // The input array must be of shape [nChan,nPol] (flags) 209 // The input array must be of shape [nPol] (tSys) 210 // 211 static casa::Array<casa::uChar> computeStokesFlagsForWriter (casa::Array<casa::uChar>& rawData, casa::Bool doLinear) 212 {return computeStokesDataForWriter(rawData,doLinear);}; 213 static casa::Array<casa::Float> computeStokesTSysForWriter (casa::Array<casa::Float>& rawData, casa::Bool doLinear) 214 {return computeStokesDataForWriter(rawData,doLinear);}; 215 216 // This function is explcitrly for SDWriter. It extracts the Beam and IF slice (specified in start 217 // and end - must be length 1 in beam and IF) and flips the pol and channel axes. 218 static casa::Array<casa::Float> extractStokesForWriter (casa::Array<casa::Float>& in, const casa::IPosition& start, 219 const casa::IPosition& end); 190 220 191 221 private: … … 197 227 const casa::Array<casa::Bool>& in2) 198 228 {return in1&&in2;} 229 static casa::Array<casa::uChar> andArrays (const casa::Array<casa::uChar>& in1, 230 const casa::Array<casa::uChar>& in2); 231 232 template <class T> 233 static casa::Array<T> computeStokesDataForWriter (casa::Array<T>& rawData, casa::Bool doLinear); 199 234 }; 200 235
Note: See TracChangeset
for help on using the changeset viewer.