[2197] | 1 | #ifndef ASAP_ASDM_FILLER_H
|
---|
| 2 | #define ASAP_ASDM_FILLER_H
|
---|
| 3 |
|
---|
| 4 | #include <string>
|
---|
| 5 |
|
---|
[2208] | 6 | #include <casa/Logging/LogSinkInterface.h>
|
---|
| 7 |
|
---|
[2197] | 8 | #include <FillerBase.h>
|
---|
| 9 | #include "ASDMReader.h"
|
---|
| 10 |
|
---|
| 11 | class ASDMFiller : public asap::FillerBase
|
---|
| 12 | {
|
---|
| 13 | public:
|
---|
| 14 | // constructor and destructor
|
---|
| 15 | ASDMFiller( casa::CountedPtr<asap::Scantable> stable ) ;
|
---|
| 16 | ~ASDMFiller() ;
|
---|
| 17 |
|
---|
| 18 | // open data
|
---|
| 19 | bool open( const std::string &filename, const casa::Record &rec ) ;
|
---|
| 20 |
|
---|
| 21 | // fill data
|
---|
| 22 | void fill() ;
|
---|
| 23 |
|
---|
| 24 | // close data
|
---|
| 25 | void close() ;
|
---|
| 26 |
|
---|
| 27 | // get reader object
|
---|
| 28 | casa::CountedPtr<ASDMReader> getReader() { return reader_ ; } ;
|
---|
| 29 |
|
---|
[2208] | 30 | // set logger
|
---|
| 31 | void setLogger( casa::CountedPtr<casa::LogSinkInterface> &logsink ) ;
|
---|
| 32 |
|
---|
[2197] | 33 | private:
|
---|
| 34 | // fill header
|
---|
| 35 | void fillHeader() ;
|
---|
| 36 |
|
---|
| 37 | // get IF key
|
---|
| 38 | casa::String getIFKey( casa::uInt ifno ) ;
|
---|
| 39 |
|
---|
| 40 | // get FREQUENCIES attributes from ifrec_
|
---|
| 41 | void getFrequencyRec( casa::String key,
|
---|
| 42 | double &refpix,
|
---|
| 43 | double &refval,
|
---|
| 44 | double &incr ) ;
|
---|
| 45 |
|
---|
| 46 | // set FREQUENCIES attributes to ifrec_
|
---|
| 47 | void setFrequencyRec( casa::String key,
|
---|
| 48 | double refpix,
|
---|
| 49 | double refval,
|
---|
| 50 | double incr ) ;
|
---|
| 51 |
|
---|
| 52 | // reshape float array spectra to Matrix<Float>
|
---|
| 53 | casa::Matrix<casa::Float> toMatrix( float *sp,
|
---|
| 54 | unsigned int npol,
|
---|
| 55 | unsigned int nchan ) ;
|
---|
| 56 |
|
---|
| 57 | // reshape 2d vector Tsys to Matrix<Float>
|
---|
| 58 | casa::Matrix<casa::Float> toMatrix( std::vector< std::vector<float> > &tsys,
|
---|
| 59 | unsigned int npol,
|
---|
| 60 | unsigned int nchan ) ;
|
---|
| 61 |
|
---|
| 62 | // reshape vector<float> to Vector<Float> with appropriate length
|
---|
| 63 | casa::Vector<casa::Float> toVector( std::vector<float> &tau,
|
---|
| 64 | unsigned int npol ) ;
|
---|
| 65 |
|
---|
| 66 | // create TCAL time string from MJD
|
---|
| 67 | casa::String toTcalTime( casa::Double mjd ) ;
|
---|
| 68 |
|
---|
| 69 | // AZEL to J2000
|
---|
| 70 | void toJ2000( casa::Vector<casa::Double> &dir,
|
---|
| 71 | double az,
|
---|
| 72 | double el,
|
---|
| 73 | casa::Double mjd,
|
---|
| 74 | casa::Vector<casa::Double> antpos ) ;
|
---|
| 75 |
|
---|
[2225] | 76 | // to J2000
|
---|
| 77 | casa::Vector<casa::Double> toJ2000( casa::Vector<casa::Double> dir,
|
---|
| 78 | casa::String dirref,
|
---|
| 79 | casa::Double mjd,
|
---|
| 80 | casa::Vector<casa::Double> antpos ) ;
|
---|
| 81 |
|
---|
[2218] | 82 | // get frequency frame enum value from string
|
---|
| 83 | casa::MFrequency::Types toFrameType( std::string &s ) ;
|
---|
| 84 |
|
---|
[2225] | 85 | // to LSRK
|
---|
| 86 | // utc must be UTC time in "d" (day)
|
---|
| 87 | // antpos must be ITRF value in "m"
|
---|
| 88 | casa::Double toLSRK( casa::Double freq,
|
---|
| 89 | casa::String freqref,
|
---|
| 90 | casa::Double utc,
|
---|
| 91 | casa::Vector<casa::Double> antpos,
|
---|
| 92 | casa::Vector<casa::Double> dir,
|
---|
| 93 | casa::String dirref ) ;
|
---|
| 94 |
|
---|
[2197] | 95 | casa::CountedPtr<ASDMReader> reader_ ;
|
---|
| 96 | casa::Int antennaId_ ;
|
---|
| 97 | casa::String antennaName_ ;
|
---|
| 98 |
|
---|
| 99 | casa::Record ifrec_ ;
|
---|
| 100 |
|
---|
[2208] | 101 | casa::CountedPtr<casa::LogSinkInterface> logsink_ ;
|
---|
| 102 |
|
---|
| 103 | casa::String className_ ;
|
---|
[2754] | 104 | casa::Bool freqToLsr_ ;
|
---|
[2208] | 105 |
|
---|
[2197] | 106 | } ;
|
---|
| 107 | #endif // ASAP_ASDM_FILLER_H
|
---|