source: trunk/external/atnf/PKSIO/PKSFITSreader.h@ 1406

Last change on this file since 1406 was 1399, checked in by Malte Marquarding, 17 years ago

Mark C added brightness unit to getHeader()

File size: 5.9 KB
RevLine 
[1325]1//#---------------------------------------------------------------------------
2//# PKSFITSreader.h: Class to read Parkes Multibeam data from a FITS file.
3//#---------------------------------------------------------------------------
[1399]4//# Copyright (C) 2000-2007
[1325]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//#
[1399]28//# $Id: PKSFITSreader.h,v 19.12 2007/11/12 03:37:56 cal103 Exp $
[1325]29//#---------------------------------------------------------------------------
30//# This class is basically a wrapper class for reading data from either an
31//# MBFITS (single dish variant of RPFITS) or SDFITS file using the relevant
32//# lower-level classes. It translates AIPS++isms to/from basic C++.
33//#
34//# Original: 2000/08/02, Mark Calabretta, ATNF
35//#---------------------------------------------------------------------------
36
37#ifndef ATNF_PKSFITSREADER_H
38#define ATNF_PKSFITSREADER_H
39
40#include <atnf/PKSIO/FITSreader.h>
41#include <atnf/PKSIO/PKSreader.h>
42
43#include <casa/aips.h>
44#include <casa/Arrays/Vector.h>
45#include <casa/Arrays/Matrix.h>
46#include <casa/BasicSL/Complex.h>
47#include <casa/BasicSL/String.h>
48
49// <summary>
50// Class to read Parkes Multibeam data from a FITS file.
51// </summary>
52
53#include <casa/namespace.h>
54class PKSFITSreader : public PKSreader
55{
56 public:
57 // Default constructor.
58 PKSFITSreader(
59 const String fitsType,
60 const Int retry = 0,
61 const Bool interpolate = True);
62
63 // Destructor.
64 virtual ~PKSFITSreader();
65
66 // Open the FITS file for reading.
67 virtual Int open(
68 const String fitsName,
69 Vector<Bool> &beams,
70 Vector<Bool> &IFs,
71 Vector<uInt> &nChan,
72 Vector<uInt> &nPol,
73 Vector<Bool> &haveXPol,
74 Bool &haveBase,
75 Bool &haveSpectra);
76
77 // Get parameters describing the data.
78 virtual Int getHeader(
79 String &observer,
80 String &project,
81 String &antName,
82 Vector<Double> &antPosition,
83 String &obsType,
[1399]84 String &bunit,
[1325]85 Float &equinox,
86 String &dopplerFrame,
87 Double &mjd,
88 Double &refFreq,
89 Double &bandwidth);
90
91 // Get frequency parameters for each IF.
92 virtual Int getFreqInfo(
93 Vector<Double> &startFreq,
94 Vector<Double> &endFreq);
95
96 // Set data selection criteria. Channel numbering is 1-relative, zero or
97 // negative channel numbers are taken to be offsets from the last channel.
98 virtual uInt select(
99 const Vector<Bool> beamSel,
100 const Vector<Bool> IFsel,
101 const Vector<Int> startChan,
102 const Vector<Int> endChan,
103 const Vector<Int> refChan,
104 const Bool getSpectra = True,
105 const Bool getXPol = False,
106 const Bool getFeedPos = False);
107
108 // Find the range of the data selected in time and position.
109 virtual Int findRange(
110 Int &nRow,
111 Int &nSel,
112 Vector<Double> &timeSpan,
113 Matrix<Double> &positions);
114
115 // Read the next data record.
116 virtual Int read(
117 Int &scanNo,
118 Int &cycleNo,
119 Double &mjd,
120 Double &interval,
121 String &fieldName,
122 String &srcName,
123 Vector<Double> &srcDir,
124 Vector<Double> &srcPM,
125 Double &srcVel,
126 String &obsType,
127 Int &IFno,
128 Double &refFreq,
129 Double &bandwidth,
130 Double &freqInc,
131 Double &restFreq,
132 Vector<Float> &tcal,
133 String &tcalTime,
134 Float &azimuth,
135 Float &elevation,
136 Float &parAngle,
137 Float &focusAxi,
138 Float &focusTan,
139 Float &focusRot,
140 Float &temperature,
141 Float &pressure,
142 Float &humidity,
143 Float &windSpeed,
144 Float &windAz,
145 Int &refBeam,
146 Int &beamNo,
147 Vector<Double> &direction,
148 Vector<Double> &scanRate,
149 Vector<Float> &tsys,
150 Vector<Float> &sigma,
151 Vector<Float> &calFctr,
152 Matrix<Float> &baseLin,
153 Matrix<Float> &baseSub,
154 Matrix<Float> &spectra,
155 Matrix<uChar> &flagged,
156 Complex &xCalFctr,
157 Vector<Complex> &xPol);
158
159 // Read the next data record, just the basics.
160 virtual Int read(
161 Int &IFno,
162 Vector<Float> &tsys,
163 Vector<Float> &calFctr,
164 Matrix<Float> &baseLin,
165 Matrix<Float> &baseSub,
166 Matrix<Float> &spectra,
167 Matrix<uChar> &flagged);
168
169 // Close the FITS file.
170 virtual void close();
171
172 private:
173 Int *cBeams, *cIFs;
174 uInt cNBeam, cNIF;
175 PKSMBrecord cMBrec;
176 FITSreader *cReader;
177
178 Char* trim(char *string);
179};
180
181#endif
Note: See TracBrowser for help on using the repository browser.