source: trunk/external/atnf/PKSIO/PKSreader.h@ 1717

Last change on this file since 1717 was 1635, checked in by Malte Marquarding, 15 years ago

Update from livedata CVS

File size: 5.3 KB
Line 
1//#---------------------------------------------------------------------------
2//# PKSreader.h: Class to read Parkes multibeam data.
3//#---------------------------------------------------------------------------
4//# Copyright (C) 2000-2008
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: PKSreader.h,v 19.23 2008-11-27 04:28:24 cal103 Exp $
29//#---------------------------------------------------------------------------
30//# Original: 2000/08/02, Mark Calabretta, ATNF
31//#---------------------------------------------------------------------------
32
33#ifndef ATNF_PKSREADER_H
34#define ATNF_PKSREADER_H
35
36#include <atnf/PKSIO/PKSmsg.h>
37#include <atnf/PKSIO/PKSrecord.h>
38
39#include <casa/aips.h>
40#include <casa/Arrays/Matrix.h>
41#include <casa/Arrays/Vector.h>
42#include <casa/BasicSL/String.h>
43
44#include <casa/namespace.h>
45
46// <summary>
47// Class to read Parkes multibeam data.
48// </summary>
49
50// Return an appropriate PKSreader for a Parkes Multibeam dataset.
51class PKSreader* getPKSreader(
52 const String name,
53 const Int retry,
54 const Int interpolate,
55 String &format);
56
57// As above, but search a list of directories for it.
58class PKSreader* getPKSreader(
59 const String name,
60 const Vector<String> directories,
61 const Int retry,
62 const Int interpolate,
63 Int &iDir,
64 String &format);
65
66// Open an appropriate PKSreader for a Parkes Multibeam dataset.
67class PKSreader* getPKSreader(
68 const String name,
69 const Int retry,
70 const Int interpolate,
71 String &format,
72 Vector<Bool> &beams,
73 Vector<Bool> &IFs,
74 Vector<uInt> &nChan,
75 Vector<uInt> &nPol,
76 Vector<Bool> &haveXPol,
77 Bool &haveBase,
78 Bool &haveSpectra);
79
80// As above, but search a list of directories for it.
81class PKSreader* getPKSreader(
82 const String name,
83 const Vector<String> directories,
84 const Int retry,
85 const Int interpolate,
86 Int &iDir,
87 String &format,
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);
95
96class PKSreader : public PKSmsg
97{
98 public:
99 // Destructor.
100 virtual ~PKSreader() {};
101
102 // Open the dataset.
103 virtual Int open(
104 const String inName,
105 Vector<Bool> &beams,
106 Vector<Bool> &IFs,
107 Vector<uInt> &nChan,
108 Vector<uInt> &nPol,
109 Vector<Bool> &haveXPol,
110 Bool &haveBase,
111 Bool &haveSpectra) = 0;
112
113 // Get parameters describing the data.
114 virtual Int getHeader(
115 String &observer,
116 String &project,
117 String &antName,
118 Vector<Double> &antPosition,
119 String &obsType,
120 String &bunit,
121 Float &equinox,
122 String &dopplerFrame,
123 Double &mjd,
124 Double &refFreq,
125 Double &bandwidth) = 0;
126
127 // Get frequency parameters for each IF.
128 virtual Int getFreqInfo(
129 Vector<Double> &startFreq,
130 Vector<Double> &endFreq) = 0;
131
132 // Set data selection criteria. Channel numbering is 1-relative, zero or
133 // negative channel numbers are taken to be offsets from the last channel.
134 // Coordinate system selection (only supported for SDFITS input):
135 // 0: equatorial (RA,Dec),
136 // 1: horizontal (Az,El),
137 // 2: feed-plane,
138 // 3: zenithal position angle of feed and elevation, (ZPA,El).
139 virtual uInt select(
140 const Vector<Bool> beamSel,
141 const Vector<Bool> IFsel,
142 const Vector<Int> startChan,
143 const Vector<Int> endChan,
144 const Vector<Int> refChan,
145 const Bool getSpectra = True,
146 const Bool getXPol = False,
147 const Int coordSys = 0) = 0;
148
149 // Find the range of the data selected in time and position.
150 virtual Int findRange(
151 Int &nRow,
152 Int &nSel,
153 Vector<Double> &timeSpan,
154 Matrix<Double> &positions) = 0;
155
156 // Read the next data record.
157 virtual Int read(PKSrecord &pksrec) = 0;
158
159 // Close the input file.
160 virtual void close() = 0;
161
162 protected:
163 Bool cGetSpectra, cGetXPol;
164 Int cCoordSys;
165
166 Vector<uInt> cNChan, cNPol;
167 Vector<Bool> cHaveXPol;
168};
169
170#endif
Note: See TracBrowser for help on using the repository browser.