source: trunk/src/STGrid.h@ 2377

Last change on this file since 2377 was 2375, 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...

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
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/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
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
51 void setIF( unsigned int ifno ) { ifno_ = ifno ; } ;
52
53 void setPolList( vector<unsigned int> pols ) ;
54
55 void setScanList( vector<unsigned int> scans ) ;
56
57 void defineImage( int nx=-1,
58 int ny=-1,
59 string scellx="",
60 string scelly="",
61 string scenter="" ) ;
62 void setFunc( string convtype="box",
63 int convsupport=-1 ) ;
64
65 void setWeight( const string wType="uniform" ) ;
66
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 ) ;
83
84 void setData( Array<Float> &data,
85 Array<Complex> &gdata,
86 Array<Float> &gwgt ) ;
87
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 ) ;
98
99 void getWeight( Array<Float> &w,
100 Array<Float> &tsys,
101 Array<Double> &tint ) ;
102
103 void toInt( Array<uChar> &u, Array<Int> &v ) ;
104 void toInt( Array<uInt> &u, Array<Int> &v ) ;
105
106 void toPixel( Array<Double> &world, Array<Double> &pixel ) ;
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 ) ;
113 void selectData( Table &tab ) ;
114
115 Float polMean( const Float *p ) ;
116 Double polMean( const Double *p ) ;
117
118 void setupArray( Table &tab ) ;
119
120 void prepareTable( Table &tab, String &name ) ;
121
122 String infile_ ;
123 Int ifno_ ;
124 Int nx_ ;
125 Int ny_ ;
126 Int npol_ ;
127 Int nchan_ ;
128 Int nrow_ ;
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_ ;
137 Vector<uInt> pollist_ ;
138 Vector<uInt> scanlist_ ;
139 String wtype_ ;
140
141 Table tab_ ;
142};
143}
144#endif
Note: See TracBrowser for help on using the repository browser.