casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VLASpectralLineRecord.h
Go to the documentation of this file.
1 //# VLASpectralLineRecord.h:
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_VLASPECTRALLINERECORD_H
30 #define NRAO_VLASPECTRALLINERECORD_H
31 
32 #include <casa/aips.h>
34 #include <casa/IO/ByteSource.h>
35 //# The following should be a forward declaration. But our casacore::Complex & DComplex
36 //# classes are a typedef hence this does not work. Replace the following with
37 //# forward declarations when casacore::Complex and casacore::DComplex are no longer typedefs.
38 #include <casa/BasicSL/Complex.h>
39 
40 #include <casa/namespace.h>
41 namespace casacore{
42 
43 template <class T> class Vector;
44 }
45 
46 namespace casa { //# NAMESPACE CASA - BEGIN
47 } //# NAMESPACE CASA - END
48 
49 
50 // <summary></summary>
51 
52 // <use visibility=export>
53 
54 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
55 // </reviewed>
56 
57 // <prerequisite>
58 // <li> SomeClass
59 // <li> SomeOtherClass
60 // <li> some concept
61 // </prerequisite>
62 //
63 // <etymology>
64 // </etymology>
65 //
66 // <synopsis>
67 // </synopsis>
68 //
69 // <example>
70 // </example>
71 //
72 // <motivation>
73 // </motivation>
74 //
75 // <templating arg=T>
76 // <li>
77 // <li>
78 // </templating>
79 //
80 // <thrown>
81 // <li>
82 // <li>
83 // </thrown>
84 //
85 // <todo asof="yyyy/mm/dd">
86 // <li> add this feature
87 // <li> fix this bug
88 // <li> start discussion of this possible extension
89 // </todo>
90 
92 {
93 public:
94  // The default constructor creates a unusable object. Use the attach function
95  // to turn an object constructed this way into a usable object.
97 
98  // Initialise this SpectralLineRecord from the given record with the
99  // specified offset.
101 
102  // The destructor is trivial
103  virtual ~VLASpectralLineRecord();
104 
105  // Initialise this VLASpectralLineRecord from the given BytesSource (which
106  // must contain a VLA logical record), and must be readable & seekable. The
107  // offset specifies where the record starts and the number of channels in
108  // this record must be specified.
109  void attach(casacore::ByteSource& record, casacore::uInt offset, casacore::uInt nChan);
110 
111  // returns the correlations for this baseline. This will be a Vector
112  // containing the correlations, at one polarisation, for all the
113  // channels. The returned casacore::Vector has been scaled.
115 
116  // Returns the correlations for this baseline in the supplied Array. The
117  // supplied casacore::Array may have any number of dimensions, but all except one must
118  // have a length on 1. The axis that is not of length one must be the right
119  // length to hold all the data contained in the record. Alternatively the
120  // casacore::Array may contain no elements in which case it will be resized to a Vector
121  // of the correct length. The returned values have been scaled.
122 
123  // The returned casacore::Array will contain the correlations, at one polarisation, for
124  // all the channels.
125  virtual void data(casacore::Array<casacore::Complex>& values) const;
126 
127  // returns the flags for the correlations for this baseline. The returned
128  // casacore::Vector will always have a length of four.
129  virtual casacore::Vector<casacore::Bool> flags() const;
130 
131  // returns the scaling factor used to convert the internal data to the actual
132  // values.
133  virtual casacore::uInt scale() const;
134 
135  // returns the antenna 1 index for this baseline.
136  virtual casacore::uInt ant1() const;
137 
138  // returns the antenna 2 index for this baseline.
139  virtual casacore::uInt ant2() const;
140 
141  // Return the type of this record (ie., SPECTRALLINE).
142  virtual VLABaselineRecord::Type type() const;
143 
144 private:
145  //# The copy constructor is private and undefined
147  //# The assignment operator is private and undefined.
149 
150  //# The number of spectral channels in this record.
152 };
153 #endif
A 1-D Specialization of the Array class.
Class for read-only access to data in a given format.
Definition: ByteSource.h:91
virtual VLABaselineRecord::Type type() const
Return the type of this record (ie., SPECTRALLINE).
virtual casacore::Vector< casacore::Complex > data() const
returns the correlations for this baseline.
virtual ~VLASpectralLineRecord()
The destructor is trivial.
VLASpectralLineRecord & operator=(const VLASpectralLineRecord &other)
VLASpectralLineRecord()
The default constructor creates a unusable object.
virtual casacore::Vector< casacore::Bool > flags() const
returns the flags for the correlations for this baseline.
virtual casacore::uInt ant2() const
returns the antenna 2 index for this baseline.
Type
The shapes of all the components.
virtual casacore::uInt ant1() const
returns the antenna 1 index for this baseline.
void attach(casacore::ByteSource &record, casacore::uInt offset, casacore::uInt nChan)
Initialise this VLASpectralLineRecord from the given BytesSource (which must contain a VLA logical re...
virtual casacore::uInt scale() const
returns the scaling factor used to convert the internal data to the actual values.
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