source: trunk/external/atnf/PKSIO/MBrecord.h@ 1517

Last change on this file since 1517 was 1452, checked in by Malte Marquarding, 16 years ago

update from livedata CVS

File size: 7.2 KB
Line 
1//#---------------------------------------------------------------------------
2//# MBrecord.h: Class to store an MBFITS single-dish data record.
3//#---------------------------------------------------------------------------
4//# Copyright (C) 2000-2008
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: MBrecord.h,v 19.14 2008-11-17 06:36:12 cal103 Exp $
30//#---------------------------------------------------------------------------
31//# The MBrecord class stores an MBFITS single-dish data record.
32//#
33//# Storage for spectral data may be managed in either of two ways:
34//#
35//# 1) The allocate() member function may be used to allocate storage that
36//# is subsequently managed by the MBrecord class; the assignment
37//# operator automatically deletes and reallocates more if insufficient
38//# was provided, and the MBrecord destructor deletes it.
39//#
40//# Allocation of storage for cross-polarization data is optional.
41//#
42//# 2) In some cases it may be desirable for the user to provide storage via
43//# the 'spectra', and 'flagged' (and 'xpol') variables in order to avoid
44//# in-core copying. It is assumed that space has been provided for at
45//# least nChan*nPol floats for 'spectra', nChan*nPol unsigned chars for
46//# 'flagged', and 2*nChan floats for 'xpol'. This storage will not be
47//# reassigned by the assignment operator nor deleted by the destructor.
48//#
49//# The two methods may not be mixed; allocate() checks that either
50//#
51//# a) the 'spectra', 'flagged', and 'xpol' variables are null pointers,
52//#
53//# b) storage was previously allocated via allocate().
54//#
55//# Original: 2000/08/01 Mark Calabretta, ATNF
56//#---------------------------------------------------------------------------
57
58#ifndef ATNF_MBRECORD_H
59#define ATNF_MBRECORD_H
60
61using namespace std;
62
63// <summary>
64// Class to store an MBFITS single-dish data record.
65// </summary>
66
67class MBrecord
68{
69 public:
70 // Default constructor allocates arrays for the required number of IFs.
71 MBrecord(int nIF = 0);
72
73 // Destructor; deletes any storage that may have been auto-allocated by
74 // the assignment operator.
75 ~MBrecord();
76
77 // Expand arrays if necessary to accomodate the required number of IFs.
78 void setNIFs(int nIF);
79
80 // Ensure there is enough storage for the specified number of spectral
81 // products (channels x polarizations) for IF with array index iif (i.e.
82 // the actual IF number is IFno[iif]). Expands arrays if necessary but
83 // never contracts.
84 void allocate(int iIF, int nprod, int nxpol);
85
86 // Free all allocate()'d storage.
87 void free();
88
89 // The assignment operator does a deep copy and will auto-allocate or
90 // re-allocate data storage if necessary.
91 MBrecord &operator=(const MBrecord &other);
92
93 // Extract a selected IF from a MBrecord into another.
94 int extract(const MBrecord &other, int iIF);
95
96 int scanNo; // Scan number.
97 int cycleNo; // Integration cycle number.
98 char datobs[12]; // Date of observation YYYY-MM-DD.
99 double utc; // UTC of the integration, s.
100 float exposure; // Integration time, s.
101 char srcName[20]; // Source name.
102 double srcRA; // Source J2000 right ascension, radian.
103 double srcDec; // Source J2000 declination, radian.
104 double restFreq; // Line rest frequency, Hz.
105 char obsType[16]; // Two-letter observation type codes.
106
107 // Beam-dependent parameters.
108 short beamNo; // Multibeam beam number.
109 double ra; // J2000 right ascension, radian.
110 double dec; // J2000 declination, radian,
111 int pCode; // Pointing problem code:
112 // 1: position and timestamp unchanged,
113 // 2: position changed but not timestamp,
114 // 3: position and timestamp are rubbish,
115 // 4: timestamp/1000 scale error (repaired),
116 // 5: timestamp late by 1.0 sec (repaired),
117 // 6: timestamp late by 0.5 sec (repaired).
118 float rateAge; // Scan rate age (staleness), s.
119 float raRate; // Scan rate in right ascension, radian/s.
120 float decRate; // Scan rate in declination, radian/s.
121 float paRate; // Rate of change of position angle, radian/s.
122
123 // IF-dependent parameters.
124 short nIF; // Number of IFs.
125 short *IFno; // IF number.
126 int *nChan; // Number of channels.
127 int *nPol; // Number of polarizations.
128 float *fqRefPix; // Frequency reference pixel.
129 double *fqRefVal; // Frequency reference value, Hz.
130 double *fqDelt; // Frequency separation between channels, Hz.
131 float (*tsys)[2]; // Tsys for each polarization, Jy.
132 float (*calfctr)[2]; // Calibration factor for each polarization.
133 float (*xcalfctr)[2]; // Calibration factor for cross-polarizations.
134 int haveBase; // Are baseline parameters present?
135 float (*baseLin)[2][2]; // Linear baseline fit for each polarization.
136 float (*baseSub)[2][9]; // Polynomial baseline subtracted.
137 int haveSpectra; // Is spectral data present?
138 float* *spectra; // Spectra for each polarization, Jy.
139 unsigned char* *flagged; // Channel flagging, 0 = good, else bad.
140 float* *xpol; // Cross polarization spectra (if any).
141
142 // Only present for Parkes Multibeam or LBA data after 1997/02/02.
143 float (*tcal)[2]; // Tcal for each polarization.
144
145 // Extra syscal data available for Parkes Multibeam observations only.
146 int extraSysCal; // Is this extra SysCal data available?
147
148 float azimuth; // Azimuth, radian.
149 float elevation; // Elevation, radian.
150 float parAngle; // Parallactic angle, radian.
151
152 float focusAxi; // Axial focus position, m.
153 float focusTan; // Focus platform translation, m.
154 float focusRot; // Focus rotation, radian.
155
156 float temp; // Temperature, C.
157 float pressure; // Pressure, Pa.
158 float humidity; // Relative humidity, %.
159 float windSpeed; // Wind speed, m/s.
160 float windAz; // Wind azimuth, radian.
161
162 char tcalTime[20]; // Time of measurement of cal signals.
163
164 short refBeam; // Reference beam, in beam-switching (MX)
165 // mode (added 1999/03/17).
166
167 private:
168 int cNIF; // Number of IFs allocated.
169 int* cNProd; // Storage allocated for data.
170 int* cNXPol; // Storage allocated for xpol.
171};
172
173#endif
Note: See TracBrowser for help on using the repository browser.