casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
EVLASwPow.h
Go to the documentation of this file.
00001 //# EVLASwPow.h: Declaration of EVLA Switched Power 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_EVLASWPOW_H
00029 #define SYNTHESIS_EVLASWPOW_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 
00038 namespace casa { //# NAMESPACE CASA - BEGIN
00039 
00040 // Forward declarations
00041 class VisEquation;
00042 
00043 
00044 // **********************************************************
00045 //  EVLA switched power Gain and Tsys
00046 //
00047 
00048 
00049 class EVLASwPow : public GJones {
00050 public:
00051 
00052   enum SPType{SWPOW,EVLAGAIN=SWPOW,RQ,SWPOVERRQ,NONE};
00053   
00054   static SPType sptype(String name);
00055   static String sptype(SPType sptype);
00056 
00057   // Constructor
00058   EVLASwPow(VisSet& vs);
00059   EVLASwPow(const Int& nAnt);
00060 
00061   virtual ~EVLASwPow();
00062 
00063   // Return the type enum (for now, pretend we are G)
00064   virtual Type type() { return VisCal::G; };
00065 
00066   // EVLA Gain and Tsys are Float parameters
00067   virtual VisCalEnum::VCParType parType() { return VisCalEnum::REAL; };
00068 
00069   // Return type name as string (ditto)
00070   virtual String typeName()     { return "G EVLASWPOW"; };
00071   virtual String longTypeName() { return "G EVLASWPOW (Switched-power gain)"; };
00072 
00073   // Local setSpecify
00074   using GJones::setSpecify;
00075   virtual void setSpecify(const Record& specify);
00076 
00077   // Specific specify() that reads the SYSCAL subtable
00078   virtual void specify(const Record& specify);
00079 
00080   // In general, we are freq-dep
00081   virtual Bool freqDepPar() { return False; };
00082 
00083 
00084 protected:
00085 
00086   // There are 4 parameters (Gain and Tsys for each pol)
00087   virtual Int nPar() { return 4; };  
00088 
00089   // The parameter array is not (just) the Jones matrix element array
00090   virtual Bool trivialJonesElem() { return False; };
00091 
00092   // Local version to extract integration time and bandwidth
00093   virtual void applyCal(VisBuffer& vb, Cube<Complex>& Vout,Bool trial=False);
00094   
00095   // Calculate Jones matrix elements (slice out the gains)
00096   virtual void calcAllJones();
00097 
00098   // Synchronize the weight-scaling factors
00099   //  Weights are multiplied by G*G/Tsys per antenna
00100   virtual void syncWtScale();
00101 
00102   // Experimenting with updateWt
00103   //  virtual void updateWt(Vector<Float>& wt,const Int& a1,const Int& a2);
00104 
00105 private:
00106 
00107   // Fill the Tcals from the CALDEVICE table
00108   void fillTcals();
00109 
00110   // The name of the SYSCAL table
00111   String sysPowTabName_,calDevTabName_;
00112 
00113   // Tcal storage
00114   Cube<Float> tcals_;
00115 
00116   // Digital factors for the EVLA
00117   Float correff_;      // net corr efficiency (lossy)
00118   Float frgrotscale_;  // fringe rotation scale (lossless)
00119   Float nyquist_;      // 2*dt*dv
00120 
00121   // Effective per-chan BW, per spw for weight calculation
00122   Vector<Double> effChBW_;
00123 
00124 };
00125 
00126 
00127 
00128 
00129 } //# NAMESPACE CASA - END
00130 
00131 #endif
00132