casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
VLASpectralLineRecord.h
Go to the documentation of this file.
00001 //# VLASpectralLineRecord.h: 
00002 //# Copyright (C) 1999
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id$
00028 
00029 #ifndef NRAO_VLASPECTRALLINERECORD_H
00030 #define NRAO_VLASPECTRALLINERECORD_H
00031 
00032 #include <casa/aips.h>
00033 #include <nrao/VLA/VLABaselineRecord.h>
00034 #include <casa/IO/ByteSource.h>
00035 //# The following should be a forward declaration. But our Complex & DComplex
00036 //# classes are a typedef hence this does not work. Replace the following with
00037 //# forward declarations when Complex and DComplex are no longer typedefs.
00038 #include <casa/BasicSL/Complex.h>
00039 
00040 #include <casa/namespace.h>
00041 namespace casa { //# NAMESPACE CASA - BEGIN
00042 template <class T> class Vector;
00043 } //# NAMESPACE CASA - END
00044 
00045 
00046 // <summary></summary>
00047 
00048 // <use visibility=export>
00049 
00050 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00051 // </reviewed>
00052 
00053 // <prerequisite>
00054 //   <li> SomeClass
00055 //   <li> SomeOtherClass
00056 //   <li> some concept
00057 // </prerequisite>
00058 //
00059 // <etymology>
00060 // </etymology>
00061 //
00062 // <synopsis>
00063 // </synopsis>
00064 //
00065 // <example>
00066 // </example>
00067 //
00068 // <motivation>
00069 // </motivation>
00070 //
00071 // <templating arg=T>
00072 //    <li>
00073 //    <li>
00074 // </templating>
00075 //
00076 // <thrown>
00077 //    <li>
00078 //    <li>
00079 // </thrown>
00080 //
00081 // <todo asof="yyyy/mm/dd">
00082 //   <li> add this feature
00083 //   <li> fix this bug
00084 //   <li> start discussion of this possible extension
00085 // </todo>
00086 
00087 class VLASpectralLineRecord: public VLABaselineRecord
00088 {
00089 public:
00090   // The default constructor creates a unusable object. Use the attach function
00091   // to turn an object constructed this way into a usable object.
00092   VLASpectralLineRecord();
00093 
00094   // Initialise this SpectralLineRecord from the given record with the
00095   // specified offset.
00096   VLASpectralLineRecord(ByteSource& record, uInt offset, uInt nChan);
00097   
00098   // The destructor is trivial
00099   virtual ~VLASpectralLineRecord();
00100 
00101   // Initialise this VLASpectralLineRecord from the given BytesSource (which
00102   // must contain a VLA logical record), and must be readable & seekable. The
00103   // offset specifies where the record starts and the number of channels in
00104   // this record must be specified.
00105   void attach(ByteSource& record, uInt offset, uInt nChan);
00106 
00107   // returns the correlations for this baseline. This will be a Vector
00108   // containing the correlations, at one polarisation, for all the
00109   // channels. The returned Vector has been scaled.
00110   virtual Vector<Complex> data() const;
00111 
00112   // Returns the correlations for this baseline in the supplied Array. The
00113   // supplied Array may have any number of dimensions, but all except one must
00114   // have a length on 1. The axis that is not of length one must be the right
00115   // length to hold all the data contained in the record.  Alternatively the
00116   // Array may contain no elements in which case it will be resized to a Vector
00117   // of the correct length. The returned values have been scaled.
00118 
00119   // The returned Array will contain the correlations, at one polarisation, for
00120   // all the channels.
00121   virtual void data(Array<Complex>& values) const;
00122 
00123   // returns the flags for the correlations for this baseline. The returned
00124   // Vector will always have a length of four.
00125   virtual Vector<Bool> flags() const;
00126 
00127   // returns the scaling factor used to convert the internal data to the actual
00128   // values.
00129   virtual uInt scale() const;
00130 
00131   // returns the antenna 1 index for this baseline.
00132   virtual uInt ant1() const;
00133 
00134   // returns the antenna 2 index for this baseline.
00135   virtual uInt ant2() const;
00136   
00137   // Return the type of this record (ie., SPECTRALLINE).
00138   virtual VLABaselineRecord::Type type() const;
00139 
00140 private:
00141   //# The copy constructor is private and undefined
00142   VLASpectralLineRecord(const VLASpectralLineRecord& other);
00143   //# The assignment operator is private and undefined.
00144   VLASpectralLineRecord& operator=(const VLASpectralLineRecord& other);
00145 
00146   //# The number of spectral channels in this record.
00147   uInt itsNchan;
00148 };
00149 #endif