casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
FluxCalcQS.h
Go to the documentation of this file.
00001 //# FluxCalcQS.h: Base class for flux standard calculations which do not
00002 //# explicitly depend on time.
00003 //# Copyright (C) 2010
00004 //# Associated Universities, Inc. Washington DC, USA.
00005 //#
00006 //# This library is free software; you can redistribute it and/or modify it
00007 //# under the terms of the GNU Library General Public License as published by
00008 //# the Free Software Foundation; either version 2 of the License, or (at your
00009 //# option) any later version.
00010 //#
00011 //# This library is distributed in the hope that it will be useful, but WITHOUT
00012 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014 //# License for more details.
00015 //#
00016 //# You should have received a copy of the GNU Library General Public License
00017 //# along with this library; if not, write to the Free Software Foundation,
00018 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00019 //#
00020 //# Correspondence concerning AIPS++ should be adressed as follows:
00021 //#        Internet email: aips2-request@nrao.edu.
00022 //#        Postal address: AIPS++ Project Office
00023 //#                        National Radio Astronomy Observatory
00024 //#                        520 Edgemont Road
00025 //#                        Charlottesville, VA 22903-2475 USA
00026 //#
00027 //#
00028 #ifndef COMPONENTS_FLUXCALCQS_H
00029 #define COMPONENTS_FLUXCALCQS_H
00030 
00031 #include <components/ComponentModels/FluxStandard.h>
00032 #include <casa/BasicSL/String.h>
00033 #include <measures/Measures/MDirection.h>
00034 
00035 //# Handy for passing anonymous arrays to functions.
00036 #include <scimath/Mathematics/RigidVector.h>
00037 
00038 #include <map>
00039 
00040 
00041 namespace casa { //# NAMESPACE CASA - BEGIN
00042 
00043 //class Flux;
00044 class MFrequency;
00045 //class Vector;
00046 
00047 // <summary> 
00048 // FluxCalcQS: Base class for flux standard calculations which do not
00049 // explicitly depend on time.
00050 // </summary>
00051 
00052 // <use visibility=export>
00053 
00054 // <reviewed reviewer="" date="" tests="" demos="">
00055 
00056 // <prerequisite>
00057 // <li><linkto class="FluxStandard">FluxStandard</linkto> module
00058 // </prerequisite>
00059 //
00060 // <etymology>
00061 // From "flux density", "calculator", and "quasistatic".
00062 // </etymology>
00063 //
00064 // <synopsis>
00065 // The FluxCalcQS class provides an interface and a small amount of machinery
00066 // for computing total flux densities of nominally non-variable sources.
00067 // "Nominally non-variable" means that the sources do not vary quickly, but
00068 // they are remeasured, and new standards published, every few years.  See
00069 // FluxStdsQS for actual definitions of the standards.
00070 // </synopsis>
00071 //
00072 // <example>
00073 // <srcblock>
00074 // </srcblock>
00075 // </example>
00076 //
00077 // <motivation>
00078 // Provide a base time-independent interface for calculating standard flux
00079 // densities, and include any common functions.
00080 // </motivation>
00081 
00082 class FluxCalcQS
00083 {
00084 public:
00085   typedef FluxCalcQS FCQS;
00086   typedef RigidVector<String, 4> RVS4;
00087   typedef RigidVector<String, 5> RVS5;
00088 
00089   // Source identifiers.
00090   enum Source {
00091     THREEC286 = 0,      // 3C286
00092     THREEC48,
00093     THREEC147,
00094     THREEC138,
00095     NINETEEN34M638,   // 1934-638
00096     THREEC295,
00097     THREEC196,
00098     THREEC123,
00099     // The number of standards in this enumerator.
00100     NUMBER_SOURCES,
00101     UNKNOWN_SOURCE = NUMBER_SOURCES
00102   };
00103   
00104   virtual ~FluxCalcQS();
00105 
00106   virtual Bool operator()(Flux<Double>& value, Flux<Double>& error,
00107                           const MFrequency& mfreq) = 0;
00108   Bool operator()(Vector<Flux<Double> >& values,
00109                   Vector<Flux<Double> >& errors,
00110                   const Vector<MFrequency>& mfreqs);
00111 
00112   // If a FS::Source enum matches srcName, returns the enum.
00113   // Otherwise, FCQS::UNKNOWN_SOURCE.
00114   FCQS::Source srcNameToEnum(const String& srcName) const;
00115 
00116   // Sets srcEnum_p = srcNameToEnum(sourceName), and returns
00117   // srcEnum_p != FCQS::UNKNOWN_SOURCE
00118   virtual Bool setSource(const String& sourceName);
00119 
00120   FCQS::Source getSrcEnum();
00121 
00122   MDirection getDirection() {return directions_p[srcEnum_p];}
00123 
00124 protected:
00125   FluxCalcQS();   // Initializes names_p.
00126 
00127 private:
00128   FCQS::Source srcEnum_p;       // The source identifier.
00129 
00130   // A map from an FS::Source enum to a list of recognized names for it.
00131   std::map<FCQS::Source, Vector<String> > names_p;
00132 
00133   // A map from an FS::Source enum to its J2000 direction.
00134   std::map<FCQS::Source, MDirection> directions_p;
00135 };
00136 
00137 } //# NAMESPACE CASA - END
00138 
00139 #endif /* COMPONENTS_FLUXCALCQS_H */