casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VLACDA.h
Go to the documentation of this file.
1 //# VLACDA:
2 //# Copyright (C) 1999
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_VLACDA_H
30 #define NRAO_VLACDA_H
31 
32 #include <casa/aips.h>
33 #include <casa/IO/ByteSource.h>
34 #include <casa/Containers/Block.h>
36 
37 #include <casa/namespace.h>
38 // <summary></summary>
39 
40 // <use visibility=export>
41 
42 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
43 // </reviewed>
44 
45 // <prerequisite>
46 // <li> SomeClass
47 // <li> SomeOtherClass
48 // <li> some concept
49 // </prerequisite>
50 //
51 // <etymology>
52 // </etymology>
53 //
54 // <synopsis>
55 // </synopsis>
56 //
57 // <example>
58 // </example>
59 //
60 // <motivation>
61 // </motivation>
62 //
63 // <templating arg=T>
64 // <li>
65 // <li>
66 // </templating>
67 //
68 // <thrown>
69 // <li>
70 // <li>
71 // </thrown>
72 //
73 // <todo asof="yyyy/mm/dd">
74 // <li> add this feature
75 // <li> fix this bug
76 // <li> start discussion of this possible extension
77 // </todo>
78 
79 class VLACDA
80 {
81 public:
82  // The default constructor creates a unusable object. Use the attach function
83  // to turn an object constructed this way into a usable object.
84  VLACDA();
85 
86  // Initialise this CDA from the given BytesSource (which must contain a VLA
87  // logical record), and must be readable & seekable. The offset specifies
88  // where the CDA starts in the logical record. The number of antennas and
89  // channels in this CDA, as well as the size of a baseline record,
90  // must also be specified.
91  VLACDA(casacore::ByteSource& record, casacore::uInt offset, casacore::uInt baselineSize,
92  casacore::uInt nant, casacore::uInt nChan);
93 
94  // The copy constructor uses copy semantics
95  VLACDA(const VLACDA& other);
96 
97  // The destructor is trivial
98  ~VLACDA();
99 
100  // The assignment constructor uses copy semantics
101  VLACDA& operator=(const VLACDA& other);
102 
103  // Initialise this CDA from the given BytesSource (which must contain a VLA
104  // logical record), and must be readable & seekable. The offset specifies
105  // where the CDA starts in the logical record. The number of antennas and
106  // channels in this CDA, as well as the size of a baseline record,
107  // must also be specified.
108  void attach(casacore::ByteSource& record, casacore::uInt offset, casacore::uInt baselineSize,
109  casacore::uInt nant, casacore::uInt nChan);
110 
111  // Return true if the CDA contains valid data. This, and the copy functions,
112  // will not throw an exception if the CDA does not contain data.
113  casacore::Bool isValid() const;
114 
115  // return the specified baseline record corresponding to the specified
116  // auto-correlation. The index must be less than the number of antennas in
117  // this subarray otherwise an exception is thrown.
118  const VLABaselineRecord& autoCorr(casacore::uInt which) const;
119 
120  // return the specified baseline record corresponding to the specified
121  // cross-correlation. The index must be less than NANT*(NANT-1)/2 otherwise
122  // an exception is thrown.
123  const VLABaselineRecord& crossCorr(casacore::uInt which) const;
124 
125 private:
126  //# delete all the auto-correlation baseline pointers
127  void deleteACorr(casacore::uInt startIndex);
128  //# delete all the cross-correlation baseline pointers
129  void deleteXCorr(casacore::uInt startIndex);
130 
131  //# Contains a logical record. It is mutable because functions which do not
132  //# changes its contents do change its "location"
134 
135  // the offset to the start of this CDA in the record. An offset of zero means
136  // this CDA is not used in this record.
138 
139  // A cached value of the size, in bytes, of a baseline record.
141 
142  // A cached value of the number of antennas that this CDU has data for.
144 
145  // A cached value of the number of channels that this CDU has data for.
147 
148  //# A block containing containing "cached" baseline records for the
149  //# autocorrelations. The pointers are null until the data is actually
150  //# accessed.
152 
153  //# A block containing containing "cached" baseline records for the
154  //# crosscorrelations. The pointers are null until the data is actually
155  //# accessed.
157 };
158 #endif
~VLACDA()
The destructor is trivial.
casacore::Bool isValid() const
Return true if the CDA contains valid data.
Class for read-only access to data in a given format.
Definition: ByteSource.h:91
casacore::uInt itsBaselineSize
A cached value of the size, in bytes, of a baseline record.
Definition: VLACDA.h:140
VLACDA & operator=(const VLACDA &other)
The assignment constructor uses copy semantics.
const VLABaselineRecord & autoCorr(casacore::uInt which) const
return the specified baseline record corresponding to the specified auto-correlation.
VLACDA()
The default constructor creates a unusable object.
void deleteACorr(casacore::uInt startIndex)
void attach(casacore::ByteSource &record, casacore::uInt offset, casacore::uInt baselineSize, casacore::uInt nant, casacore::uInt nChan)
Initialise this CDA from the given BytesSource (which must contain a VLA logical record), and must be readable &amp; seekable.
casacore::PtrBlock< VLABaselineRecord * > itsXCorr
Definition: VLACDA.h:156
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::ByteSource itsRecord
Definition: VLACDA.h:133
Definition: VLACDA.h:79
casacore::uInt itsOffset
the offset to the start of this CDA in the record.
Definition: VLACDA.h:137
casacore::uInt itsNchan
A cached value of the number of channels that this CDU has data for.
Definition: VLACDA.h:146
void deleteXCorr(casacore::uInt startIndex)
casacore::PtrBlock< VLABaselineRecord * > itsACorr
Definition: VLACDA.h:151
const VLABaselineRecord & crossCorr(casacore::uInt which) const
return the specified baseline record corresponding to the specified cross-correlation.
unsigned int uInt
Definition: aipstype.h:51
casacore::uInt itsNant
A cached value of the number of antennas that this CDU has data for.
Definition: VLACDA.h:143