SDFeedHandler.h

Go to the documentation of this file.
00001 //# SDFeedFiller.h: fills the FEED table for the SDFITS filler
00002 //# Copyright (C) 2000
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 MS_SDFEEDHANDLER_H
00030 #define MS_SDFEEDHANDLER_H
00031 
00032 #include <casacore/casa/aips.h>
00033 #include <casacore/casa/Containers/RecordField.h>
00034 
00035 namespace casacore { //# NAMESPACE CASACORE - BEGIN
00036 
00037 //# Forward Declarations
00038 class ColumnsIndex;
00039 class MeasurementSet;
00040 class MSFeed;
00041 class MSFeedColumns;
00042 class Record;
00043 
00044 template <class T> class Vector;
00045 
00046 // <summary>
00047 // </summary>
00048 
00049 // <use visibility=local>   or   <use visibility=export>
00050 
00051 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00052 // </reviewed>
00053 
00054 // <prerequisite>
00055 //   <li> SomeClass
00056 //   <li> SomeOtherClass
00057 //   <li> some concept
00058 // </prerequisite>
00059 //
00060 // <etymology>
00061 // </etymology>
00062 //
00063 // <synopsis>
00064 // </synopsis>
00065 //
00066 // <example>
00067 // </example>
00068 //
00069 // <motivation>
00070 // </motivation>
00071 //
00072 // <templating arg=T>
00073 //    <li>
00074 //    <li>
00075 // </templating>
00076 //
00077 // <thrown>
00078 //    <li>
00079 //    <li>
00080 // </thrown>
00081 //
00082 // <todo asof="yyyy/mm/dd">
00083 //   <li> add this feature
00084 //   <li> fix this bug
00085 //   <li> start discussion of this possible extension
00086 // </todo>
00087 
00088 class SDFeedHandler
00089 {
00090 public:
00091     // default ctor is not attached to a MS and hence is useless until attached
00092     SDFeedHandler();
00093 
00094     // attach this to a MS - no columns are explicitly handled here
00095     SDFeedHandler(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
00096 
00097     // copy ctor
00098     SDFeedHandler(const SDFeedHandler &other);
00099 
00100     ~SDFeedHandler() {clearAll();}
00101 
00102     // assignment operator, uses copy semantics
00103     SDFeedHandler &operator=(const SDFeedHandler &other);
00104 
00105     // attach to a MS, the handledCols and row arguments are ignored here
00106     void attach(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
00107 
00108     // reset internals given indicated row, use the same MS
00109     void resetRow(const Record &row);
00110     
00111     // fill - a new row is added only when necessary
00112     void fill(const Record &row, Int antennaId, Int spwinId, const Vector<Int> &stokes);
00113 
00114     // get the current feed ID
00115     Int feedId() {return feedId_p;}
00116 
00117     // the current NUM_RECEPTORS value
00118     Int numReceptors() {return nrecpt_p;}
00119 private:
00120     RecordFieldPtr<Int> numRecpKey_p;
00121     ColumnsIndex *index_p;
00122     MSFeed *msFeed_p;
00123     MSFeedColumns *msFeedCols_p;
00124 
00125     Int feedId_p, nextFeedId_p, nrecpt_p;
00126 
00127     // fields which might be the result of saving via ms2sdfits
00128     RORecordFieldPtr<Int> feed1Field_p, feed2Field_p, beamIdField_p, phasedFeedIdField_p, numReceptorsField_p;
00129     RORecordFieldPtr<Double> intervalField_p, timeField_p, scaReceptorAngleField_p; 
00130     RORecordFieldPtr<Array<Double> > beamOffsetField_p, positionField_p, receptorAngleField_p;
00131     RORecordFieldPtr<Array<Complex> > polResponseField_p;
00132     RORecordFieldPtr<String> polarizationTypeField_p;
00133 
00134     // get the polarization type from the stokes vector
00135     void stokesToPolType(const Vector<Int> &stokes, Vector<String> &polType);
00136 
00137     // cleanup everything
00138     void clearAll();
00139 
00140     void clearRow();
00141 
00142     // initialize everything
00143     void initAll(MeasurementSet &ms, Vector<Bool> &handledCols, const Record &row);
00144 
00145     // initialize things which depend on row
00146     void initRow(Vector<Bool> &handledCols, const Record &row);
00147 };
00148 
00149 
00150 } //# NAMESPACE CASACORE - END
00151 
00152 #endif
00153 
00154 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1