casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VLAADA.h
Go to the documentation of this file.
1 //# VLAADA:
2 //# Copyright (C) 1999,2000,2001
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_VLAADA_H
30 #define NRAO_VLAADA_H
31 
32 #include <casa/aips.h>
33 #include <casa/IO/ByteSource.h>
35 #include <nrao/VLA/VLAEnum.h>
36 
37 #include <casa/namespace.h>
38 namespace casacore{
39 
40 class String;
41 template <class T> class Vector;
42 }
43 
44 namespace casa { //# NAMESPACE CASA - BEGIN
45 } //# NAMESPACE CASA - END
46 
47 
48 // <summary>
49 // Interprets the data in an antenna data area of a VLA logical record.
50 // </summary>
51 
52 // <use visibility=export>
53 
54 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
55 // </reviewed>
56 
57 // <prerequisite>
58 // <li> The VLA archive format as described in VLA computer memo 188
59 // </prerequisite>
60 //
61 // <etymology> The antenna data is, in memo 188, frequently shortened to the
62 // acronym ADA. As this is specific to the VLA the name VLAADA seemed
63 // appropriate.
64 // </etymology>
65 //
66 // <synopsis>
67 // This class contains functions which access and interpret the data in an
68 // antenna data area of a VLA logical record. Only data within one antenna data
69 // are is accessable with this class, and multiple instances of this class are
70 // needed to simultaneously look at the data in the other antenna data areas
71 // in a VLA logical record.
72 //
73 // The functions in this class access the specified data in the antenna data
74 // area, and may convert the units and data types so something more suitable
75 // for general use. They also interpret the data and provide some derived
76 // quantities eg., the padName function.
77 // </synopsis>
78 //
79 // <example>
80 // This code fragment shows how to initialise a casacore::Block of objects of this class
81 // and then use these objects to determine which antenna is on which pad. It
82 // is assumed that the Bytesource object contains a VLA Logical record.
83 // <srcblock>
84 // casacore::ByteSource VLARecord(...);
85 // casacore::Block<VLAADA> adaBlock;
86 // VLARCA rca(VLARecord);
87 // const casacore::uInt nant = rca.nAntennas();
88 // adaBlock.resize(nant);
89 // for (casacore::uInt a = 0; a < nant; a++) {
90 // adaBlock[a].attach(VLARecord, rca.ADAOffset(a));
91 // cout << "Antenna " << adaBlock[a].antName()
92 // << " is on pad " << adaBlock[a].padName() << endl;
93 // }
94 // </srcblock>
95 // </example>
96 //
97 // <motivation>
98 // This class was needed as part of the VLA filler application.
99 // </motivation>
100 //
101 // <thrown>
102 // When compiled in debug mode this class does a lot of consistancy
103 // checking. If it detects anomolies it will throw an exception (casacore::AipsError).
104 // </thrown>
105 //
106 // <todo asof="1999/08/11">
107 // <li> The member functions should probably be rounded out.
108 // </todo>
109 
110 class VLAADA
111 {
112 public:
113  // The default constructor creates a unusable object. You need to use the
114  // assignment operator or the attach function to create a usable object.
115  VLAADA();
116 
117  // Construct this object to read data from the specified VLA logical
118  // record. The antenna data area that will be used begins at the specified
119  // number of bytes from the beginning of the record.
120  VLAADA(casacore::ByteSource& record, casacore::uInt offset);
121 
122  // The destructor is trivial.
123  ~VLAADA();
124 
125  // The copy constructor uses reference semantics.
126  VLAADA(const VLAADA& other);
127 
128  // The assignment constructor uses reference semantics.
129  VLAADA& operator=(const VLAADA& other);
130 
131  // Re-initialise this object so that it now reads data from the given VLA
132  // logical record. The antenna data area that will be used begins at the
133  // specified number of bytes from the beginning of the record.
134  void attach(casacore::ByteSource& record, casacore::uInt offset);
135 
136  // return the antenna name. This is a string version of the antenna id n is a
137  // one or two digit number that contains the antenna identifier (see below).
138  casacore::String antName(casacore::Bool newStyle=true) const;
139 
140  // returns the antenna Id. This is a number which stays with the "steel" and
141  // gets moved to new locations. It is not the pad number. It is between 1
142  // and 28 inclusive.
143  casacore::uInt antId() const;
144 
145  // Front end Temp...gives a clue if antenna is EVLA
147  // return the pad name that this antenna is currently located on. This is
148  // obtained by knowing where the pads are and looking at the bx position of
149  // the antenna (the bx position in the logical record has to be within half a
150  // meter of the value given in an table). Pad names are of the form "Nn" or
151  // "En" or "Wn" where n is a one or two digit number that has an approximate
152  // correspondence with the distance of the pad from the centre of the array.
153  casacore::String padName() const;
154 
155  // return the u coordinate in meters of this antenna at the centre of the
156  // integration.
157  casacore::Double u() const;
158 
159  // return the v coordinate in meters of this antenna at the centre of the
160  // integration.
161  casacore::Double v() const;
162 
163  // return the w coordinate in meters of this antenna at the centre of the
164  // integration.
165  casacore::Double w() const;
166 
167  // return the Bx position in meters of this antenna, from the centre of the
168  // Array.
169  casacore::Double bx() const;
170 
171  // return the By position in meters of this antenna, from the centre of the
172  // Array.
173  casacore::Double by() const;
174 
175  // return the Bz position in meters of this antenna, from the centre of the
176  // Array.
177  casacore::Double bz() const;
178 
179  // return the bx, by, bz positions in meters of this antenna, from the centre
180  // of the Array.
182 
183  // return the IF status. The status indicates how bad the data probably is
184  // for the specified if and the current antenna. Values of zero indicate the
185  // IF is OK, 1 is a warning, 2 means not so good, and bigger numbers, up to
186  // 15 mean the IF is successively worse.
187  casacore::uInt ifStatus(VLAEnum::IF which) const;
188 
189  // returns the nominal sensitivity of the specified IF. These numbers are
190  // multiplied by the raw correlaton co-efficients to produce the numbers in
191  // the correlation data area.
193 
194  // return the IF polarisation. Normally at the VLA IF's A & B measure
195  // right-hand-circular polarisation, and IF's C & D measure
196  // left-hand-circular polarisation. But in special circumstances this can be
197  // swapped. This function returns casacore::Stokes::RCircular or casacore::Stokes::LCircular.
199 
200  // Has the nominal sensitivity amplitude scaling been applied?
201  // (auto-true prior to revision 25 [exclusive])
203 
204  // Identifies which array an antennn belongs to: VLA, EVLA, or VLBA
205  casacore::String arrayName() const;
206 
207  // casacore::Function which checks the internal data of this class for consistant
208  // values. Returns true if everything is fine otherwise returns false.
209  casacore::Bool ok() const;
210 
211 private:
212  //# Contains a VLA logical record
214  //# the offset to the start of this ADA in the record. An offset of zero
215  //# means this ADA is not used in this record.
217 };
218 #endif
A 1-D Specialization of the Array class.
VLAADA()
The default constructor creates a unusable object.
Class for read-only access to data in a given format.
Definition: ByteSource.h:91
casacore::Double bx() const
return the Bx position in meters of this antenna, from the centre of the Array.
casacore::Vector< casacore::Double > pos() const
return the bx, by, bz positions in meters of this antenna, from the centre of the Array...
casacore::Bool nomSensApplied(VLAEnum::IF which, const casacore::uInt rev) const
Has the nominal sensitivity amplitude scaling been applied? (auto-true prior to revision 25 [exclusiv...
casacore::Float frontEndTemp(VLAEnum::IF which) const
Front end Temp...gives a clue if antenna is EVLA.
~VLAADA()
The destructor is trivial.
casacore::Double bz() const
return the Bz position in meters of this antenna, from the centre of the Array.
casacore::String antName(casacore::Bool newStyle=true) const
return the antenna name.
StokesTypes
The Stokes types are defined by this enum.
Definition: Stokes.h:66
casacore::String padName() const
return the pad name that this antenna is currently located on.
casacore::Double v() const
return the v coordinate in meters of this antenna at the centre of the integration.
casacore::Double by() const
return the By position in meters of this antenna, from the centre of the Array.
double Double
Definition: aipstype.h:55
casacore::uInt ifStatus(VLAEnum::IF which) const
return the IF status.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::Double w() const
return the w coordinate in meters of this antenna at the centre of the integration.
casacore::Float nominalSensitivity(VLAEnum::IF which) const
returns the nominal sensitivity of the specified IF.
casacore::Stokes::StokesTypes ifPol(VLAEnum::IF which) const
return the IF polarisation.
float Float
Definition: aipstype.h:54
VLAADA & operator=(const VLAADA &other)
The assignment constructor uses reference semantics.
IF
Names for all the IF&#39;s.
Definition: VLAEnum.h:72
casacore::uInt itsOffset
Definition: VLAADA.h:216
Interprets the data in an antenna data area of a VLA logical record.
Definition: VLAADA.h:110
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::uInt antId() const
returns the antenna Id.
casacore::Bool ok() const
casacore::Function which checks the internal data of this class for consistant values.
casacore::ByteSource itsRecord
Definition: VLAADA.h:213
void attach(casacore::ByteSource &record, casacore::uInt offset)
Re-initialise this object so that it now reads data from the given VLA logical record.
casacore::Double u() const
return the u coordinate in meters of this antenna at the centre of the integration.
casacore::String arrayName() const
Identifies which array an antennn belongs to: VLA, EVLA, or VLBA.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42