casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
BeamSquint.h
Go to the documentation of this file.
00001 //# BeamSquint.h: Defines the BeamSquint class
00002 //# Copyright (C) 1996,1997,1998,1999,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 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 //# $Id$
00028 
00029 #ifndef SYNTHESIS_BEAMSQUINT_H
00030 #define SYNTHESIS_BEAMSQUINT_H
00031 
00032 #include <casa/aips.h>
00033 #include <measures/Measures.h>
00034 #include <coordinates/Coordinates.h>
00035 #include <measures/Measures/MDirection.h>
00036 
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 
00039 // <summary> encapsulates beam squint (RR and LL beams at different directions) </summary>
00040 
00041 // <use visibility=export>
00042 
00043 // <reviewed reviewer="" date="" tests="" demos="">
00044 
00045 // <prerequisite>
00046 // <li> <linkto class="MDirection">MDirection</linkto> class
00047 // </prerequisite>
00048 //
00049 // <etymology>
00050 // BeamSquint = Beam Squint.  Obviously so.
00051 // </etymology>
00052 //
00053 // <synopsis> 
00054 // Beam squint is when the RR and LL circular polarization beams
00055 // are located in different places on the sky.  The effect is due
00056 // to the RR and LL feeds being off-axis.  The VLA has particularly bad
00057 // beam squint.  Some instruments like the AT or WSRT have essentially
00058 // no beam squint.  The nominal pointing position is taken to be
00059 // right in between the RR and LL beam centers/
00060 //
00061 // BeamSquint has an MDirection which represents the angular offset from the nominal
00062 // pointing position at Parallactic angle = 0 (ie, observing a source south of zenith
00063 // at transit) and the actual RR beam.  BeamSquint also has a reference frequency,
00064 // and the magnitude of the squint angular offset is inversely proportional with
00065 // frequency.  The squint offset is a true angular displacement.
00066 //
00067 // The main thing that BeamSquint does is: given the nominal
00068 // pointing position and the parallactic angle, calculate the
00069 // actual squinted beam position for the RR or LL beams.
00070 // If BeamSquint::NONE is requested, the nominal pointing position
00071 // is returned.
00072 // </synopsis> 
00073 //
00074 //
00075 // <example>
00076 // <srcblock>
00077 //    MDirection oldPointing;
00078 //    MDirection newPointing;
00079 //    Quantity parallacticAngle(C::pi/2, "rad");
00080 //    Quantity observingFreq(1.4142, "GHz");
00081 //    BeamSquint oneBS( MDirection( Quantity(1.0, "'"), Quantity(1.0, "'"),
00082 //                                  MDirection::Ref(MDirection::AZEL)),
00083 //                      Quantity(1.0, "GHz") );
00084 //    oneBS.getPointingDirection(oldPointing, parallacticAngle,
00085 //                               observingFreq, BeamSquint::RR, newPointing);
00086 //
00087 // </srcblock>
00088 // </example>
00089 //
00090 // <motivation>
00091 // Boy, is this UGLY.  We do that UGLY stuff just once, though,
00092 // so you never have to look at it AGAIN (see getPointingDirection
00093 // if you still don't believe me).
00094 // </motivation>
00095 //
00096 // <todo asof="98/10/21">
00097 // <li> Hmmm?
00098 // </todo>
00099 
00100  
00101 class BeamSquint {
00102 public:
00103 
00104   // Allowed Squints: NONE = no squint: PB is centered on the pointing center
00105   // RR = PB is shifted from pointing center by amount in PBMathInterface's squint_p
00106   // LL = PB is shifted from pointing center by the NEGATIVE of the
00107   //             amount in PBMathInterface's squint_p
00108   // GOFIGURE = do the appropriate thing based on the STOKES of the Image
00109   enum SquintType{NONE, RR, LL, GOFIGURE};
00110 
00111   // Default constructor initializes to zero
00112   BeamSquint();
00113 
00114   //Smart constructor to initialize the MDirection and reference freq
00115   BeamSquint(const MDirection& squint, const Quantity& refFreq);
00116 
00117   //Copy constructor
00118   BeamSquint(const BeamSquint& other);
00119 
00120   //Operator=
00121   BeamSquint& operator= (const BeamSquint& other);
00122 
00123   //Destructor
00124   ~BeamSquint();
00125 
00126   //Show to Logger
00127   void show();
00128 
00129   //Is BeamSquint nonNull?
00130   Bool isNonNull();
00131 
00132   //Return the squint's MDirection scaled to a particular frequency
00133   MDirection& scale(const Quantity& refFreq);
00134 
00135   //Return the squinted pointing position
00136   void getPointingDirection (const MDirection& pointDir,
00137                              const Quantity parAngle,
00138                              const Quantity obsFreq,
00139                              const SquintType doSquint,
00140                              MDirection& newPointingDir);
00141 
00142 protected:
00143 
00144   MDirection squint_p;
00145 
00146   Quantity refFreq_p;
00147 
00148 };
00149   
00150 
00151 } //# NAMESPACE CASA - END
00152 
00153 #endif