casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VLABaselineRecord.h
Go to the documentation of this file.
1 //# VLABaselineRecord:
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_VLABASELINERECORD_H
30 #define NRAO_VLABASELINERECORD_H
31 
32 #include <casa/aips.h>
33 #include <casa/IO/ByteSource.h>
34 //# The following should be a forward declaration. But our casacore::Complex & DComplex
35 //# classes are a typedef hence this does not work. Replace the following with
36 //# forward declarations when casacore::Complex and casacore::DComplex are no longer typedefs.
37 #include <casa/BasicSL/Complex.h>
38 
39 #include <casa/namespace.h>
40 namespace casacore{
41 
42 class String;
43 template <class T> class Vector;
44 template <class T> class Array;
45 }
46 
47 namespace casa { //# NAMESPACE CASA - BEGIN
48 } //# NAMESPACE CASA - END
49 
50 
51 // <summary></summary>
52 
53 // <use visibility=export>
54 
55 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
56 // </reviewed>
57 
58 // <prerequisite>
59 // <li> SomeClass
60 // <li> SomeOtherClass
61 // <li> some concept
62 // </prerequisite>
63 //
64 // <etymology>
65 // </etymology>
66 //
67 // <synopsis>
68 // </synopsis>
69 //
70 // <example>
71 // </example>
72 //
73 // <motivation>
74 // </motivation>
75 //
76 // <templating arg=T>
77 // <li>
78 // <li>
79 // </templating>
80 //
81 // <thrown>
82 // <li>
83 // <li>
84 // </thrown>
85 //
86 // <todo asof="yyyy/mm/dd">
87 // <li> add this feature
88 // <li> fix this bug
89 // <li> start discussion of this possible extension
90 // </todo>
91 
93 {
94 public:
95  // The shapes of all the components
96  enum Type {
97  // A simple point component
98  CONTINUUM = 0,
99  // A elliptical Gaussian component
101  // An unknown Component
103  // The number of types in this enumerator
105  };
106 
107  // A virtual destructor is needed to ensure that the destructor of derived
108  // classes is actually used.
109  virtual ~VLABaselineRecord();
110 
111  // returns the correlations for this baseline. The returned casacore::Vector contains
112  // all the data for this baseline and has been scaled.
114 
115  // Returns the correlations for this baseline in the supplied Array. The
116  // supplied casacore::Array may have any number of dimensions, but all except one must
117  // have a length on 1. The axis that is not of length one must be the right
118  // length to hold all the data contained in the record. Alternatively the
119  // casacore::Array may contain no elements in which case it will be resized to a Vector
120  // of the correct length. The returned values have been scaled.
121  virtual void data(casacore::Array<casacore::Complex>& values) const = 0;
122 
123  // returns the flags for the correlations for this baseline.
124  virtual casacore::Vector<casacore::Bool> flags() const = 0;
125 
126  // returns the scaling factor used to convert the internal data to the actual
127  // values.
128  virtual casacore::uInt scale() const = 0;
129 
130  // returns the antenna 1 index for this baseline.
131  virtual casacore::uInt ant1() const = 0;
132 
133  // returns the antenna 2 index for this baseline.
134  virtual casacore::uInt ant2() const = 0;
135 
136  // return the type of this class
137  virtual VLABaselineRecord::Type type() const = 0;
138 
139  // Convert a Type enum into a String
141 
142  // Convert a given casacore::String to a Type enumerator
144 
145 protected:
146  //# The default constructor creates a unusable object. Use the attach
147  //function to turn an object constructed this way into a usable object.
149 
150  //# Initialise this VLABaselineRecord from the given record with the
151  //# specified offset.
153 
154  //# Initialise this VLABaselineRecord from the given record with the
155  //# specified offset.
156  void attach(casacore::ByteSource& record, casacore::uInt offset);
157 
158  //# reads the scaling factor given the offset from the start of the record
159  casacore::uInt scale(casacore::uInt headerOffset) const;
160 
161  //# returns the antenna 1 index for this baseline given the offset in bytes
162  //# from the start of the record.
163  casacore::uInt ant1(casacore::uInt headerOffset) const;
164 
165  //# returns the antenna 2 index for this baseline given the offset in bytes
166  //# from the start of the record.
167  casacore::uInt ant2(casacore::uInt headerOffset) const;
168 
169  //# Contains a VLA record
171 
172  //# the offset to the start of the data for this object in the VLA record.
174 private:
175  //# The copy constructor is private and undefined
176  VLABaselineRecord(const VLABaselineRecord& other);
177 
178  //# The assignment operator is private and undefined.
180 };
181 #endif
182 
183 
A 1-D Specialization of the Array class.
virtual casacore::uInt scale() const =0
returns the scaling factor used to convert the internal data to the actual values.
Class for read-only access to data in a given format.
Definition: ByteSource.h:91
A elliptical Gaussian component.
static casacore::String name(VLABaselineRecord::Type typeEnum)
Convert a Type enum into a String.
casacore::uInt itsOffset
virtual VLABaselineRecord::Type type() const =0
return the type of this class
virtual casacore::uInt ant2() const =0
returns the antenna 2 index for this baseline.
virtual casacore::String typeName()
Return type name as string.
void attach(casacore::ByteSource &record, casacore::uInt offset)
VLABaselineRecord()
function to turn an object constructed this way into a usable object.
The number of types in this enumerator.
virtual casacore::Vector< casacore::Bool > flags() const =0
returns the flags for the correlations for this baseline.
virtual casacore::Vector< casacore::Complex > data() const
returns the correlations for this baseline.
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
Type
The shapes of all the components.
casacore::ByteSource itsRecord
String: the storage and methods of handling collections of characters.
Definition: String.h:223
A simple point component.
virtual casacore::uInt ant1() const =0
returns the antenna 1 index for this baseline.
VLABaselineRecord & operator=(const VLABaselineRecord &other)
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
virtual ~VLABaselineRecord()
A virtual destructor is needed to ensure that the destructor of derived classes is actually used...