casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VLASDA.h
Go to the documentation of this file.
1 //# VLASDA:
2 //# Copyright (C) 1999,2000,2003
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //#
27 //# $Id$
28 
29 #ifndef NRAO_VLASDA_H
30 #define NRAO_VLASDA_H
31 
32 #include <casa/aips.h>
33 #include <nrao/VLA/VLAEnum.h>
34 #include <casa/IO/ByteSource.h>
39 
40 #include <casa/namespace.h>
41 namespace casacore{
42 
43 template <class T> class Vector;
44 template <class T> class Matrix;
45 class String;
46 }
47 
48 namespace casa { //# NAMESPACE CASA - BEGIN
49 } //# NAMESPACE CASA - END
50 
51 
52 // <summary>
53 // Interprets the data in an sub-array data area of a VLA logical record.
54 // </summary>
55 
56 // <use visibility=export>
57 
58 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
59 // </reviewed>
60 
61 // <prerequisite>
62 // <li> The VLA archive format as described in VLA computer memo 188
63 // </prerequisite>
64 //
65 // <etymology> The sub-array data is, in memo 188, frequently shortened to the
66 // acronym SDA. As this is specific to the VLA the name VLAADA seemed
67 // appropriate.
68 // </etymology>
69 //
70 // <synopsis>
71 // This class contains functions which access and interpret the data in the
72 // sub-array data area of a VLA logical record.
73 //
74 // The functions in this class access the specified data in the sub-array data
75 // area and may convert the units and data types to something more suitable for
76 // general use. They also interpret the data and provide some derived
77 // quantities eg., the nPol function.
78 // </synopsis>
79 //
80 // <example>
81 
82 // This code fragment shows how to initialise a VLASDA object and then use
83 // this object to determine how much data is in this record. It is assumed that
84 // the Bytesource object contains a VLA Logical record.
85 // <srcblock>
86 // casacore::ByteSource VLARecord(...);
87 // VLARCA rca;
88 // VLASDA sda(VLARecord, rca.SDAOffset());
89 // cout << "The record has " << rca.nAntennas() << " antennas." << endl;
90 // for (casacore::uInt c = 0; c < 4; c++) {
91 // cout << "CDA " << c;
92 // if (rca.CDAOffset() == 0) {
93 // cout << " is not used." << endl;
94 // else {
95 // cout << " has " << sda.nChannels(c) << " spectral channels and"
96 // << sda.npol(c) << " polarisations." << endl;
97 // }
98 // }
99 // </srcblock>
100 // </example>
101 //
102 // <motivation>
103 // This class was needed as part of the VLA filler application.
104 // </motivation>
105 //
106 // <thrown>
107 // This class will throw an exception (AipSError) if you the correlator data
108 // area argument is four or more. When compiled in debug mode this class does a
109 // lot of consistancy checking. If it detects anomolies it will throw an
110 // exception (casacore::AipsError).
111 // </thrown>
112 //
113 // <todo asof="1999/08/13">
114 // <li> The member functions should probably be rounded out.
115 // </todo>
116 
117 class VLASDA
118 {
119 public:
120  // The default constructor creates a unusable object. You need to use the
121  // assignment operator or the attach function to create a usable object.
122  VLASDA();
123 
124  // Construct this object to read data from the SDA of the given VLA logical
125  // record. The SDA must begin at the specified number of bytes from the
126  // beginning of the record (see the example above).
127  VLASDA(casacore::ByteSource& record, casacore::uInt offset);
128 
129  // The destructor is trivial;
130  ~VLASDA();
131 
132  // The copy constructor uses reference semantics.
133  VLASDA(const VLASDA& other);
134 
135  // The assignment constructor uses reference semantics.
136  VLASDA& operator=(const VLASDA& other);
137 
138  // Re-initialise this object so that it now reads data from the given VLA
139  // logical record. The sub-array data area that will be used begins at the
140  // specified number of bytes from the beginning of the record.
141  void attach(casacore::ByteSource& record, casacore::uInt offset);
142 
143  // returns the number of data channels in the specified CDA (including
144  // the average channel)
146 
147  // returns the number of spectral channels in the specified CDA (excludes
148  // channel zero)
150 
151  // returns the observed frequency (in Hz), at the band centre for the
152  // specified CDA. This is the observed frequency after Doppler tracking has
153  // been applied. It will correspond to the middle of the centre channel if
154  // there are an odd number of channels and takes into account that some
155  // channels may have been correlated but discarded prior to archiving.
157 
158  // returns the observed frequency at the lower edge of the band, after
159  // correcting for channels that have been correlated and discarded prior to
160  // archiving the data. ie it returns the observed frequency of the lower edge
161  // of the first channel in the data.
163 
164  // returns true if Doppler tracking has been turned on for the specified
165  // CDA. If so then the observed frequency is calculated from the source
166  // radial velocity, the line rest frequency and the component of the earths
167  // velocity relative to the source (in the specified reference Frame).
169 
170  // returns the assumed rest frequency of the source radiation in Hz (for the
171  // specified CDA). This number is supplied by the observer and used in the
172  // doppler tracking calculations. The returned value is not meaningful if
173  // doppler tracking is not used.
175 
176  // returns the assumed radial velocity of the source in m/sec (for the
177  // specified CDA). This number is supplied by the observer and used in the
178  // doppler tracking calculations. The returned value is not meaningful if
179  // doppler tracking is not used.
181 
182  // Return the assumed rest frame that will be used when calculating the
183  // observers motion relative to the source (for the specified CDA). This
184  // frame is supplied by the observer and used in the Doppler tracking
185  // calculations. The returned value is not meaningful of Doppler tracking is
186  // not used.
188 
189  // Return the definition of Doppler shift used to convert the radial
190  // velocity to a frequency (for the specified CDA). This is supplied by the
191  // observer and used in the Doppler tracking calculations. The returned value
192  // is not meaningful of Doppler tracking is not used.
194 
195  // returns the bandwidth of an individual channel, in Hz, of the data in the
196  // specified CDA.
198 
199  // returns the total bandwidth, in Hz, over all the channels of the data in
200  // the specified CDA. Throws an exception if which > 3.
202 
203  // returns the total bandwidth, in Hz, of the front end filter in the
204  // specified CDA. Throws an exception if which > 3.
206 
207  // Return the correlator mode for this record. Only useful if you know what
208  // these codes are. The functions immediatly following this one are probably
209  // more useful as they interpret this code for you.
211 
212  // Return the 'electronic path' that the data in the specified CDA has
213  // travveled through. Returns 0 if the data in the specified CDA is from IF's
214  // A or C and 1 if the data is from IF's B or D. The returned value is
215  // meaningless if the CDA is not used in the current record. This information
216  // is obtained from knowing what the correlator modes represent.
218 
219  // Return the number of polarisations in the specified CDA. This information
220  // is obtained from knowing what the correlator modes represent.
221  casacore::uInt npol(VLAEnum::CDA cda) const;
222 
223  // return a casacore::Matrix indicating which if's contributed to which correlations
224  // within the specified CDA. The return casacore::Matrix always has two columns and the
225  // same number of rows as there are correlations. Each row indicates which IF
226  // from antennas one & two respectrively contributed to thw correlation. This
227  // function encodes the information in Appendix F1 of memo 188.
229 
230  // Return the subarray ID. This is a number between 1 and 4 indicating which
231  // subarray this data corresponds to.
232  casacore::uInt subArray() const;
233 
234  // Return the casacore::Array configuration as a string. The string will contain at
235  // between one and two characters and be somethings like "A", "D", "AD", etc
237 
238  // Return the source RA and Dec at the standard epoch of this integration
239  // (given by the epoch function). The returned casacore::Vector will always have two
240  // elements being the RA and Dec in radians.
242 
243  // Return the source name as typed in by the observer.
245 
246  // Return the source qualifier as typed in by the observer. This is really
247  // the scan number.
248  casacore::Int sourceQual() const;
249 
250  // Return the integration time in seconds.
251  casacore::Double intTime() const;
252 
253  // Return the observation time in seconds of the centre of this
254  // integration. Zero seconds means midnight on the day specified win the
255  // RCA.
256  casacore::Double obsTime() const;
257 
258  // Return the observation program id.
259  casacore::String obsId() const;
260 
261  // Return the observing mode
262  casacore::String obsMode() const;
263 
264  // Return the observing mode in full glory
266 
267  // Return the calibration code.
268  casacore::String calCode() const;
269 
270  // return the reference frame for the field directions.
271  // returns MDiretion::N_types when epoch is not valid
272  // usually that means epoch = 0 and B1950_VLA should be used.
274 
275  // returns whether the data spectrum has been Hanning smoothed (and every
276  // second channel discarded). Always returns false for continuum data.
277  casacore::Bool smoothed() const;
278 
279 private:
280  //# Contains a logical record
282  // the offset to the start of this SDA in the record. An offset of zero means
283  // this SDA is not used in this record.
285 };
286 #endif
287 
288 
casacore::Bool smoothed() const
returns whether the data spectrum has been Hanning smoothed (and every second channel discarded)...
A 1-D Specialization of the Array class.
int Int
Definition: aipstype.h:50
void attach(casacore::ByteSource &record, casacore::uInt offset)
Re-initialise this object so that it now reads data from the given VLA logical record.
Class for read-only access to data in a given format.
Definition: ByteSource.h:91
casacore::uInt itsOffset
the offset to the start of this SDA in the record.
Definition: VLASDA.h:284
casacore::Vector< casacore::Double > sourceDir() const
Return the source RA and Dec at the standard epoch of this integration (given by the epoch function)...
~VLASDA()
The destructor is trivial;.
casacore::Matrix< VLAEnum::IF > ifUsage(VLAEnum::CDA cda) const
return a casacore::Matrix indicating which if&#39;s contributed to which correlations within the specifie...
casacore::String arrayConfig() const
Return the casacore::Array configuration as a string.
VLASDA()
The default constructor creates a unusable object.
casacore::Double obsFrequency(VLAEnum::CDA cda) const
returns the observed frequency (in Hz), at the band centre for the specified CDA. ...
A 2-D Specialization of the Array class.
casacore::Double intTime() const
Return the integration time in seconds.
casacore::Double radialVelocity(VLAEnum::CDA cda) const
returns the assumed radial velocity of the source in m/sec (for the specified CDA).
casacore::Double restFrequency(VLAEnum::CDA cda) const
returns the assumed rest frequency of the source radiation in Hz (for the specified CDA)...
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
casacore::Int sourceQual() const
Return the source qualifier as typed in by the observer.
casacore::String obsId() const
Return the observation program id.
casacore::Double channelWidth(VLAEnum::CDA cda) const
returns the bandwidth of an individual channel, in Hz, of the data in the specified CDA...
VLASDA & operator=(const VLASDA &other)
The assignment constructor uses reference semantics.
double Double
Definition: aipstype.h:55
casacore::ByteSource itsRecord
Definition: VLASDA.h:281
casacore::String obsMode() const
Return the observing mode.
casacore::String obsModeFull() const
Return the observing mode in full glory.
casacore::uInt trueChannels(VLAEnum::CDA cda) const
returns the number of data channels in the specified CDA (including the average channel) ...
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::uInt subArray() const
Return the subarray ID.
Types
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in th...
Definition: MDoppler.h:149
casacore::String sourceName() const
Return the source name as typed in by the observer.
casacore::MDirection::Types epoch() const
return the reference frame for the field directions.
Interprets the data in an sub-array data area of a VLA logical record.
Definition: VLASDA.h:117
CorrMode
A list of the different correlator Modes.
Definition: VLAEnum.h:100
casacore::Double filterBandwidth(VLAEnum::CDA cda) const
returns the total bandwidth, in Hz, of the front end filter in the specified CDA. ...
casacore::MDoppler::Types dopplerDefn(VLAEnum::CDA cda) const
Return the definition of Doppler shift used to convert the radial velocity to a frequency (for the sp...
CDA
Names for the different correlator data areas&#39;s.
Definition: VLAEnum.h:84
String: the storage and methods of handling collections of characters.
Definition: String.h:223
VLAEnum::CorrMode correlatorMode() const
Return the correlator mode for this record.
casacore::Double edgeFrequency(VLAEnum::CDA cda) const
returns the observed frequency at the lower edge of the band, after correcting for channels that have...
casacore::uInt npol(VLAEnum::CDA cda) const
Return the number of polarisations in the specified CDA.
casacore::uInt nChannels(VLAEnum::CDA cda) const
returns the number of spectral channels in the specified CDA (excludes channel zero) ...
Types
Types of known MFrequencies Warning: The order defines the order in the translation matrix FromTo in...
Definition: MFrequency.h:176
casacore::Double correlatedBandwidth(VLAEnum::CDA cda) const
returns the total bandwidth, in Hz, over all the channels of the data in the specified CDA...
casacore::Bool dopplerTracking(VLAEnum::CDA cda) const
returns true if Doppler tracking has been turned on for the specified CDA.
casacore::String calCode() const
Return the calibration code.
unsigned int uInt
Definition: aipstype.h:51
casacore::Double obsTime() const
Return the observation time in seconds of the centre of this integration.
casacore::MFrequency::Types restFrame(VLAEnum::CDA cda) const
Return the assumed rest frame that will be used when calculating the observers motion relative to the...
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42
casacore::uInt electronicPath(VLAEnum::CDA cda) const
Return the &#39;electronic path&#39; that the data in the specified CDA has travveled through.