[2356] | 1 | // |
---|
| 2 | // C++ Interface: STGrid |
---|
| 3 | // |
---|
| 4 | // Description: |
---|
| 5 | // |
---|
| 6 | // |
---|
| 7 | // Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2011 |
---|
| 8 | // |
---|
| 9 | // Copyright: See COPYING file that comes with this distribution |
---|
| 10 | // |
---|
| 11 | // |
---|
| 12 | #ifndef ASAPSTGRID_H |
---|
| 13 | #define ASAPSTGRID_H |
---|
| 14 | |
---|
| 15 | #include <iostream> |
---|
| 16 | #include <fstream> |
---|
| 17 | #include <string> |
---|
[2360] | 18 | #include <vector> |
---|
[2356] | 19 | |
---|
| 20 | #include <casa/BasicSL/String.h> |
---|
| 21 | #include <casa/Arrays/Vector.h> |
---|
[2360] | 22 | #include <casa/Arrays/Matrix.h> |
---|
| 23 | #include <casa/Arrays/Cube.h> |
---|
[2356] | 24 | // #include <casa/Arrays/ArrayMath.h> |
---|
| 25 | // #include <casa/Inputs/Input.h> |
---|
| 26 | // #include <casa/Quanta/Quantum.h> |
---|
| 27 | // #include <casa/Quanta/QuantumHolder.h> |
---|
| 28 | // #include <casa/Utilities/CountedPtr.h> |
---|
| 29 | |
---|
| 30 | #include <tables/Tables/Table.h> |
---|
| 31 | // #include <tables/Tables/ScalarColumn.h> |
---|
| 32 | // #include <tables/Tables/ArrayColumn.h> |
---|
| 33 | |
---|
| 34 | // #include <measures/Measures/MDirection.h> |
---|
| 35 | |
---|
| 36 | // #include "Scantable.h" |
---|
| 37 | |
---|
| 38 | using namespace std ; |
---|
| 39 | using namespace casa ; |
---|
| 40 | |
---|
| 41 | namespace asap { |
---|
| 42 | class STGrid |
---|
| 43 | { |
---|
| 44 | public: |
---|
| 45 | STGrid() ; |
---|
| 46 | STGrid( const string infile ) ; |
---|
| 47 | virtual ~STGrid() {} ; |
---|
| 48 | |
---|
| 49 | void setFileIn( const string infile ) ; |
---|
| 50 | |
---|
[2362] | 51 | void setIF( unsigned int ifno ) { ifno_ = ifno ; } ; |
---|
| 52 | |
---|
[2360] | 53 | void setPolList( vector<unsigned int> pols ) ; |
---|
| 54 | |
---|
[2364] | 55 | void setScanList( vector<unsigned int> scans ) ; |
---|
| 56 | |
---|
[2356] | 57 | void defineImage( int nx=-1, |
---|
| 58 | int ny=-1, |
---|
| 59 | string scellx="", |
---|
| 60 | string scelly="", |
---|
| 61 | string scenter="" ) ; |
---|
[2364] | 62 | void setFunc( string convtype="box", |
---|
| 63 | int convsupport=-1 ) ; |
---|
[2361] | 64 | |
---|
| 65 | void setWeight( const string wType="uniform" ) ; |
---|
| 66 | |
---|
[2356] | 67 | void grid() ; |
---|
| 68 | |
---|
| 69 | string saveData( string outfile="" ) ; |
---|
| 70 | |
---|
| 71 | private: |
---|
| 72 | void init() ; |
---|
| 73 | |
---|
| 74 | void setupGrid( Int &nx, |
---|
| 75 | Int &ny, |
---|
| 76 | String &cellx, |
---|
| 77 | String &celly, |
---|
| 78 | Double &xmin, |
---|
| 79 | Double &xmax, |
---|
| 80 | Double &ymin, |
---|
| 81 | Double &ymax, |
---|
| 82 | String ¢er ) ; |
---|
[2368] | 83 | |
---|
| 84 | void setData( Array<Float> &data, |
---|
| 85 | Array<Float> &gdata, |
---|
| 86 | Array<Float> &gwgt ) ; |
---|
[2356] | 87 | |
---|
[2362] | 88 | void getData( Cube<Float> &spectra, |
---|
[2356] | 89 | Matrix<Double> &direction, |
---|
[2360] | 90 | Cube<uChar> &flagtra, |
---|
[2361] | 91 | Matrix<uInt> &rflag, |
---|
| 92 | Matrix<Float> &weight ) ; |
---|
[2356] | 93 | |
---|
[2361] | 94 | void getWeight( Matrix<Float> &w, |
---|
| 95 | Cube<Float> &tsys, |
---|
| 96 | Matrix<Double> &tint ) ; |
---|
| 97 | |
---|
[2360] | 98 | void toInt( Array<uChar> *u, Array<Int> *v ) ; |
---|
| 99 | void toInt( Array<uInt> *u, Array<Int> *v ) ; |
---|
[2356] | 100 | |
---|
| 101 | void toPixel( Matrix<Double> &world, Matrix<Double> &pixel ) ; |
---|
| 102 | |
---|
| 103 | void boxFunc( Vector<Float> &convFunc, Int &convSize ) ; |
---|
| 104 | void spheroidalFunc( Vector<Float> &convFunc ) ; |
---|
| 105 | void gaussFunc( Vector<Float> &convFunc ) ; |
---|
| 106 | void pbFunc( Vector<Float> &convFunc ) ; |
---|
| 107 | void setConvFunc( Vector<Float> &convFunc ) ; |
---|
[2362] | 108 | void selectData( Table &tab ) ; |
---|
[2356] | 109 | |
---|
[2369] | 110 | Float polMean( const Float *p ) ; |
---|
| 111 | Double polMean( const Double *p ) ; |
---|
| 112 | |
---|
[2371] | 113 | void updatePolList( Table &tab ) ; |
---|
| 114 | |
---|
| 115 | void prepareTable( Table &tab, String &name ) ; |
---|
| 116 | |
---|
[2356] | 117 | String infile_ ; |
---|
[2362] | 118 | Int ifno_ ; |
---|
[2356] | 119 | Int nx_ ; |
---|
| 120 | Int ny_ ; |
---|
[2361] | 121 | Int npol_ ; |
---|
| 122 | Int nchan_ ; |
---|
| 123 | Int nrow_ ; |
---|
[2356] | 124 | Double cellx_ ; |
---|
| 125 | Double celly_ ; |
---|
| 126 | Vector<Double> center_ ; |
---|
| 127 | String convType_ ; |
---|
| 128 | Int convSupport_ ; |
---|
| 129 | Int userSupport_ ; |
---|
| 130 | Int convSampling_ ; |
---|
| 131 | Array<Float> data_ ; |
---|
[2360] | 132 | Vector<uInt> pollist_ ; |
---|
[2364] | 133 | Vector<uInt> scanlist_ ; |
---|
[2361] | 134 | String wtype_ ; |
---|
[2356] | 135 | |
---|
| 136 | Table tab_ ; |
---|
| 137 | }; |
---|
| 138 | } |
---|
| 139 | #endif |
---|