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 | void grid() ;
|
---|
61 |
|
---|
62 | string saveData( string outfile="" ) ;
|
---|
63 |
|
---|
64 | private:
|
---|
65 | void init() ;
|
---|
66 |
|
---|
67 | void setupGrid( Int &nx,
|
---|
68 | Int &ny,
|
---|
69 | String &cellx,
|
---|
70 | String &celly,
|
---|
71 | Double &xmin,
|
---|
72 | Double &xmax,
|
---|
73 | Double &ymin,
|
---|
74 | Double &ymax,
|
---|
75 | String ¢er ) ;
|
---|
76 |
|
---|
77 | void getData( String &infile,
|
---|
78 | Cube<Float> &spectra,
|
---|
79 | Matrix<Double> &direction,
|
---|
80 | Cube<uChar> &flagtra,
|
---|
81 | Matrix<uInt> &rflag ) ;
|
---|
82 |
|
---|
83 | void toInt( Array<uChar> *u, Array<Int> *v ) ;
|
---|
84 | void toInt( Array<uInt> *u, Array<Int> *v ) ;
|
---|
85 |
|
---|
86 | void toPixel( Matrix<Double> &world, Matrix<Double> &pixel ) ;
|
---|
87 |
|
---|
88 | void boxFunc( Vector<Float> &convFunc, Int &convSize ) ;
|
---|
89 | void spheroidalFunc( Vector<Float> &convFunc ) ;
|
---|
90 | void gaussFunc( Vector<Float> &convFunc ) ;
|
---|
91 | void pbFunc( Vector<Float> &convFunc ) ;
|
---|
92 | void setConvFunc( Vector<Float> &convFunc ) ;
|
---|
93 |
|
---|
94 | String infile_ ;
|
---|
95 | Int nx_ ;
|
---|
96 | Int ny_ ;
|
---|
97 | Double cellx_ ;
|
---|
98 | Double celly_ ;
|
---|
99 | Vector<Double> center_ ;
|
---|
100 | String convType_ ;
|
---|
101 | Int convSupport_ ;
|
---|
102 | Int userSupport_ ;
|
---|
103 | Int convSampling_ ;
|
---|
104 | Array<Float> data_ ;
|
---|
105 | Vector<uInt> pollist_ ;
|
---|
106 |
|
---|
107 | Table tab_ ;
|
---|
108 | };
|
---|
109 | }
|
---|
110 | #endif
|
---|