source: trunk/src/STGrid.h @ 2384

Last change on this file since 2384 was 2384, checked in by Takeshi Nakazato, 12 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...

Updated call_ggridsd to be easy to call.


File size: 4.9 KB
RevLine 
[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>
[2381]21#include <casa/Arrays/Array.h>
[2356]22#include <casa/Arrays/Vector.h>
[2381]23#include <casa/Containers/RecordField.h>
[2356]24
25#include <tables/Tables/Table.h>
[2379]26#include <tables/Tables/ScalarColumn.h>
27#include <tables/Tables/ArrayColumn.h>
[2381]28//#include <tables/Tables/TableRow.h>
[2356]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
[2362]47  void setIF( unsigned int ifno ) { ifno_ = ifno ; } ;
48
[2360]49  void setPolList( vector<unsigned int> pols ) ;
50
[2364]51  void setScanList( vector<unsigned int> scans ) ;
52
[2356]53  void defineImage( int nx=-1,
54                    int ny=-1,
55                    string scellx="",
56                    string scelly="",
57                    string scenter="" ) ;
[2364]58  void setFunc( string convtype="box",
59                int convsupport=-1 ) ;
[2361]60
61  void setWeight( const string wType="uniform" ) ;
62
[2356]63  void grid() ;
64 
65  string saveData( string outfile="" ) ;
66
67private:
68  void init() ;
69
[2382]70  // actual gridding
71  void gridPerRow() ;
72  void gridPerPol() ;
73
[2356]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 ) ;
[2368]83
[2378]84  void setData( Array<Complex> &gdata,
[2368]85                Array<Float> &gwgt ) ;
[2356]86 
[2382]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 ) ;
[2379]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 ) ;
[2356]107
[2375]108  void getWeight( Array<Float> &w,
109                  Array<Float> &tsys,
110                  Array<Double> &tint ) ;
[2382]111 
[2375]112  void toInt( Array<uChar> &u, Array<Int> &v ) ;
113  void toInt( Array<uInt> &u, Array<Int> &v ) ;
[2356]114
[2375]115  void toPixel( Array<Double> &world, Array<Double> &pixel ) ;
[2356]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
[2371]123  void prepareTable( Table &tab, String &name ) ;
124
[2378]125  Bool pastEnd() ;
126
[2379]127  void selectData() ;
128  void setupArray() ;
[2378]129
[2379]130  Bool examine() ;
[2382]131  void attach( Table &tab ) ;
[2379]132
[2384]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,
[2381]151                     Int *chanMap,
152                     Int *polMap ) ;
[2379]153
[2382]154  void initPol( Int ipol ) ;
[2381]155
[2382]156
[2356]157  String infile_ ;
[2362]158  Int ifno_ ;
[2356]159  Int nx_ ;
160  Int ny_ ;
[2361]161  Int npol_ ;
162  Int nchan_ ;
163  Int nrow_ ;
[2356]164  Double cellx_ ;
165  Double celly_ ;
166  Vector<Double> center_ ;
167  String convType_ ;
168  Int convSupport_ ;
169  Int userSupport_ ;
170  Int convSampling_ ;
171  Array<Float> data_ ;
[2360]172  Vector<uInt> pollist_ ;
[2364]173  Vector<uInt> scanlist_ ;
[2361]174  String wtype_ ;
[2356]175
176  Table tab_ ;
[2382]177  Table ptab_ ;
[2379]178  ROArrayColumn<Float> spectraCol_ ;
179  ROArrayColumn<uChar> flagtraCol_ ;
180  ROArrayColumn<Double> directionCol_ ;
181  ROScalarColumn<uInt> flagRowCol_ ;
182  ROArrayColumn<Float> tsysCol_ ;
183  ROScalarColumn<Double> intervalCol_ ;
184  Int nprocessed_ ;
185  Vector<uInt> rows_ ;
186  Int nchunk_ ;
[2381]187
188  Array<Float> spectraF_ ;
189  Array<uChar> flagtraUC_ ;
190  Array<uInt> rflagUI_ ;
191
[2356]192};
193}
194#endif
Note: See TracBrowser for help on using the repository browser.