casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SpectralWindow.h
Go to the documentation of this file.
00001 /*
00002  * SpectralWindow.h
00003  *
00004  *  Created on: Feb 15, 2013
00005  *      Author: jjacobs
00006  */
00007 
00008 #ifndef MSVIS_SPECTRALWINDOW_H_
00009 #define MSVIS_SPECTRALWINDOW_H_
00010 
00011 #include <casa/aipstype.h>
00012 #include <casa/BasicSL.h>
00013 #include <vector>
00014 
00015 namespace casa {
00016 
00017 template<typename T>
00018 class ArrayColumn;
00019 class MeasurementSet;
00020 
00021 namespace ms {
00022 
00023 #warning "Needs battery of low-level tests; also needs write functionality"
00024 
00025 class SpectralChannel {
00026 
00027 public:
00028 
00029     SpectralChannel (Double frequency, Double width,
00030                      Double effectiveBandwidth, Double resolution)
00031     : effectiveBandwidth_p (effectiveBandwidth),
00032       frequency_p (frequency),
00033       resolution_p (resolution),
00034       width_p (width)
00035     {}
00036 
00037     Double effectiveBandwidth () const;
00038     Double frequency () const;
00039     Double resolution () const;
00040     Double width () const;
00041 
00042 private:
00043 
00044     Double effectiveBandwidth_p;
00045     Double frequency_p;
00046     Double resolution_p;
00047     Double width_p;
00048 
00049 };
00050 
00051 class SpectralWindow {
00052 
00053 public:
00054 
00055     typedef std::vector<SpectralChannel> Channels;
00056     typedef Channels::const_iterator const_iterator;
00057 
00058     SpectralWindow (const ROMSSpWindowColumns & columns, Int spectralWindowId);
00059 
00060     const_iterator begin () const;
00061     bool empty () const;
00062     const_iterator end () const;
00063     const SpectralChannel & get (Int i) const;
00064 
00065     Bool isFlagged () const;
00066     Int frequencyGroup () const;
00067     String frequencyGroupName () const;
00068     Int frequencyMeasureReference () const;
00069     Int ifConversionChain () const;
00070     String name () const;
00071     int nChannels () const;
00072     int netSideband () const;
00073     Double totalBandwidth () const;
00074     Double referenceFrequency () const;
00075 
00076 protected:
00077 
00078     void fillArrays(const ROMSSpWindowColumns & columns);
00079     Vector<Double> getArray (const ArrayColumn<Double> & arrayColumn);
00080     void fillScalars (const ROMSSpWindowColumns & columns);
00081     template<typename T>
00082     T getScalar (const ScalarColumn<T> & column);
00083 
00084 private:
00085 
00086     Channels channels_p;
00087     Bool flagged_p;
00088     Int frequencyGroup_p;
00089     String frequencyGroupName_p;
00090     Int frequencyMeasureReference_p;
00091     Int id_p;
00092     Int ifConversionChain_p;
00093     String name_p;
00094     int nChannels_p;
00095     int netSideband_p;
00096     Double totalBandwidth_p;
00097     Double referenceFrequency_p;
00098 };
00099 
00100 class SpectralWindows {
00101 
00102 public:
00103 
00104     typedef std::vector<SpectralWindow> Windows;
00105     typedef Windows::const_iterator const_iterator;
00106 
00107     SpectralWindows (const MeasurementSet * ms);
00108 
00109     const_iterator begin () const;
00110     bool empty () const;
00111     const_iterator end () const;
00112     const SpectralWindow & get (Int id) const;
00113     size_t size () const;
00114 
00115 protected:
00116 
00117 private:
00118 
00119     Windows windows_p;
00120 };
00121 
00122 } // end namespace vi
00123 } // end namespace casa
00124 
00125 
00126 
00127 #endif /* SPECTRALWINDOW_H_ */