casa
$Rev:20696$
|
00001 //# GBTRcvrCalFiller: A filler for GBT receiver TCAL tables. 00002 //# Copyright (C) 2001,2002 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_GBTRCVRCALFILLER_H 00030 #define NRAO_GBTRCVRCALFILLER_H 00031 00032 #include <casa/aips.h> 00033 #include <tables/Tables/ArrayColumn.h> 00034 #include <tables/Tables/Table.h> 00035 #include <tables/Tables/TableColumn.h> 00036 #include <casa/BasicSL/String.h> 00037 00038 namespace casa { //# NAMESPACE CASA - BEGIN 00039 template <class T> class Matrix; 00040 } //# NAMESPACE CASA - END 00041 00042 #include <casa/namespace.h> 00043 00044 // <summary> 00045 // A filler for GBT receiver TCAL tables. 00046 // </summary> 00047 00048 // <use visibility=local> 00049 00050 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00051 // </reviewed> 00052 00053 // <prerequisite> 00054 // <li> GBT DAP FITS files 00055 // </prerequisite> 00056 // 00057 // <etymology> 00058 // </etymology> 00059 // 00060 // <synopsis> 00061 // </synopsis> 00062 // 00063 // <example> 00064 // </example> 00065 // 00066 // <motivation> 00067 // </motivation> 00068 // 00069 // <thrown> 00070 // <li> 00071 // <li> 00072 // </thrown> 00073 // 00074 00075 class GBTRcvrCalFiller 00076 { 00077 public: 00078 // Fill to any NRAO_GBT_RCVRCAL table already attached to parent or 00079 // create a new one to fill to. 00080 GBTRcvrCalFiller(Table &parent); 00081 00082 ~GBTRcvrCalFiller() {;} 00083 00084 // fill using the table name supplied. If that table name has already 00085 // been filled, nothing new will be added to the table being filled. 00086 // In either case, the table returned by lastFilled will be a reference 00087 // to those rows filled from the indicated fileName. 00088 Bool fill(const String &fileName); 00089 00090 // return a reference to the rows filled by the fileName used in the 00091 // most recent call to fill 00092 const Table &lastFilled() {return itsLastFilled;} 00093 00094 // return the filenames used in the last call to fill 00095 const String &lastFileName() {return itsLastFileName;} 00096 00097 // interpolate to given arrays from the measured TCAL and TRX 00098 // vectors given the indicated frequency vector, receiver name, 00099 // feed name, and polarizations vector 00100 void interpolate(const String &receiverName, 00101 const Vector<String> &feedName, 00102 const Vector<String> &polarizations, 00103 const Vector<Double> &frequencies, 00104 String &testDate, 00105 Matrix<Float> &tcal, Matrix<Float> &trx, 00106 Bool useHighCal); 00107 00108 // flush the underlying table 00109 void flush() {itsTable.flush();} 00110 private: 00111 // the table being filled 00112 Table itsTable; 00113 00114 // a reference to the portion of itsTable most filled from the 00115 // file pointed to by itsLastFileName 00116 Table itsLastFilled; 00117 00118 String itsLastFileName; 00119 00120 // the columns being filled 00121 // scalar columns from the primary HDU - use ISM as storage manager 00122 TableColumn fileNameCol, receiver, dateObs, minFreq, maxFreq, nBeam, 00123 tauzenit, etal, apereff, beameff; 00124 00125 // scalar columns from the individual table headers - use std SM 00126 TableColumn testDate, receptor, feed, polarize, bandwdth, engineer, 00127 tech; 00128 00129 // vector columns from the rows - each cell from one row 00130 ArrayColumn<Float> frequency, trx, tcalLo, tcalHi; 00131 00132 void putScalarString(const String &fieldName, const TableRecord &rec, 00133 Int rownr, const String &defval, TableColumn &col, 00134 const String &altName=String()); 00135 void putScalarFloat(const String &fieldName, const TableRecord &rec, 00136 Int rownr, Float scale, Float defval, 00137 TableColumn &col, const String &altName=String(), 00138 Float altScale=1.0); 00139 void putScalarInt(const String &fieldName, const TableRecord &rec, 00140 Int rownr, Int defval, TableColumn &col, 00141 const String &altName=String()); 00142 00143 // undefined an inaccessible 00144 GBTRcvrCalFiller(); 00145 GBTRcvrCalFiller(const GBTRcvrCalFiller &other); 00146 GBTRcvrCalFiller &operator=(const GBTRcvrCalFiller &other); 00147 }; 00148 00149 #endif 00150 00151