source: trunk/src/STSideBandSep.h@ 2849

Last change on this file since 2849 was 2828, checked in by Kana Sugimoto, 11 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sbseparator

Description: Removed obsolete codes and variables.


File size: 5.0 KB
Line 
1// C++ Interface: STSideBandSep
2//
3// Description:
4// A class to invoke sideband separation of Scantable
5//
6// Author: Kanako Sugimoto <kana.sugi@nao.ac.jp>, (C) 2012
7//
8// Copyright: See COPYING file that comes with this distribution
9//
10//
11#ifndef ASAPSIDEBANDSEP_H
12#define ASAPSIDEBANDSEP_H
13
14// STL
15#include <iostream>
16#include <string>
17#include <vector>
18// casacore
19#include <casa/aips.h>
20#include <casa/Utilities/CountedPtr.h>
21#include <measures/Measures/MDirection.h>
22#include <coordinates/Coordinates/DirectionCoordinate.h>
23#include <coordinates/Coordinates/SpectralCoordinate.h>
24#include <scimath/Mathematics/FFTServer.h>
25// asap
26#include "ScantableWrapper.h"
27#include "Scantable.h"
28
29using namespace std;
30using namespace casa;
31
32namespace asap {
33
34class STSideBandSep {
35public:
36 /**
37 * constructors and a destructor
38 **/
39 STSideBandSep() { throw( AipsError("No data set to process") ); };
40 explicit STSideBandSep(const vector<string> &names);
41 explicit STSideBandSep(const vector<ScantableWrapper> &tables);
42 virtual ~STSideBandSep();
43
44
45 /**
46 * Separate side bands
47 **/
48 void separate(string outname);
49
50 /**
51 * Set IFNO and frequency tolerance to select data to process
52 **/
53 void setFrequency(const unsigned int ifno, const string freqtol,
54 const string frame="");
55
56 /**
57 * Set direction tolerance to group spectra.
58 * The spectra within this range will be averaged before procesing.
59 **/
60 void setDirTolerance(const vector<string> dirtol);
61
62 /**
63 * Set the number of channels shifted in image side band
64 * of each of scantable.
65 **/
66 void setShift(const vector<double> &shift);
67
68 /**
69 * Set rejection limit of solution.
70 **/
71 void setThreshold(const double limit);
72
73 /**
74 * Resolve both image and signal sideband when true is set.
75 **/
76 void solveBoth(const bool flag) { doboth_ = flag; };
77
78 /**
79 * Obtain spectra by subtracting the solution of the other sideband.
80 **/
81 void solvefromOther(const bool flag) { otherside_ = flag; };
82
83 /**
84 * Set scantable to fill frequencies of image sideband (temporal)
85 **/
86 void setImageTable(const ScantableWrapper &s);
87 void setScanTb0(const ScantableWrapper &s);
88
89 /**
90 * Set additional information to fill frequencies of image sideband
91 **/
92 void setLO1(const string lo1, const string frame="TOPO",
93 const double reftime=-1, string refdir="");
94 void setLO1Root(const string name);
95
96private:
97 /** Initialize member variables **/
98 void init();
99 void initshift();
100
101 /** Return if the path exists (optionally, check file type) **/
102 Bool checkFile(const string name, string type="");
103
104 /** **/
105 unsigned int setupShift();
106 bool getFreqInfo(const CountedPtr<Scantable> &stab, const unsigned int &ifno,
107 double &freq0, double &incr, unsigned int &nchan);
108
109 /** Grid scantable **/
110 ScantableWrapper gridTable();
111 void mapExtent(vector< CountedPtr<Scantable> > &tablist,
112 Double &xmin, Double &xmax,
113 Double &ymin, Double &ymax);
114
115 /**
116 * Actual calculation of frequencies of image sideband
117 **/
118 void solveImageFrequency();
119
120 /**
121 * Get LO1 frequency to solve the frequencies of image side band
122 **/
123 bool getLo1FromAsdm(const string asdmname,
124 const double refval, const double refpix,
125 const double increment, const int nChan);
126 bool getLo1FromAsisTab(const string msname,
127 const double refval, const double refpix,
128 const double increment, const int nChan);
129 bool getLo1FromScanTab(casa::CountedPtr< Scantable > &scantab,
130 const double refval, const double refpix,
131 const double increment, const int nChan);
132 bool getSpectraToSolve(const int polId, const int beamId,
133 const double dirX, const double dirY,
134 Matrix<float> &specmat, vector<uInt> &tabIdvec);
135
136 vector<float> solve(const Matrix<float> &specmat,
137 const vector<uInt> &tabIdvec,
138 const bool signal = true);
139
140 void shiftSpectrum(const Vector<float> &invec, double shift,
141 Vector<float> &outvec);
142
143 void deconvolve(Matrix<float> &specmat, const vector<double> shiftvec,
144 const double threshold, Matrix<float> &outmat);
145
146 void aggregateMat(Matrix<float> &inmat, vector<float> &outvec);
147
148 void subtractFromOther(const Matrix<float> &shiftmat,
149 const vector<float> &invec,
150 const vector<double> &shift,
151 vector<float> &outvec);
152
153
154
155 /** Member variables **/
156 // input tables
157 vector<string> infileList_;
158 vector< CountedPtr<Scantable> > intabList_;
159 unsigned int ntable_;
160 // frequency and direction setup to select data.
161 int sigIfno_;
162 Quantum<Double> ftol_;
163 MFrequency::Types solFrame_;
164 vector<double> sigShift_, imgShift_;
165 unsigned int nshift_, nchan_;
166 vector< CountedPtr<Scantable> > tableList_;
167 Double xtol_, ytol_;
168 // solution parameters
169 bool otherside_, doboth_;
170 double rejlimit_;
171 // LO1
172 double lo1Freq_; // in Hz
173 MFrequency::Types loFrame_;
174 double loTime_;
175 string loDir_;
176 string asdmName_, asisName_;
177
178 //CountedPtr<Scantable> imgTab_p, sigTab_p;
179 CountedPtr<Scantable> imgTab_p, sigTab_p;
180 Table::TableType tp_;
181 FFTServer<Float, Complex> fftsf, fftsi;
182
183}; // class
184
185} // namespace
186
187#endif
Note: See TracBrowser for help on using the repository browser.