source: trunk/external-alma/atnf/PKSIO/PKSreader.h@ 2317

Last change on this file since 2317 was 1757, checked in by Kana Sugimoto, 14 years ago

New Development: Yes

JIRA Issue: Yes (CAS-2211)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: ASAP 3.0.0 interface changes

Test Programs:

Put in Release Notes: Yes

Module(s): all the CASA sd tools and tasks are affected.

Description: Merged ATNF-ASAP 3.0.0 developments to CASA (alma) branch.

Note you also need to update casa/code/atnf.


File size: 7.3 KB
Line 
1//#---------------------------------------------------------------------------
2//# PKSreader.h: Class to read Parkes multibeam data.
3//#---------------------------------------------------------------------------
4//# livedata - processing pipeline for single-dish, multibeam spectral data.
5//# Copyright (C) 2000-2009, Australia Telescope National Facility, CSIRO
6//#
7//# This file is part of livedata.
8//#
9//# livedata is free software: you can redistribute it and/or modify it under
10//# the terms of the GNU General Public License as published by the Free
11//# Software Foundation, either version 3 of the License, or (at your option)
12//# any later version.
13//#
14//# livedata is distributed in the hope that it will be useful, but WITHOUT
15//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17//# more details.
18//#
19//# You should have received a copy of the GNU General Public License along
20//# with livedata. If not, see <http://www.gnu.org/licenses/>.
21//#
22//# Correspondence concerning livedata may be directed to:
23//# Internet email: mcalabre@atnf.csiro.au
24//# Postal address: Dr. Mark Calabretta
25//# Australia Telescope National Facility, CSIRO
26//# PO Box 76
27//# Epping NSW 1710
28//# AUSTRALIA
29//#
30//# http://www.atnf.csiro.au/computing/software/livedata.html
31//# $Id: PKSreader.h,v 19.24 2009-09-29 07:33:39 cal103 Exp $
32//#---------------------------------------------------------------------------
33//# Original: 2000/08/02, Mark Calabretta, ATNF
34//#---------------------------------------------------------------------------
35
36#ifndef ATNF_PKSREADER_H
37#define ATNF_PKSREADER_H
38
39#include <atnf/PKSIO/PKSrecord.h>
40#include <atnf/PKSIO/SrcType.h>
41
42#include <casa/aips.h>
43#include <casa/Arrays/Matrix.h>
44#include <casa/Arrays/Vector.h>
45#include <casa/BasicSL/Complex.h>
46#include <casa/BasicSL/String.h>
47
48#include <casa/namespace.h>
49
50// <summary>
51// Class to read Parkes multibeam data.
52// </summary>
53
54// Return an appropriate PKSreader for a Parkes Multibeam dataset.
55class PKSreader* getPKSreader(
56 const String name,
57 const Int retry,
58 const Int interpolate,
59 String &format);
60
61// As above, but search a list of directories for it.
62class PKSreader* getPKSreader(
63 const String name,
64 const Vector<String> directories,
65 const Int retry,
66 const Int interpolate,
67 Int &iDir,
68 String &format);
69
70// Open an appropriate PKSreader for a Parkes Multibeam dataset.
71class PKSreader* getPKSreader(
72 const String name,
73 const String antenna,
74 const Int retry,
75 const Int interpolate,
76 String &format,
77 Vector<Bool> &beams,
78 Vector<Bool> &IFs,
79 Vector<uInt> &nChan,
80 Vector<uInt> &nPol,
81 Vector<Bool> &haveXPol,
82 Bool &haveBase,
83 Bool &haveSpectra);
84
85// As above, but search a list of directories for it.
86class PKSreader* getPKSreader(
87 const String name,
88 const String antenna,
89 const Vector<String> directories,
90 const Int retry,
91 const Int interpolate,
92 Int &iDir,
93 String &format,
94 Vector<Bool> &beams,
95 Vector<Bool> &IFs,
96 Vector<uInt> &nChan,
97 Vector<uInt> &nPol,
98 Vector<Bool> &haveXPol,
99 Bool &haveBase,
100 Bool &haveSpectra);
101
102
103class PKSreader
104{
105 public:
106 // Destructor.
107 virtual ~PKSreader() {};
108
109 // Open the dataset.
110 virtual Int open(
111 const String inName,
112 const String antenna,
113 Vector<Bool> &beams,
114 Vector<Bool> &IFs,
115 Vector<uInt> &nChan,
116 Vector<uInt> &nPol,
117 Vector<Bool> &haveXPol,
118 Bool &haveBase,
119 Bool &haveSpectra) = 0;
120
121 // Get parameters describing the data.
122 virtual Int getHeader(
123 String &observer,
124 String &project,
125 String &antName,
126 Vector<Double> &antPosition,
127 String &obsType,
128 String &bunit,
129 Float &equinox,
130 String &dopplerFrame,
131 Double &mjd,
132 Double &refFreq,
133 Double &bandwidth) = 0;
134
135 // Get frequency parameters for each IF.
136 virtual Int getFreqInfo(
137 Vector<Double> &startFreq,
138 Vector<Double> &endFreq) = 0;
139
140 // Set data selection criteria. Channel numbering is 1-relative, zero or
141 // negative channel numbers are taken to be offsets from the last channel.
142 // Coordinate system selection (only supported for SDFITS input):
143 // 0: equatorial (RA,Dec),
144 // 1: horizontal (Az,El),
145 // 2: feed-plane,
146 // 3: zenithal position angle of feed and elevation, (ZPA,El).
147 virtual uInt select(
148 const Vector<Bool> beamSel,
149 const Vector<Bool> IFsel,
150 const Vector<Int> startChan,
151 const Vector<Int> endChan,
152 const Vector<Int> refChan,
153 const Bool getSpectra = True,
154 const Bool getXPol = False,
155 const Bool getFeedPos = False,
156 const Bool getPointing = False,
157 const Int coordSys = 0) = 0;
158
159
160 // Find the range of the data selected in time and position.
161 virtual Int findRange(
162 Int &nRow,
163 Int &nSel,
164 Vector<Double> &timeSpan,
165 Matrix<Double> &positions) = 0;
166
167 // Read the next data record.
168/**
169 virtual Int read(
170 Int &scanNo,
171 Int &cycleNo,
172 Double &mjd,
173 Double &interval,
174 String &fieldName,
175 String &srcName,
176 Vector<Double> &srcDir,
177 Vector<Double> &srcPM,
178 Double &srcVel,
179 String &obsType,
180 Int &IFno,
181 Double &refFreq,
182 Double &bandwidth,
183 Double &freqInc,
184 Vector<Double> &restFreq,
185 Vector<Float> &tcal,
186 String &tcalTime,
187 Float &azimuth,
188 Float &elevation,
189 Float &parAngle,
190 Float &focusAxi,
191 Float &focusTan,
192 Float &focusRot,
193 Float &temperature,
194 Float &pressure,
195 Float &humidity,
196 Float &windSpeed,
197 Float &windAz,
198 Int &refBeam,
199 Int &beamNo,
200 Vector<Double> &direction,
201 Vector<Double> &scanRate,
202 Vector<Float> &tsys,
203 Vector<Float> &sigma,
204 Vector<Float> &calFctr,
205 Matrix<Float> &baseLin,
206 Matrix<Float> &baseSub,
207 Matrix<Float> &spectra,
208 Matrix<uChar> &flagged,
209 Complex &xCalFctr,
210 Vector<Complex> &xPol) = 0;
211**/
212/**
213 // Read the next data record, just the basics.
214 virtual Int read(
215 Int &IFno,
216 Vector<Float> &tsys,
217 Vector<Float> &calFctr,
218 Matrix<Float> &baseLin,
219 Matrix<Float> &baseSub,
220 Matrix<Float> &spectra,
221 Matrix<uChar> &flagged) = 0;
222**/
223 virtual Int read(PKSrecord &pksrec) = 0;
224
225 // Close the input file.
226 virtual void close() = 0;
227
228 protected:
229 Bool cGetFeedPos, cGetSpectra, cGetXPol, cGetPointing;
230 Int cCoordSys;
231
232 Vector<uInt> cNChan, cNPol;
233 Vector<Bool> cHaveXPol;
234};
235
236#endif
Note: See TracBrowser for help on using the repository browser.