1 | //#---------------------------------------------------------------------------
|
---|
2 | //# PKSFITSreader.h: Class to read Parkes Multibeam data from a FITS file.
|
---|
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: PKSFITSreader.h,v 19.18 2009-09-29 07:33:38 cal103 Exp $
|
---|
32 | //#---------------------------------------------------------------------------
|
---|
33 | //# This class is basically a wrapper class for reading data from either an
|
---|
34 | //# MBFITS (single dish variant of RPFITS) or SDFITS file using the relevant
|
---|
35 | //# lower-level classes. It translates AIPS++isms to/from basic C++.
|
---|
36 | //#
|
---|
37 | //# Original: 2000/08/02, Mark Calabretta, ATNF
|
---|
38 | //#---------------------------------------------------------------------------
|
---|
39 |
|
---|
40 | #ifndef ATNF_PKSFITSREADER_H
|
---|
41 | #define ATNF_PKSFITSREADER_H
|
---|
42 |
|
---|
43 | #include <atnf/PKSIO/FITSreader.h>
|
---|
44 | #include <atnf/PKSIO/PKSrecord.h>
|
---|
45 | #include <atnf/PKSIO/PKSreader.h>
|
---|
46 |
|
---|
47 | #include <casa/aips.h>
|
---|
48 | #include <casa/stdio.h>
|
---|
49 | #include <casa/Arrays/Vector.h>
|
---|
50 | #include <casa/Arrays/Matrix.h>
|
---|
51 | #include <casa/BasicSL/Complex.h>
|
---|
52 | #include <casa/BasicSL/String.h>
|
---|
53 |
|
---|
54 | #include <casa/namespace.h>
|
---|
55 |
|
---|
56 | // <summary>
|
---|
57 | // Class to read Parkes Multibeam data from a FITS file.
|
---|
58 | // </summary>
|
---|
59 |
|
---|
60 | class PKSFITSreader : public PKSreader
|
---|
61 | {
|
---|
62 | public:
|
---|
63 | // Default constructor.
|
---|
64 | PKSFITSreader(
|
---|
65 | const String fitsType,
|
---|
66 | const Int retry = 0,
|
---|
67 | const Bool interpolate = True);
|
---|
68 |
|
---|
69 | // Destructor.
|
---|
70 | virtual ~PKSFITSreader();
|
---|
71 |
|
---|
72 | // Open the FITS file for reading.
|
---|
73 | virtual Int open(
|
---|
74 | const String fitsName,
|
---|
75 | const String antenna,
|
---|
76 | Vector<Bool> &beams,
|
---|
77 | Vector<Bool> &IFs,
|
---|
78 | Vector<uInt> &nChan,
|
---|
79 | Vector<uInt> &nPol,
|
---|
80 | Vector<Bool> &haveXPol,
|
---|
81 | Bool &haveBase,
|
---|
82 | Bool &haveSpectra);
|
---|
83 |
|
---|
84 | // Get parameters describing the data.
|
---|
85 | virtual Int getHeader(
|
---|
86 | String &observer,
|
---|
87 | String &project,
|
---|
88 | String &antName,
|
---|
89 | Vector<Double> &antPosition,
|
---|
90 | String &obsType,
|
---|
91 | String &bunit,
|
---|
92 | Float &equinox,
|
---|
93 | String &dopplerFrame,
|
---|
94 | Double &mjd,
|
---|
95 | Double &refFreq,
|
---|
96 | Double &bandwidth);
|
---|
97 |
|
---|
98 | // Get frequency parameters for each IF.
|
---|
99 | virtual Int getFreqInfo(
|
---|
100 | Vector<Double> &startFreq,
|
---|
101 | Vector<Double> &endFreq);
|
---|
102 |
|
---|
103 | // Set data selection criteria. Channel numbering is 1-relative, zero or
|
---|
104 | // negative channel numbers are taken to be offsets from the last channel.
|
---|
105 | virtual uInt select(
|
---|
106 | const Vector<Bool> beamSel,
|
---|
107 | const Vector<Bool> IFsel,
|
---|
108 | const Vector<Int> startChan,
|
---|
109 | const Vector<Int> endChan,
|
---|
110 | const Vector<Int> refChan,
|
---|
111 | const Bool getSpectra = True,
|
---|
112 | const Bool getXPol = False,
|
---|
113 | const Bool getFeedPos = False,
|
---|
114 | const Bool getPointing = False,
|
---|
115 | const Int coordSys = 0);
|
---|
116 |
|
---|
117 | // Find the range of the data selected in time and position.
|
---|
118 | virtual Int findRange(
|
---|
119 | Int &nRow,
|
---|
120 | Int &nSel,
|
---|
121 | Vector<Double> &timeSpan,
|
---|
122 | Matrix<Double> &positions);
|
---|
123 |
|
---|
124 | // Read the next data record.
|
---|
125 | virtual Int read(PKSrecord &pksrec);
|
---|
126 |
|
---|
127 | // Close the FITS file.
|
---|
128 | virtual void close();
|
---|
129 |
|
---|
130 | private:
|
---|
131 | Int *cBeams, *cIFs;
|
---|
132 | uInt cNBeam, cNIF;
|
---|
133 | MBrecord cMBrec;
|
---|
134 | FITSreader *cReader;
|
---|
135 |
|
---|
136 | Char* trim(char *string);
|
---|
137 | };
|
---|
138 |
|
---|
139 | #endif
|
---|