source: trunk/src/STGrid.h @ 2368

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

New Development: No

JIRA Issue: Yes CAS-2816

Ready for Test: No

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...

Speed up code.

  • setData: defined. Changed Array access, which was using Slicer, to

direct data access using getStorage.

  • saveData: reference table is created as Plain table instead of Memory

table to save memory usage

  • getWeight: skip weight initialization.


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