source: trunk/src/STGrid.h@ 2387

Last change on this file since 2387 was 2386, checked in by Takeshi Nakazato, 13 years ago

New Development: No

JIRA Issue: Yes CAS-2816

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...

Do data selection by TableExprNode only when it is really needed.


File size: 4.9 KB
Line 
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/Array.h>
22#include <casa/Arrays/Vector.h>
23#include <casa/Containers/RecordField.h>
24
25#include <tables/Tables/Table.h>
26#include <tables/Tables/ScalarColumn.h>
27#include <tables/Tables/ArrayColumn.h>
28//#include <tables/Tables/TableRow.h>
29
30// #include <measures/Measures/MDirection.h>
31
32// #include "Scantable.h"
33
34using namespace std ;
35using namespace casa ;
36
37namespace asap {
38class STGrid
39{
40public:
41 STGrid() ;
42 STGrid( const string infile ) ;
43 virtual ~STGrid() {} ;
44
45 void setFileIn( const string infile ) ;
46
47 void setIF( unsigned int ifno ) { ifno_ = ifno ; } ;
48
49 void setPolList( vector<unsigned int> pols ) ;
50
51 void setScanList( vector<unsigned int> scans ) ;
52
53 void defineImage( int nx=-1,
54 int ny=-1,
55 string scellx="",
56 string scelly="",
57 string scenter="" ) ;
58 void setFunc( 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
67private:
68 void init() ;
69
70 // actual gridding
71 void gridPerRow() ;
72 void gridPerPol() ;
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 &center ) ;
83
84 void setData( Array<Complex> &gdata,
85 Array<Float> &gwgt ) ;
86
87 void getDataPerPol( Array<Complex> &spectra,
88 Array<Double> &direction,
89 Array<Int> &flagtra,
90 Array<Int> &rflag,
91 Array<Float> &weight ) ;
92 void getDataPerPol( Array<Float> &spectra,
93 Array<Double> &direction,
94 Array<uChar> &flagtra,
95 Array<uInt> &rflag,
96 Array<Float> &weight ) ;
97 Int getDataChunk( Array<Complex> &spectra,
98 Array<Double> &direction,
99 Array<Int> &flagtra,
100 Array<Int> &rflag,
101 Array<Float> &weight ) ;
102 Int getDataChunk( Array<Float> &spectra,
103 Array<Double> &direction,
104 Array<uChar> &flagtra,
105 Array<uInt> &rflag,
106 Array<Float> &weight ) ;
107
108 void getWeight( Array<Float> &w,
109 Array<Float> &tsys,
110 Array<Double> &tint ) ;
111
112 void toInt( Array<uChar> &u, Array<Int> &v ) ;
113 void toInt( Array<uInt> &u, Array<Int> &v ) ;
114
115 void toPixel( Array<Double> &world, Array<Double> &pixel ) ;
116
117 void boxFunc( Vector<Float> &convFunc, Int &convSize ) ;
118 void spheroidalFunc( Vector<Float> &convFunc ) ;
119 void gaussFunc( Vector<Float> &convFunc ) ;
120 void pbFunc( Vector<Float> &convFunc ) ;
121 void setConvFunc( Vector<Float> &convFunc ) ;
122
123 void prepareTable( Table &tab, String &name ) ;
124
125 Bool pastEnd() ;
126
127 void selectData() ;
128 void setupArray() ;
129
130 Bool examine() ;
131 void attach( Table &tab ) ;
132
133 void call_ggridsd( Array<Double> &xy,
134 Array<Complex> &values,
135 Int &nvispol,
136 Int &nvischan,
137 Array<Int> &flag,
138 Array<Int> &rflag,
139 Array<Float> &weight,
140 Int &nrow,
141 Int &irow,
142 Array<Complex> &grid,
143 Array<Float> &wgrid,
144 Int &nx,
145 Int &ny,
146 Int &npol,
147 Int &nchan,
148 Int &support,
149 Int &sampling,
150 Vector<Float> &convFunc,
151 Int *chanMap,
152 Int *polMap ) ;
153
154 void initPol( Int ipol ) ;
155 Bool isMultiIF( Table &tab ) ;
156
157
158 String infile_ ;
159 Int ifno_ ;
160 Int nx_ ;
161 Int ny_ ;
162 Int npol_ ;
163 Int npolOrg_ ;
164 Int nchan_ ;
165 Int nrow_ ;
166 Double cellx_ ;
167 Double celly_ ;
168 Vector<Double> center_ ;
169 String convType_ ;
170 Int convSupport_ ;
171 Int userSupport_ ;
172 Int convSampling_ ;
173 Array<Float> data_ ;
174 Vector<uInt> pollist_ ;
175 Vector<uInt> scanlist_ ;
176 String wtype_ ;
177
178 Table tab_ ;
179 Table ptab_ ;
180 ROArrayColumn<Float> spectraCol_ ;
181 ROArrayColumn<uChar> flagtraCol_ ;
182 ROArrayColumn<Double> directionCol_ ;
183 ROScalarColumn<uInt> flagRowCol_ ;
184 ROArrayColumn<Float> tsysCol_ ;
185 ROScalarColumn<Double> intervalCol_ ;
186 Int nprocessed_ ;
187 Vector<uInt> rows_ ;
188 Int nchunk_ ;
189
190 Array<Float> spectraF_ ;
191 Array<uChar> flagtraUC_ ;
192 Array<uInt> rflagUI_ ;
193
194};
195}
196#endif
Note: See TracBrowser for help on using the repository browser.