source: trunk/src/STGrid.h @ 2364

Last change on this file since 2364 was 2364, checked in by Takeshi Nakazato, 12 years ago

New Development: No

JIRA Issue: Yes CAS-2816

Ready for Test: No

Interface Changes: Yes

What Interface Changed: see below

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): sdgrid task

Description: Describe your changes here...

  • setOption is renamed to setFunc
  • Implemented selection by SCANNO
  • Disabled to extend grid area for edge treatment
  • Added message for performance check


File size: 2.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/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 getData( Cube<Float> &spectra,
85                Matrix<Double> &direction,
86                Cube<uChar> &flagtra,
87                Matrix<uInt> &rflag,
88                Matrix<Float> &weight ) ;
89
90  void getWeight( Matrix<Float> &w,
91                  Cube<Float> &tsys,
92                  Matrix<Double> &tint ) ;
93
94  void toInt( Array<uChar> *u, Array<Int> *v ) ;
95  void toInt( Array<uInt> *u, Array<Int> *v ) ;
96
97  void toPixel( Matrix<Double> &world, Matrix<Double> &pixel ) ;
98 
99  void boxFunc( Vector<Float> &convFunc, Int &convSize ) ;
100  void spheroidalFunc( Vector<Float> &convFunc ) ;
101  void gaussFunc( Vector<Float> &convFunc ) ;
102  void pbFunc( Vector<Float> &convFunc ) ;
103  void setConvFunc( Vector<Float> &convFunc ) ;
104  void selectData( Table &tab ) ;
105
106  String infile_ ;
107  Int ifno_ ;
108  Int nx_ ;
109  Int ny_ ;
110  Int npol_ ;
111  Int nchan_ ;
112  Int nrow_ ;
113  Double cellx_ ;
114  Double celly_ ;
115  Vector<Double> center_ ;
116  String convType_ ;
117  Int convSupport_ ;
118  Int userSupport_ ;
119  Int convSampling_ ;
120  Array<Float> data_ ;
121  Vector<uInt> pollist_ ;
122  Vector<uInt> scanlist_ ;
123  String wtype_ ;
124
125  Table tab_ ;
126};
127}
128#endif
Note: See TracBrowser for help on using the repository browser.