| [805] | 1 | //
|
|---|
| 2 | // C++ Interface: STMath
|
|---|
| 3 | //
|
|---|
| 4 | // Description:
|
|---|
| 5 | //
|
|---|
| 6 | //
|
|---|
| 7 | // Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006
|
|---|
| 8 | //
|
|---|
| 9 | // Copyright: See COPYING file that comes with this distribution
|
|---|
| 10 | //
|
|---|
| 11 | //
|
|---|
| 12 | #ifndef ASAPSTMATH_H
|
|---|
| 13 | #define ASAPSTMATH_H
|
|---|
| [2] | 14 |
|
|---|
| [2177] | 15 | #include <map>
|
|---|
| [38] | 16 | #include <string>
|
|---|
| [805] | 17 |
|
|---|
| [130] | 18 | #include <casa/aips.h>
|
|---|
| [2177] | 19 | #include <casa/Arrays/Vector.h>
|
|---|
| 20 | #include <casa/BasicSL/String.h>
|
|---|
| [81] | 21 | #include <casa/Utilities/CountedPtr.h>
|
|---|
| [2177] | 22 |
|
|---|
| 23 | #include <scimath/Mathematics/FFTServer.h>
|
|---|
| [805] | 24 | #include <scimath/Mathematics/InterpolateArray1D.h>
|
|---|
| [294] | 25 |
|
|---|
| [2177] | 26 | #include "Logger.h"
|
|---|
| [805] | 27 | #include "Scantable.h"
|
|---|
| [834] | 28 | #include "STDefs.h"
|
|---|
| [896] | 29 | #include "STPol.h"
|
|---|
| [2] | 30 |
|
|---|
| [83] | 31 | namespace asap {
|
|---|
| [2] | 32 |
|
|---|
| [805] | 33 | /**
|
|---|
| [1106] | 34 | * Mathmatical operations on Scantable objects
|
|---|
| 35 | * @author Malte Marquarding
|
|---|
| [805] | 36 | */
|
|---|
| [890] | 37 | class STMath : private Logger {
|
|---|
| [716] | 38 | public:
|
|---|
| [1106] | 39 | // typedef for long method name
|
|---|
| [805] | 40 | typedef casa::InterpolateArray1D<casa::Double,
|
|---|
| 41 | casa::Float>::InterpolationMethod imethod;
|
|---|
| [299] | 42 |
|
|---|
| [1106] | 43 | // typedef for std::map
|
|---|
| [805] | 44 | typedef std::map<std::string, imethod> imap;
|
|---|
| [177] | 45 |
|
|---|
| [1106] | 46 | /**
|
|---|
| 47 | * whether to operate on the given Scantable or return a new one
|
|---|
| 48 | * @param insitu the toggle for this behaviour
|
|---|
| 49 | */
|
|---|
| [1353] | 50 | explicit STMath(bool insitu=true);
|
|---|
| [221] | 51 |
|
|---|
| [995] | 52 | virtual ~STMath();
|
|---|
| [227] | 53 |
|
|---|
| [805] | 54 | /**
|
|---|
| [1295] | 55 | * get the currnt @attr inistu_ state
|
|---|
| [805] | 56 | */
|
|---|
| 57 | bool insitu() const { return insitu_;};
|
|---|
| [1143] | 58 |
|
|---|
| [1106] | 59 | /**
|
|---|
| 60 | * set the currnt @attr inistu state
|
|---|
| 61 | * @param b the new state
|
|---|
| 62 | */
|
|---|
| [805] | 63 | void setInsitu(bool b) { insitu_ = b; };
|
|---|
| [262] | 64 |
|
|---|
| [1106] | 65 |
|
|---|
| [1140] | 66 | /**
|
|---|
| 67 | * average a vector of Scantables
|
|---|
| 68 | * @param in the vector of Scantables to average
|
|---|
| [1295] | 69 | * @param mask an optional mask to apply on specific weights
|
|---|
| [1140] | 70 | * @param weight weighting scheme
|
|---|
| 71 | * @param avmode the mode ov averaging. Per "SCAN" or "ALL".
|
|---|
| 72 | * @return a casa::CountedPtr<Scantable> which either holds a new Scantable
|
|---|
| 73 | * or returns the imput pointer.
|
|---|
| 74 | */
|
|---|
| [805] | 75 | casa::CountedPtr<Scantable>
|
|---|
| 76 | average( const std::vector<casa::CountedPtr<Scantable> >& in,
|
|---|
| [858] | 77 | const std::vector<bool>& mask = std::vector<bool>(),
|
|---|
| 78 | const std::string& weight = "NONE",
|
|---|
| [977] | 79 | const std::string& avmode = "SCAN");
|
|---|
| [1066] | 80 |
|
|---|
| [1140] | 81 | /**
|
|---|
| 82 | * median average a vector of Scantables. See also STMath::average
|
|---|
| 83 | * @param in the Scantable to average
|
|---|
| 84 | * @param mode the averaging mode. Currently only "MEDIAN"
|
|---|
| 85 | * @param avmode the mode ov averaging. Per "SCAN" or "ALL".
|
|---|
| 86 | * @return a casa::CountedPtr<Scantable> which either holds a new Scantable
|
|---|
| 87 | * or returns the imput pointer.
|
|---|
| 88 | */
|
|---|
| [1069] | 89 | casa::CountedPtr<Scantable>
|
|---|
| 90 | averageChannel( const casa::CountedPtr<Scantable> & in,
|
|---|
| [1078] | 91 | const std::string& mode = "MEDIAN",
|
|---|
| 92 | const std::string& avmode = "SCAN");
|
|---|
| [1069] | 93 |
|
|---|
| [1140] | 94 | /**
|
|---|
| [1145] | 95 | * Average polarisations together. really only useful if only linears are
|
|---|
| 96 | * available.
|
|---|
| [1140] | 97 | * @param in the input Scantable
|
|---|
| 98 | * @param mask an optional mask if weight allows one
|
|---|
| 99 | * @param weight weighting scheme
|
|---|
| [1143] | 100 | * @return
|
|---|
| [1140] | 101 | */
|
|---|
| [940] | 102 | casa::CountedPtr< Scantable >
|
|---|
| 103 | averagePolarisations( const casa::CountedPtr< Scantable > & in,
|
|---|
| [1140] | 104 | const std::vector<bool>& mask,
|
|---|
| 105 | const std::string& weight );
|
|---|
| [234] | 106 |
|
|---|
| [1145] | 107 | /**
|
|---|
| 108 | * Average beams together.
|
|---|
| 109 | * @param in the input Scantable
|
|---|
| 110 | * @param mask an optional mask if weight allows one
|
|---|
| 111 | * @param weight weighting scheme
|
|---|
| 112 | * @return
|
|---|
| 113 | */
|
|---|
| 114 | casa::CountedPtr< Scantable >
|
|---|
| 115 | averageBeams( const casa::CountedPtr< Scantable > & in,
|
|---|
| 116 | const std::vector<bool>& mask,
|
|---|
| 117 | const std::string& weight );
|
|---|
| 118 |
|
|---|
| [805] | 119 | casa::CountedPtr<Scantable>
|
|---|
| 120 | unaryOperate( const casa::CountedPtr<Scantable>& in, float val,
|
|---|
| 121 | const std::string& mode, bool tsys=false );
|
|---|
| [169] | 122 |
|
|---|
| [1819] | 123 | // array operation
|
|---|
| [1308] | 124 | casa::CountedPtr<Scantable>
|
|---|
| [1819] | 125 | arrayOperate( const casa::CountedPtr<Scantable>& in,
|
|---|
| 126 | const std::vector<float> val,
|
|---|
| 127 | const std::string& mode,
|
|---|
| 128 | const std::string& opmode="channel",
|
|---|
| 129 | bool tsys=false );
|
|---|
| 130 |
|
|---|
| 131 | // channel operation
|
|---|
| 132 | casa::CountedPtr<Scantable>
|
|---|
| 133 | arrayOperateChannel( const casa::CountedPtr<Scantable>& in,
|
|---|
| 134 | const std::vector<float> val,
|
|---|
| 135 | const std::string& mode, bool tsys=false );
|
|---|
| 136 |
|
|---|
| 137 | // row operation
|
|---|
| 138 | casa::CountedPtr<Scantable>
|
|---|
| 139 | arrayOperateRow( const casa::CountedPtr<Scantable>& in,
|
|---|
| 140 | const std::vector<float> val,
|
|---|
| 141 | const std::string& mode, bool tsys=false );
|
|---|
| 142 |
|
|---|
| 143 | // 2d array operation
|
|---|
| 144 | casa::CountedPtr<Scantable>
|
|---|
| 145 | array2dOperate( const casa::CountedPtr<Scantable>& in,
|
|---|
| 146 | const std::vector< std::vector<float> > val,
|
|---|
| 147 | const std::string& mode, bool tsys=false );
|
|---|
| 148 |
|
|---|
| 149 | casa::CountedPtr<Scantable>
|
|---|
| [1570] | 150 | binaryOperate( const casa::CountedPtr<Scantable>& left,
|
|---|
| 151 | const casa::CountedPtr<Scantable>& right,
|
|---|
| [1308] | 152 | const std::string& mode);
|
|---|
| 153 |
|
|---|
| [1066] | 154 | casa::CountedPtr<Scantable> autoQuotient(const casa::CountedPtr<Scantable>& in,
|
|---|
| 155 | const std::string& mode = "NEAREST",
|
|---|
| 156 | bool preserve = true);
|
|---|
| 157 |
|
|---|
| 158 | casa::CountedPtr<Scantable> quotient( const casa::CountedPtr<Scantable>& on,
|
|---|
| 159 | const casa::CountedPtr<Scantable>& off,
|
|---|
| [805] | 160 | bool preserve = true );
|
|---|
| [169] | 161 |
|
|---|
| [1391] | 162 | /**
|
|---|
| 163 | * Calibrate total power scans (translated from GBTIDL)
|
|---|
| [1819] | 164 | * @param calon uncalibrated Scantable with CAL noise signal
|
|---|
| [1391] | 165 | * @param caloff uncalibrated Scantable with no CAL signal
|
|---|
| 166 | * @param tcal optional scalar Tcal, CAL temperature (K)
|
|---|
| [1819] | 167 | * @return casa::CountedPtr<Scantable> which holds a calibrated Scantable
|
|---|
| [1391] | 168 | * (spectrum - average of the two CAL on and off spectra;
|
|---|
| 169 | * tsys - mean Tsys = <caloff>*Tcal/<calon-caloff> + Tcal/2)
|
|---|
| [1819] | 170 | */
|
|---|
| [1391] | 171 | casa::CountedPtr<Scantable> dototalpower( const casa::CountedPtr<Scantable>& calon,
|
|---|
| 172 | const casa::CountedPtr<Scantable>& caloff,
|
|---|
| 173 | casa::Float tcal=1.0 );
|
|---|
| 174 |
|
|---|
| 175 | /**
|
|---|
| 176 | * Combine signal and reference scans (translated from GBTIDL)
|
|---|
| 177 | * @param sig Scantable which contains signal scans
|
|---|
| 178 | * @param ref Scantable which contains reference scans
|
|---|
| 179 | * @param smoothref optional Boxcar smooth width of the reference scans
|
|---|
| 180 | * default: no smoothing (=1)
|
|---|
| [1819] | 181 | * @param tsysv optional scalar Tsys value at the zenith, required to
|
|---|
| 182 | * set tau, as well
|
|---|
| [1391] | 183 | * @param tau optional scalar Tau value
|
|---|
| 184 | * @return casa::CountedPtr<Scantable> which holds combined scans
|
|---|
| 185 | * (spectrum = (sig-ref)/ref * Tsys )
|
|---|
| 186 | */
|
|---|
| 187 | casa::CountedPtr<Scantable> dosigref( const casa::CountedPtr<Scantable>& sig,
|
|---|
| 188 | const casa::CountedPtr<Scantable>& ref,
|
|---|
| 189 | int smoothref=1,
|
|---|
| 190 | casa::Float tsysv=0.0,
|
|---|
| 191 | casa::Float tau=0.0 );
|
|---|
| 192 |
|
|---|
| [1819] | 193 | /**
|
|---|
| [1391] | 194 | * Calibrate GBT Nod scan pairs (translated from GBTIDL)
|
|---|
| 195 | * @param s Scantable which contains Nod scans
|
|---|
| 196 | * @param scans Vector of scan numbers
|
|---|
| 197 | * @param smoothref optional Boxcar smooth width of the reference scans
|
|---|
| 198 | * @param tsysv optional scalar Tsys value at the zenith, required to
|
|---|
| 199 | * set tau, as well
|
|---|
| [1819] | 200 | * @param tau optional scalar Tau value
|
|---|
| [1391] | 201 | * @param tcal optional scalar Tcal, CAL temperature (K)
|
|---|
| 202 | * @return casa::CountedPtr<Scantable> which holds calibrated scans
|
|---|
| 203 | */
|
|---|
| 204 | casa::CountedPtr<Scantable> donod( const casa::CountedPtr<Scantable>& s,
|
|---|
| 205 | const std::vector<int>& scans,
|
|---|
| 206 | int smoothref=1,
|
|---|
| 207 | casa::Float tsysv=0.0,
|
|---|
| 208 | casa::Float tau=0.0,
|
|---|
| 209 | casa::Float tcal=0.0 );
|
|---|
| 210 |
|
|---|
| 211 | /**
|
|---|
| 212 | * Calibrate frequency switched scans (translated from GBTIDL)
|
|---|
| 213 | * @param s Scantable which contains frequency switched scans
|
|---|
| 214 | * @param scans Vector of scan numbers
|
|---|
| 215 | * @param smoothref optional Boxcar smooth width of the reference scans
|
|---|
| 216 | * @param tsysv optional scalar Tsys value at the zenith, required to
|
|---|
| 217 | * set tau, as well
|
|---|
| 218 | * @param tau optional scalar Tau value
|
|---|
| 219 | * @param tcal optional scalar Tcal, CAL temperature (K)
|
|---|
| 220 | * @return casa::CountedPtr<Scantable> which holds calibrated scans
|
|---|
| 221 | */
|
|---|
| 222 | casa::CountedPtr<Scantable> dofs( const casa::CountedPtr<Scantable>& s,
|
|---|
| 223 | const std::vector<int>& scans,
|
|---|
| 224 | int smoothref=1,
|
|---|
| 225 | casa::Float tsysv=0.0,
|
|---|
| 226 | casa::Float tau=0.0,
|
|---|
| 227 | casa::Float tcal=0.0 );
|
|---|
| 228 |
|
|---|
| [1819] | 229 | /**
|
|---|
| 230 | * Calibrate data with Chopper-Wheel like calibration method
|
|---|
| 231 | * which adopts position switching by antenna motion,
|
|---|
| 232 | * wobbler (nutator) switching and On-The-Fly observation.
|
|---|
| 233 | *
|
|---|
| 234 | * The method is applicable to APEX, and other telescopes other than GBT.
|
|---|
| 235 | *
|
|---|
| 236 | * @param a Scantable which contains ON and OFF scans
|
|---|
| 237 | * @param a string that indicates calibration mode
|
|---|
| 238 | * @param a string that indicates antenna name
|
|---|
| 239 | **/
|
|---|
| 240 | casa::CountedPtr<Scantable> cwcal( const casa::CountedPtr<Scantable>& s,
|
|---|
| 241 | const casa::String calmode,
|
|---|
| 242 | const casa::String antname );
|
|---|
| [1391] | 243 |
|
|---|
| [1819] | 244 | /**
|
|---|
| 245 | * Calibrate frequency switched scans with Chopper-Wheel like
|
|---|
| 246 | * calibration method.
|
|---|
| 247 | *
|
|---|
| 248 | * The method is applicable to APEX, and other telescopes other than GBT.
|
|---|
| 249 | *
|
|---|
| 250 | * @param a Scantable which contains ON and OFF scans
|
|---|
| 251 | * @param a string that indicates antenna name
|
|---|
| 252 | **/
|
|---|
| 253 | casa::CountedPtr<Scantable> cwcalfs( const casa::CountedPtr<Scantable>& s,
|
|---|
| 254 | const casa::String antname );
|
|---|
| 255 |
|
|---|
| 256 |
|
|---|
| 257 | /**
|
|---|
| 258 | * Folding frequency-switch data
|
|---|
| 259 | * @param sig
|
|---|
| 260 | * @param ref
|
|---|
| 261 | * @param choffset
|
|---|
| 262 | **/
|
|---|
| 263 | casa::CountedPtr<Scantable> dofold( const casa::CountedPtr<Scantable> &sig,
|
|---|
| 264 | const casa::CountedPtr<Scantable> &ref,
|
|---|
| 265 | casa::Double choffset,
|
|---|
| [1937] | 266 | casa::Double choffset2 = 0.0 );
|
|---|
| [1819] | 267 |
|
|---|
| 268 | /**
|
|---|
| 269 | * ALMA calibration
|
|---|
| 270 | **/
|
|---|
| 271 | casa::CountedPtr<Scantable> almacal( const casa::CountedPtr<Scantable>& s,
|
|---|
| 272 | const casa::String calmode ) ;
|
|---|
| 273 | casa::CountedPtr<Scantable> almacalfs( const casa::CountedPtr<Scantable>& s ) ;
|
|---|
| 274 |
|
|---|
| [805] | 275 | casa::CountedPtr<Scantable>
|
|---|
| 276 | freqSwitch( const casa::CountedPtr<Scantable>& in );
|
|---|
| [716] | 277 |
|
|---|
| [805] | 278 | std::vector<float> statistic(const casa::CountedPtr<Scantable>& in,
|
|---|
| 279 | const std::vector<bool>& mask,
|
|---|
| 280 | const std::string& which);
|
|---|
| [457] | 281 |
|
|---|
| [1907] | 282 | std::vector<float> statisticRow(const casa::CountedPtr<Scantable>& in,
|
|---|
| 283 | const std::vector<bool>& mask,
|
|---|
| 284 | const std::string& which,
|
|---|
| 285 | int row);
|
|---|
| 286 |
|
|---|
| [1819] | 287 | std::vector< int > minMaxChan(const casa::CountedPtr<Scantable>& in,
|
|---|
| 288 | const std::vector<bool>& mask,
|
|---|
| 289 | const std::string& which);
|
|---|
| 290 |
|
|---|
| [805] | 291 | casa::CountedPtr<Scantable> bin( const casa::CountedPtr<Scantable>& in,
|
|---|
| 292 | int width=5);
|
|---|
| 293 | casa::CountedPtr<Scantable>
|
|---|
| 294 | resample(const casa::CountedPtr<Scantable>& in,
|
|---|
| 295 | const std::string& method, float width);
|
|---|
| [457] | 296 |
|
|---|
| [805] | 297 | casa::CountedPtr<Scantable>
|
|---|
| 298 | smooth(const casa::CountedPtr<Scantable>& in, const std::string& kernel,
|
|---|
| [1570] | 299 | float width, int order=2);
|
|---|
| [169] | 300 |
|
|---|
| [805] | 301 | casa::CountedPtr<Scantable>
|
|---|
| 302 | gainElevation(const casa::CountedPtr<Scantable>& in,
|
|---|
| [867] | 303 | const std::vector<float>& coeff,
|
|---|
| [805] | 304 | const std::string& fileName,
|
|---|
| [995] | 305 | const std::string& method);
|
|---|
| [805] | 306 | casa::CountedPtr<Scantable>
|
|---|
| 307 | convertFlux(const casa::CountedPtr<Scantable>& in, float d,
|
|---|
| 308 | float etaap, float jyperk);
|
|---|
| [152] | 309 |
|
|---|
| [805] | 310 | casa::CountedPtr<Scantable> opacity(const casa::CountedPtr<Scantable>& in,
|
|---|
| [1689] | 311 | const std::vector<float>& tau);
|
|---|
| [144] | 312 |
|
|---|
| [841] | 313 | casa::CountedPtr<Scantable>
|
|---|
| 314 | merge(const std::vector<casa::CountedPtr<Scantable> >& in);
|
|---|
| 315 |
|
|---|
| [896] | 316 | casa::CountedPtr<Scantable>
|
|---|
| 317 | invertPhase( const casa::CountedPtr<Scantable>& in);
|
|---|
| [912] | 318 |
|
|---|
| [896] | 319 | casa::CountedPtr<Scantable>
|
|---|
| 320 | rotateXYPhase( const casa::CountedPtr<Scantable>& in, float phase);
|
|---|
| [912] | 321 |
|
|---|
| [896] | 322 | casa::CountedPtr<Scantable>
|
|---|
| 323 | rotateLinPolPhase( const casa::CountedPtr<Scantable>& in, float phase);
|
|---|
| 324 |
|
|---|
| 325 | casa::CountedPtr<Scantable>
|
|---|
| 326 | swapPolarisations(const casa::CountedPtr<Scantable>& in);
|
|---|
| 327 |
|
|---|
| [917] | 328 | casa::CountedPtr<Scantable>
|
|---|
| 329 | frequencyAlign( const casa::CountedPtr<Scantable>& in,
|
|---|
| [927] | 330 | const std::string& refTime = "",
|
|---|
| 331 | const std::string& method = "cubic" );
|
|---|
| [917] | 332 |
|
|---|
| [992] | 333 | casa::CountedPtr<Scantable>
|
|---|
| 334 | convertPolarisation( const casa::CountedPtr<Scantable>& in,
|
|---|
| 335 | const std::string& newtype);
|
|---|
| [1143] | 336 |
|
|---|
| [1140] | 337 | casa::CountedPtr<Scantable>
|
|---|
| [1143] | 338 | mxExtract( const casa::CountedPtr<Scantable>& in,
|
|---|
| 339 | const std::string& srctype = "on");
|
|---|
| [992] | 340 |
|
|---|
| [1192] | 341 | /**
|
|---|
| 342 | * "hard" flag the data, this flags everything selected in setSelection()
|
|---|
| 343 | * @param frequency the frequency to remove
|
|---|
| 344 | * @param width the number of lags to flag left to the side of the frequency
|
|---|
| 345 | */
|
|---|
| 346 | casa::CountedPtr<Scantable>
|
|---|
| [1570] | 347 | lagFlag( const casa::CountedPtr<Scantable>& in, double start,
|
|---|
| 348 | double end, const std::string& mode="frequency");
|
|---|
| [1192] | 349 |
|
|---|
| [2177] | 350 | std::vector<float>
|
|---|
| 351 | fft( const casa::CountedPtr<Scantable>& in,
|
|---|
| 352 | const std::vector<int>& whichrow,
|
|---|
| 353 | bool getRealImag=false );
|
|---|
| 354 |
|
|---|
| [1819] | 355 | // test for average spectra with different channel/resolution
|
|---|
| 356 | casa::CountedPtr<Scantable>
|
|---|
| 357 | new_average( const std::vector<casa::CountedPtr<Scantable> >& in,
|
|---|
| 358 | const bool& compel,
|
|---|
| 359 | const std::vector<bool>& mask = std::vector<bool>(),
|
|---|
| 360 | const std::string& weight = "NONE",
|
|---|
| 361 | const std::string& avmode = "SCAN" )
|
|---|
| 362 | throw (casa::AipsError) ;
|
|---|
| 363 |
|
|---|
| [805] | 364 | private:
|
|---|
| [896] | 365 | casa::CountedPtr<Scantable> applyToPol( const casa::CountedPtr<Scantable>& in,
|
|---|
| 366 | STPol::polOperation fptr,
|
|---|
| 367 | casa::Float phase);
|
|---|
| 368 |
|
|---|
| [805] | 369 | static imethod stringToIMethod(const std::string& in);
|
|---|
| 370 | static WeightType stringToWeight(const std::string& in);
|
|---|
| [146] | 371 |
|
|---|
| [805] | 372 | void scaleByVector(casa::Table& in,
|
|---|
| 373 | const casa::Vector<casa::Float>& factor,
|
|---|
| 374 | bool dotsys);
|
|---|
| [152] | 375 |
|
|---|
| [805] | 376 | void scaleFromAsciiTable(casa::Table& in, const std::string& filename,
|
|---|
| 377 | const std::string& method,
|
|---|
| 378 | const casa::Vector<casa::Float>& xout,
|
|---|
| 379 | bool dotsys);
|
|---|
| [162] | 380 |
|
|---|
| [805] | 381 | void scaleFromTable(casa::Table& in, const casa::Table& table,
|
|---|
| 382 | const std::string& method,
|
|---|
| 383 | const casa::Vector<casa::Float>& xout, bool dotsys);
|
|---|
| [227] | 384 |
|
|---|
| [805] | 385 | void convertBrightnessUnits(casa::CountedPtr<Scantable>& in,
|
|---|
| 386 | bool tokelvin, float cfac);
|
|---|
| [227] | 387 |
|
|---|
| [1570] | 388 | casa::CountedPtr< Scantable >
|
|---|
| [1374] | 389 | smoothOther( const casa::CountedPtr< Scantable >& in,
|
|---|
| 390 | const std::string& kernel,
|
|---|
| [1570] | 391 | float width, int order=2 );
|
|---|
| [1374] | 392 |
|
|---|
| [805] | 393 | casa::CountedPtr< Scantable >
|
|---|
| 394 | getScantable(const casa::CountedPtr< Scantable >& in, bool droprows);
|
|---|
| [230] | 395 |
|
|---|
| [805] | 396 | casa::MaskedArray<casa::Float>
|
|---|
| 397 | maskedArray( const casa::Vector<casa::Float>& s,
|
|---|
| 398 | const casa::Vector<casa::uChar>& f );
|
|---|
| [1819] | 399 | casa::MaskedArray<casa::Double>
|
|---|
| 400 | maskedArray( const casa::Vector<casa::Double>& s,
|
|---|
| 401 | const casa::Vector<casa::uChar>& f );
|
|---|
| [805] | 402 | casa::Vector<casa::uChar>
|
|---|
| 403 | flagsFromMA(const casa::MaskedArray<casa::Float>& ma);
|
|---|
| [230] | 404 |
|
|---|
| [1819] | 405 | vector<float> getSpectrumFromTime( string reftime, casa::CountedPtr<Scantable>& s, string mode = "before" ) ;
|
|---|
| 406 | vector<float> getTcalFromTime( string reftime, casa::CountedPtr<Scantable>& s, string mode="before" ) ;
|
|---|
| 407 | vector<float> getTsysFromTime( string reftime, casa::CountedPtr<Scantable>& s, string mode="before" ) ;
|
|---|
| 408 | vector<int> getRowIdFromTime( string reftime, casa::CountedPtr<Scantable>& s ) ;
|
|---|
| 409 |
|
|---|
| 410 | // Chopper-Wheel type calibration
|
|---|
| 411 | vector<float> getCalibratedSpectra( casa::CountedPtr<Scantable>& on,
|
|---|
| 412 | casa::CountedPtr<Scantable>& off,
|
|---|
| 413 | casa::CountedPtr<Scantable>& sky,
|
|---|
| 414 | casa::CountedPtr<Scantable>& hot,
|
|---|
| 415 | casa::CountedPtr<Scantable>& cold,
|
|---|
| 416 | int index,
|
|---|
| 417 | string antname ) ;
|
|---|
| 418 | // Tsys * (ON-OFF)/OFF
|
|---|
| 419 | vector<float> getCalibratedSpectra( casa::CountedPtr<Scantable>& on,
|
|---|
| 420 | casa::CountedPtr<Scantable>& off,
|
|---|
| 421 | int index ) ;
|
|---|
| 422 | vector<float> getFSCalibratedSpectra( casa::CountedPtr<Scantable>& sig,
|
|---|
| 423 | casa::CountedPtr<Scantable>& ref,
|
|---|
| 424 | casa::CountedPtr<Scantable>& sky,
|
|---|
| 425 | casa::CountedPtr<Scantable>& hot,
|
|---|
| 426 | casa::CountedPtr<Scantable>& cold,
|
|---|
| 427 | int index ) ;
|
|---|
| 428 | vector<float> getFSCalibratedSpectra( casa::CountedPtr<Scantable>& sig,
|
|---|
| 429 | casa::CountedPtr<Scantable>& ref,
|
|---|
| 430 | vector< casa::CountedPtr<Scantable> >& sky,
|
|---|
| 431 | vector< casa::CountedPtr<Scantable> >& hot,
|
|---|
| 432 | vector< casa::CountedPtr<Scantable> >& cold,
|
|---|
| 433 | int index ) ;
|
|---|
| 434 | double getMJD( string strtime ) ;
|
|---|
| [2177] | 435 | void doFFT( std::vector<float>& out,
|
|---|
| 436 | casa::FFTServer< casa::Float, casa::Complex >& ffts,
|
|---|
| 437 | bool getRealImag,
|
|---|
| 438 | casa::Vector<casa::Float>& spec,
|
|---|
| 439 | casa::Vector<casa::uChar>& flag ) ;
|
|---|
| 440 | void doZeroOrderInterpolation( casa::Vector<casa::Float>& spec,
|
|---|
| 441 | casa::Vector<casa::uChar>& flag) ;
|
|---|
| [1819] | 442 |
|
|---|
| [805] | 443 | bool insitu_;
|
|---|
| 444 | };
|
|---|
| [234] | 445 |
|
|---|
| [805] | 446 | }
|
|---|
| [165] | 447 | #endif
|
|---|