00001 //# TsysGainCal.h: Declaration of Tsys calibration 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 //# 00027 00028 #ifndef SYNTHESIS_TSYSGAINCAL_H 00029 #define SYNTHESIS_TSYSGAINCAL_H 00030 00031 #include <casa/aips.h> 00032 #include <casa/Containers/Record.h> 00033 #include <casa/BasicSL/Complex.h> 00034 #include <synthesis/MeasurementComponents/VisCal.h> 00035 #include <synthesis/MeasurementComponents/SolvableVisCal.h> 00036 #include <synthesis/MeasurementComponents/StandardVisCal.h> 00037 // not yet:#include <synthesis/MeasurementComponents/CalCorruptor.h> 00038 00039 namespace casa { //# NAMESPACE CASA - BEGIN 00040 00041 // Forward declarations 00042 class VisEquation; 00043 //not yet: class TJonesCorruptor; 00044 00045 00046 // ********************************************************** 00047 // Standard Tsys Spectrum from SYSCAL table 00048 // 00049 00050 class StandardTsys : public BJones { 00051 public: 00052 00053 // Constructor 00054 StandardTsys(VisSet& vs); 00055 StandardTsys(String msname,Int MSnAnt,Int MSnSpw); 00056 StandardTsys(const MSMetaInfoForCal& msmc); 00057 StandardTsys(const Int& nAnt); 00058 00059 virtual ~StandardTsys(); 00060 00061 // Return the type enum (for now, pretend we are B) 00062 virtual Type type() { return VisCal::B; }; 00063 00064 // Return type name as string (ditto) 00065 virtual String typeName() { return "B TSYS"; }; 00066 virtual String longTypeName() { return "B TSYS (freq-dep Tsys)"; }; 00067 00068 // Tsys are Float parameters 00069 virtual VisCalEnum::VCParType parType() { return VisCalEnum::REAL; }; 00070 00071 // Local setSpecify 00072 using BJones::setSpecify; 00073 virtual void setSpecify(const Record& specify); 00074 00075 // Specific specify() that reads the SYSCAL subtable 00076 virtual void specify(const Record& specify); 00077 00078 // In general, we are freq-dep 00079 virtual Bool freqDepPar() { return True; }; 00080 00081 // Specialized to turn on spectral weight calibration 00082 virtual void correct2(vi::VisBuffer2& vb, Bool trial=False, Bool doWtSp=False); 00083 00084 protected: 00085 00086 // The Jones matrix elements are not the parameters 00087 // ( j = sqrt(p) ) 00088 virtual Bool trivialJonesElem() { return False; }; 00089 00090 // Specialized calcPar that does some sanity checking 00091 virtual void calcPar(); 00092 00093 // Invert doInv for Tsys corrections 00094 virtual void syncJones(const Bool& doInv) { BJones::syncJones(!doInv); }; 00095 00096 // Calculate Jones matrix elements from Tsys (j = sqrt(p) ) 00097 virtual void calcAllJones(); 00098 00099 // Local version that arrange channelized correction 00100 virtual void syncWtScale(); 00101 00102 // Calculate weight scale 00103 virtual void calcWtScale(); 00104 virtual void calcWtScale2(); // called by local syncWtScale only 00105 00106 private: 00107 00108 // The name of the SYSCAL table 00109 String sysCalTabName_; 00110 00111 // Signal formation of channelized weight calibration 00112 Bool freqDepCalWt_; 00113 00114 // <nothing> 00115 00116 00117 }; 00118 00119 } //# NAMESPACE CASA - END 00120 00121 #endif 00122