1 | //#---------------------------------------------------------------------------
|
---|
2 | //# MBFITSreader.h: ATNF single-dish RPFITS reader.
|
---|
3 | //#---------------------------------------------------------------------------
|
---|
4 | //# Copyright (C) 2000-2006
|
---|
5 | //# Mark Calabretta, ATNF
|
---|
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 this software should be addressed as follows:
|
---|
22 | //# Internet email: mcalabre@atnf.csiro.au.
|
---|
23 | //# Postal address: Dr. Mark Calabretta,
|
---|
24 | //# Australia Telescope National Facility,
|
---|
25 | //# P.O. Box 76,
|
---|
26 | //# Epping, NSW, 2121,
|
---|
27 | //# AUSTRALIA
|
---|
28 | //#
|
---|
29 | //# $Id$
|
---|
30 | //#---------------------------------------------------------------------------
|
---|
31 | //# The MBFITSreader class reads single dish RPFITS files (such as Parkes
|
---|
32 | //# Multibeam MBFITS files).
|
---|
33 | //#
|
---|
34 | //# Original: 2000/07/28 Mark Calabretta
|
---|
35 | //#---------------------------------------------------------------------------
|
---|
36 |
|
---|
37 | #ifndef ATNF_MBFITSREADER_H
|
---|
38 | #define ATNF_MBFITSREADER_H
|
---|
39 |
|
---|
40 | #include <atnf/PKSIO/FITSreader.h>
|
---|
41 | #include <atnf/PKSIO/PKSMBrecord.h>
|
---|
42 |
|
---|
43 | // <summary>
|
---|
44 | // ATNF single-dish RPFITS reader.
|
---|
45 | // </summary>
|
---|
46 |
|
---|
47 | class MBFITSreader : public FITSreader
|
---|
48 | {
|
---|
49 | public:
|
---|
50 | // Default constructor; position interpolation codes are:
|
---|
51 | // 0: no interpolation,
|
---|
52 | // 1: correct interpolation,
|
---|
53 | // 2: pksmbfits interpolation.
|
---|
54 | MBFITSreader(const int retry = 0, const int interpolate = 1);
|
---|
55 |
|
---|
56 | // Destructor.
|
---|
57 | virtual ~MBFITSreader();
|
---|
58 |
|
---|
59 | // Open the RPFITS file for reading.
|
---|
60 | virtual int open(
|
---|
61 | char *rpname,
|
---|
62 | int &nBeam,
|
---|
63 | int* &beams,
|
---|
64 | int &nIF,
|
---|
65 | int* &IFs,
|
---|
66 | int* &nChan,
|
---|
67 | int* &nPol,
|
---|
68 | int* &haveXPol,
|
---|
69 | int &haveBase,
|
---|
70 | int &haveSpectra,
|
---|
71 | int &extraSysCal);
|
---|
72 |
|
---|
73 | // Get parameters describing the data.
|
---|
74 | virtual int getHeader(
|
---|
75 | char observer[32],
|
---|
76 | char project[32],
|
---|
77 | char telescope[32],
|
---|
78 | double antPos[3],
|
---|
79 | char obsType[32],
|
---|
80 | float &equinox,
|
---|
81 | char radecsys[32],
|
---|
82 | char dopplerFrame[32],
|
---|
83 | char datobs[32],
|
---|
84 | double &utc,
|
---|
85 | double &refFreq,
|
---|
86 | double &bandwidth);
|
---|
87 |
|
---|
88 | // Get frequency parameters for each IF.
|
---|
89 | virtual int getFreqInfo(
|
---|
90 | int &nIF,
|
---|
91 | double* &startFreq,
|
---|
92 | double* &endFreq);
|
---|
93 |
|
---|
94 | // Find the range of the data selected in time and position.
|
---|
95 | virtual int findRange(
|
---|
96 | int &nRow,
|
---|
97 | int &nSel,
|
---|
98 | char dateSpan[2][32],
|
---|
99 | double utcSpan[2],
|
---|
100 | double* &positions);
|
---|
101 |
|
---|
102 | // Read the next data record.
|
---|
103 | virtual int read(PKSMBrecord &record);
|
---|
104 |
|
---|
105 | // Close the RPFITS file.
|
---|
106 | virtual void close(void);
|
---|
107 |
|
---|
108 | private:
|
---|
109 | char cDateObs[10];
|
---|
110 | int *cBeamSel, *cChanOff, cFirst, *cIFSel, cInterp, cIntTime, cMBopen,
|
---|
111 | cMopra, cNBeamSel, cNBin, cRetry, *cStaleness, cTid, *cXpolOff;
|
---|
112 | float *cVis;
|
---|
113 |
|
---|
114 | // The data has to be bufferred to allow positions to be interpolated.
|
---|
115 | int cEOF, cEOS, cFlushBin, cFlushIF, cFlushing;
|
---|
116 | double *cPosUTC;
|
---|
117 | PKSMBrecord *cBuffer;
|
---|
118 |
|
---|
119 | int cCycleNo, cScanNo;
|
---|
120 | double cUTC;
|
---|
121 |
|
---|
122 | // Read the next data record from the RPFITS file.
|
---|
123 | int rpget(int syscalonly, int &EOS);
|
---|
124 | // These are no longer define in the RPFITS.h file so moved here
|
---|
125 | int jstat;
|
---|
126 | float *weight;
|
---|
127 | int baseline;
|
---|
128 | int flag;
|
---|
129 | int bin;
|
---|
130 | int if_no;
|
---|
131 | int sourceno;
|
---|
132 | float *vis;
|
---|
133 | float u;
|
---|
134 | float v;
|
---|
135 | float w;
|
---|
136 | float ut;
|
---|
137 |
|
---|
138 | };
|
---|
139 |
|
---|
140 | #endif
|
---|