casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CalSetMetaInfo.h
Go to the documentation of this file.
00001 //# SolvableVisCalMetaInfo.h: Definitions of interface for SolvableVisCalMetaInfo
00002 //# Copyright (C) 1996,1997,2000,2001,2002,2003
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 adressed 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 //# $Id$
00027 
00028 #ifndef CALTABLES_CALSETMETAINFO_H
00029 #define CALTABLES_CALSETMETAINFO_H
00030 
00031 #include <casa/aips.h>
00032 #include <ms/MeasurementSets/MSAntennaColumns.h>
00033 #include <ms/MeasurementSets/MSAntenna.h>
00034 #include <ms/MeasurementSets/MSFieldColumns.h>
00035 #include <ms/MeasurementSets/MSField.h>
00036 #include <ms/MeasurementSets/MSSpWindowColumns.h>
00037 #include <ms/MeasurementSets/MSSpectralWindow.h>
00038 
00039 // #include <casa/Logging/LogMessage.h>
00040 // #include <casa/Logging/LogSink.h>
00041 // #include <casa/Logging/LogIO.h>
00042 
00043 namespace casa { //# NAMESPACE CASA - BEGIN
00044 
00045 // **********************************************************
00046 //  CalSetMetaInfo
00047 //
00048 
00049 class CalSetMetaInfo {
00050 public:
00051 
00052   CalSetMetaInfo():
00053     antTableName("ANTENNA"), fieldTableName("FIELD"), spwTableName("SPECTRAL_WINDOW"),
00054     calTableMSAC(NULL), calTableMSFC(NULL), calTableMSSpC(NULL),
00055     calAntTable(NULL), calFieldTable(NULL), calSpwTable(NULL)  
00056   {rootName="";};
00057 
00058   CalSetMetaInfo(const String& root);
00059   
00060   ~CalSetMetaInfo()   {cleanUp();};
00061 
00062   void setRootName(const String& root) {rootName=root;};
00063   String fullSubTableName(String& subTableName,const String& base){
00064     return Table(base).rwKeywordSet().asTable(subTableName).tableName();};
00065   String fullSubTableName(String& subTableName){
00066     return fullSubTableName(subTableName,rootName);};
00067 
00068   void reset(const String& root);
00069   String getAntName(Int ant);
00070   String getFieldName(Int field);
00071   String getSpwName(Int spw);
00072   Double  getSpwRefFreq(Int spw);
00073   // Vector<Double>  getSpwChanWidth(Int spw);
00074   Double  getSpwTotalBandwidth(Int spw);
00075 
00076   Vector<String> getFieldNames();
00077   Vector<String> getAntNames();
00078   Vector<String> getSpwNames();
00079   Vector<Double> getSpwRefFreqs();
00080   Bool verify(CalSetMetaInfo& otherCSMI);
00081 
00082   void copyMetaTables(const String& target);
00083 
00084 protected:
00085 
00086   void cleanUp()
00087   {
00088     if (calTableMSAC  != NULL) {delete calTableMSAC;  calTableMSAC  = NULL;}
00089     if (calTableMSFC  != NULL) {delete calTableMSFC;  calTableMSFC  = NULL;}
00090     if (calTableMSSpC != NULL) {delete calTableMSSpC; calTableMSSpC = NULL;}
00091 
00092     if (calAntTable   != NULL) {delete calAntTable;   calAntTable   = NULL;}
00093     if (calFieldTable != NULL) {delete calFieldTable; calFieldTable = NULL;}
00094     if (calSpwTable   != NULL) {delete calSpwTable;   calSpwTable   = NULL;}
00095   }
00096 private:
00097   String rootName, antTableName, fieldTableName, spwTableName;
00098   ROMSAntennaColumns *calTableMSAC;
00099   ROMSFieldColumns *calTableMSFC;
00100   ROMSSpWindowColumns *calTableMSSpC;
00101   MSAntenna *calAntTable;
00102   MSField *calFieldTable;
00103   MSSpectralWindow *calSpwTable;
00104 };
00105 
00106 
00107 
00108 
00109 } //# NAMESPACE CASA - END
00110 
00111 #endif