source: branches/alma/external/atnf/PKSIO/PKSreader.h@ 1551

Last change on this file since 1551 was 1453, checked in by TakTsutsumi, 16 years ago

New Development: No

JIRA Issue: No

Ready to Release: Yes

Interface Changes: Yes

What Interface Changed: many

Test Programs: sd.scantable(), sd.scantable.save()

Put in Release Notes: N/A

Description: copied from current casapy code tree


File size: 6.1 KB
Line 
1//#---------------------------------------------------------------------------
2//# PKSreader.h: Class to read Parkes multibeam data.
3//#---------------------------------------------------------------------------
4//# Copyright (C) 2000-2006
5//# Associated Universities, Inc. Washington DC, USA.
6//#
7//# This library is free software; you can redistribute it and/or modify it
8//# under the terms of the GNU Library General Public License as published by
9//# the Free Software Foundation; either version 2 of the License, or (at your
10//# option) any later version.
11//#
12//# This library is distributed in the hope that it will be useful, but WITHOUT
13//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15//# License for more details.
16//#
17//# You should have received a copy of the GNU Library General Public License
18//# along with this library; if not, write to the Free Software Foundation,
19//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
20//#
21//# Correspondence concerning AIPS++ should be addressed as follows:
22//# Internet email: aips2-request@nrao.edu.
23//# Postal address: AIPS++ Project Office
24//# National Radio Astronomy Observatory
25//# 520 Edgemont Road
26//# Charlottesville, VA 22903-2475 USA
27//#
28//# $Id$
29//#---------------------------------------------------------------------------
30//# Original: 2000/08/02, Mark Calabretta, ATNF
31//#---------------------------------------------------------------------------
32
33#ifndef ATNF_PKSREADER_H
34#define ATNF_PKSREADER_H
35
36#include <casa/aips.h>
37#include <casa/Arrays/Matrix.h>
38#include <casa/Arrays/Vector.h>
39#include <casa/BasicSL/Complex.h>
40#include <casa/BasicSL/String.h>
41
42// <summary>
43// Class to read Parkes multibeam data.
44// </summary>
45
46#include <casa/namespace.h>
47
48// Open an appropriate PKSreader for a Parkes Multibeam dataset.
49class PKSreader* getPKSreader(
50 const String name,
51 const Int retry,
52 const Int interpolate,
53 String &format,
54 Vector<Bool> &beams,
55 Vector<Bool> &IFs,
56 Vector<uInt> &nChan,
57 Vector<uInt> &nPol,
58 Vector<Bool> &haveXPol,
59 Bool &haveBase,
60 Bool &haveSpectra);
61
62// As above, but search a list of directories for it.
63class PKSreader* getPKSreader(
64 const String name,
65 const Vector<String> directories,
66 const Int retry,
67 const Int interpolate,
68 Int &iDir,
69 String &format,
70 Vector<Bool> &beams,
71 Vector<Bool> &IFs,
72 Vector<uInt> &nChan,
73 Vector<uInt> &nPol,
74 Vector<Bool> &haveXPol,
75 Bool &haveBase,
76 Bool &haveSpectra);
77
78
79class PKSreader
80{
81 public:
82 // Destructor.
83 virtual ~PKSreader() {};
84
85 // Open the dataset.
86 virtual Int open(
87 const String inName,
88 Vector<Bool> &beams,
89 Vector<Bool> &IFs,
90 Vector<uInt> &nChan,
91 Vector<uInt> &nPol,
92 Vector<Bool> &haveXPol,
93 Bool &haveBase,
94 Bool &haveSpectra) = 0;
95
96 // Get parameters describing the data.
97 virtual Int getHeader(
98 String &observer,
99 String &project,
100 String &antName,
101 Vector<Double> &antPosition,
102 String &obsType,
103 Float &equinox,
104 String &dopplerFrame,
105 Double &mjd,
106 Double &refFreq,
107 Double &bandwidth,
108 String &fluxunit) = 0;
109
110 // Get frequency parameters for each IF.
111 virtual Int getFreqInfo(
112 Vector<Double> &startFreq,
113 Vector<Double> &endFreq) = 0;
114
115 // Set data selection criteria. Channel numbering is 1-relative, zero or
116 // negative channel numbers are taken to be offsets from the last channel.
117 virtual uInt select(
118 const Vector<Bool> beamSel,
119 const Vector<Bool> IFsel,
120 const Vector<Int> startChan,
121 const Vector<Int> endChan,
122 const Vector<Int> refChan,
123 const Bool getSpectra = True,
124 const Bool getXPol = False,
125 const Bool getFeedPos = False) = 0;
126
127 // Find the range of the data selected in time and position.
128 virtual Int findRange(
129 Int &nRow,
130 Int &nSel,
131 Vector<Double> &timeSpan,
132 Matrix<Double> &positions) = 0;
133
134 // Read the next data record.
135 virtual Int read(
136 Int &scanNo,
137 Int &cycleNo,
138 Double &mjd,
139 Double &interval,
140 String &fieldName,
141 String &srcName,
142 Vector<Double> &srcDir,
143 Vector<Double> &srcPM,
144 Double &srcVel,
145 String &obsType,
146 Int &IFno,
147 Double &refFreq,
148 Double &bandwidth,
149 Double &freqInc,
150 Vector<Double> &restFreq,
151 Vector<Float> &tcal,
152 String &tcalTime,
153 Float &azimuth,
154 Float &elevation,
155 Float &parAngle,
156 Float &focusAxi,
157 Float &focusTan,
158 Float &focusRot,
159 Float &temperature,
160 Float &pressure,
161 Float &humidity,
162 Float &windSpeed,
163 Float &windAz,
164 Int &refBeam,
165 Int &beamNo,
166 Vector<Double> &direction,
167 Vector<Double> &scanRate,
168 Vector<Float> &tsys,
169 Vector<Float> &sigma,
170 Vector<Float> &calFctr,
171 Matrix<Float> &baseLin,
172 Matrix<Float> &baseSub,
173 Matrix<Float> &spectra,
174 Matrix<uChar> &flagged,
175 Complex &xCalFctr,
176 Vector<Complex> &xPol) = 0;
177
178 // Read the next data record, just the basics.
179 virtual Int read(
180 Int &IFno,
181 Vector<Float> &tsys,
182 Vector<Float> &calFctr,
183 Matrix<Float> &baseLin,
184 Matrix<Float> &baseSub,
185 Matrix<Float> &spectra,
186 Matrix<uChar> &flagged) = 0;
187
188 // Close the input file.
189 virtual void close() = 0;
190
191 protected:
192 Bool cGetFeedPos, cGetSpectra, cGetXPol;
193
194 Vector<uInt> cNChan, cNPol;
195 Vector<Bool> cHaveXPol;
196};
197
198#endif
Note: See TracBrowser for help on using the repository browser.