source: trunk/src/STGrid.h@ 2375

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

Several bug fixes and updates

  • fixed misunderstanding of array shape when getting data
  • load flag data as Int (originally uChar/uInt) at the beginning of gridding
  • do not plot observed position and grid position by default
  • use Array (instead of Vector/Matrix/Cube) as much as possible


File size: 3.4 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>
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
38using namespace std ;
39using namespace casa ;
40
41namespace asap {
42class STGrid
43{
44public:
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
71private:
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 &center ) ;
[2368]83
84 void setData( Array<Float> &data,
[2374]85 Array<Complex> &gdata,
[2368]86 Array<Float> &gwgt ) ;
[2356]87
[2375]88 void getData( Array<Complex> &spectra,
89 Array<Double> &direction,
90 Array<uChar> &flagtra,
91 Array<uInt> &rflag,
92 Array<Float> &weight ) ;
93 void getData( Array<Complex> &spectra,
94 Array<Double> &direction,
95 Array<Int> &flagtra,
96 Array<Int> &rflag,
97 Array<Float> &weight ) ;
[2356]98
[2375]99 void getWeight( Array<Float> &w,
100 Array<Float> &tsys,
101 Array<Double> &tint ) ;
[2361]102
[2375]103 void toInt( Array<uChar> &u, Array<Int> &v ) ;
104 void toInt( Array<uInt> &u, Array<Int> &v ) ;
[2356]105
[2375]106 void toPixel( Array<Double> &world, Array<Double> &pixel ) ;
[2356]107
108 void boxFunc( Vector<Float> &convFunc, Int &convSize ) ;
109 void spheroidalFunc( Vector<Float> &convFunc ) ;
110 void gaussFunc( Vector<Float> &convFunc ) ;
111 void pbFunc( Vector<Float> &convFunc ) ;
112 void setConvFunc( Vector<Float> &convFunc ) ;
[2362]113 void selectData( Table &tab ) ;
[2356]114
[2369]115 Float polMean( const Float *p ) ;
116 Double polMean( const Double *p ) ;
117
[2375]118 void setupArray( Table &tab ) ;
[2371]119
120 void prepareTable( Table &tab, String &name ) ;
121
[2356]122 String infile_ ;
[2362]123 Int ifno_ ;
[2356]124 Int nx_ ;
125 Int ny_ ;
[2361]126 Int npol_ ;
127 Int nchan_ ;
128 Int nrow_ ;
[2356]129 Double cellx_ ;
130 Double celly_ ;
131 Vector<Double> center_ ;
132 String convType_ ;
133 Int convSupport_ ;
134 Int userSupport_ ;
135 Int convSampling_ ;
136 Array<Float> data_ ;
[2360]137 Vector<uInt> pollist_ ;
[2364]138 Vector<uInt> scanlist_ ;
[2361]139 String wtype_ ;
[2356]140
141 Table tab_ ;
142};
143}
144#endif
Note: See TracBrowser for help on using the repository browser.