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> |
---|
18 | #include <vector> |
---|
19 | |
---|
20 | #include <casa/BasicSL/String.h> |
---|
21 | #include <casa/Arrays/Vector.h> |
---|
22 | #include <casa/Arrays/Matrix.h> |
---|
23 | #include <casa/Arrays/Cube.h> |
---|
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 | |
---|
51 | void setPolList( vector<unsigned int> pols ) ; |
---|
52 | |
---|
53 | void defineImage( int nx=-1, |
---|
54 | int ny=-1, |
---|
55 | string scellx="", |
---|
56 | string scelly="", |
---|
57 | string scenter="" ) ; |
---|
58 | void setOption( string convtype="box", |
---|
59 | int convsupport=-1 ) ; |
---|
60 | |
---|
61 | void setWeight( const string wType="uniform" ) ; |
---|
62 | |
---|
63 | void grid() ; |
---|
64 | |
---|
65 | string saveData( string outfile="" ) ; |
---|
66 | |
---|
67 | private: |
---|
68 | void init() ; |
---|
69 | |
---|
70 | void setupGrid( Int &nx, |
---|
71 | Int &ny, |
---|
72 | String &cellx, |
---|
73 | String &celly, |
---|
74 | Double &xmin, |
---|
75 | Double &xmax, |
---|
76 | Double &ymin, |
---|
77 | Double &ymax, |
---|
78 | String ¢er ) ; |
---|
79 | |
---|
80 | void getData( String &infile, |
---|
81 | Cube<Float> &spectra, |
---|
82 | Matrix<Double> &direction, |
---|
83 | Cube<uChar> &flagtra, |
---|
84 | Matrix<uInt> &rflag, |
---|
85 | Matrix<Float> &weight ) ; |
---|
86 | |
---|
87 | void getWeight( Matrix<Float> &w, |
---|
88 | Cube<Float> &tsys, |
---|
89 | Matrix<Double> &tint ) ; |
---|
90 | |
---|
91 | void toInt( Array<uChar> *u, Array<Int> *v ) ; |
---|
92 | void toInt( Array<uInt> *u, Array<Int> *v ) ; |
---|
93 | |
---|
94 | void toPixel( Matrix<Double> &world, Matrix<Double> &pixel ) ; |
---|
95 | |
---|
96 | void boxFunc( Vector<Float> &convFunc, Int &convSize ) ; |
---|
97 | void spheroidalFunc( Vector<Float> &convFunc ) ; |
---|
98 | void gaussFunc( Vector<Float> &convFunc ) ; |
---|
99 | void pbFunc( Vector<Float> &convFunc ) ; |
---|
100 | void setConvFunc( Vector<Float> &convFunc ) ; |
---|
101 | |
---|
102 | String infile_ ; |
---|
103 | Int nx_ ; |
---|
104 | Int ny_ ; |
---|
105 | Int npol_ ; |
---|
106 | Int nchan_ ; |
---|
107 | Int nrow_ ; |
---|
108 | Int ngrid_ ; |
---|
109 | Double cellx_ ; |
---|
110 | Double celly_ ; |
---|
111 | Vector<Double> center_ ; |
---|
112 | String convType_ ; |
---|
113 | Int convSupport_ ; |
---|
114 | Int userSupport_ ; |
---|
115 | Int convSampling_ ; |
---|
116 | Array<Float> data_ ; |
---|
117 | Vector<uInt> pollist_ ; |
---|
118 | String wtype_ ; |
---|
119 | |
---|
120 | Table tab_ ; |
---|
121 | }; |
---|
122 | } |
---|
123 | #endif |
---|