FluxStandard.h

Go to the documentation of this file.
00001 //# FluxStandard.h: Compute flux densities for standard reference sources
00002 //# Copyright (C) 1996,1997,1999,2001
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: FluxStandard.h 21292 2012-11-28 14:58:19Z gervandiepen $
00028 
00029 #ifndef COMPONENTS_FLUXSTANDARD_H
00030 #define COMPONENTS_FLUXSTANDARD_H
00031 
00032 #include <casa/aips.h>
00033 #include <components/ComponentModels/Flux.h>
00034 #include <measures/Measures/MDirection.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // Forward declarations
00039 class String;        //#include <casa/BasicSL/String.h>
00040 class MEpoch;        //#include <measures/Measures/MEpoch.h>
00041 class MFrequency;    //#include <measures/Measures/MFrequency.h>
00042 class SpectralModel; //#include <components/ComponentModels/SpectralModel.h>
00043 
00044 // <summary> 
00045 // FluxStandard: Compute flux densities for standard reference sources
00046 // </summary>
00047 
00048 // <use visibility=export>
00049 
00050 // <reviewed reviewer="" date="" tests="" demos="">
00051 
00052 // <prerequisite>
00053 // <li><linkto class="Flux">Flux</linkto> module
00054 // </prerequisite>
00055 //
00056 // <etymology>
00057 // From "flux density" and "standard".
00058 // </etymology>
00059 //
00060 // <synopsis>
00061 // The FluxStandard class provides a means to compute total flux
00062 // densities for specified sources on a standard
00063 // flux density scale, such as that established by Baars or
00064 // Perley and Taylor.
00065 // </synopsis>
00066 //
00067 // <example>
00068 // <srcblock>
00069 // </srcblock>
00070 // </example>
00071 //
00072 // <motivation>
00073 // Encapsulate information on standard flux density computation in one class.
00074 // </motivation>
00075 //
00076 // <todo asof="99/06/01">
00077 // <li> closer integration into component models.
00078 // </todo>
00079 
00080 class FluxStandard
00081 {
00082  public:
00083   // Flux scale types.
00084   // Standards which do not include resolution info must come before
00085   // HAS_RESOLUTION_INFO, and those with it must come after.
00086   enum FluxScale {
00087     // Perley (1990); plus Reynolds (1934-638; 7/94); Baars (3C138)
00088     PERLEY_90 = 0,
00089 
00090     // Perley and Taylor (1995.2); plus Reynolds (1934-638; 7/94)
00091     PERLEY_TAYLOR_95,
00092 
00093     // Perley and Taylor (1999.2); plus Reynolds (1934-638; 7/94)
00094     PERLEY_TAYLOR_99,
00095 
00096     // Baars scale
00097     // Baars J. W. M., Genzel R., Pauliny-Toth I. I. K., et al., 1977,
00098     // A&A, 61, 99
00099     // http://cdsads.u-strasbg.fr/abs/1977A%26A....61...99B
00100     BAARS,
00101 
00102     // Perley-Butler 2010 Scale (using VLA [not EVLA!] data)
00103     PERLEY_BUTLER_2010,
00104 
00105     // Perley-Butler 2013 (include time variable sources)
00106     PERLEY_BUTLER_2013,
00107 
00108     // Scaife & Heald 2012MNRAS.423L..30S
00109     // broadband low-frequency flux scale for frequencies <~500 MHz
00110     SCAIFE_HEALD_2012,
00111 
00112     // Stevens & Reynolds 2016, A combination of the Reynolds low
00113     // frequency flux scale with the Stevens high frequency flux scale
00114     // for 1934-638 described in Partridge et al (2016), ApJ 821,1
00115     STEVENS_REYNOLDS_2016,
00116 
00117     HAS_RESOLUTION_INFO,
00118 
00119     // Estimate the flux density for a Solar System object using a JPL Horizons
00120     // ephemeris/data page and model provided by Bryan Butler.
00121     SS_JPL_BUTLER = HAS_RESOLUTION_INFO,
00122 
00123     // The number of standards in this enumerator.
00124     NUMBER_STANDARDS
00125   };
00126 
00127   // Default constructor, and destructor
00128   FluxStandard(const FluxStandard::FluxScale scale =
00129                FluxStandard::PERLEY_TAYLOR_99);
00130   ~FluxStandard();
00131 
00132   // Compute the flux density for a specified source at a specified frequency
00133   Bool compute (const String& sourceName, const MDirection& sourceDir, const MFrequency& mfreq, const MEpoch& mtime,
00134                 Flux<Double>& value, Flux<Double>& error);
00135 
00136   // Compute the flux densities and their uncertainties for a specified source
00137   // at a set of specified frequencies.
00138   Bool compute(const String& sourceName, 
00139                const MDirection& sourceDir,
00140                const Vector<MFrequency>& mfreqs,
00141                const MEpoch& mtime,
00142                Vector<Flux<Double> >& values,
00143                Vector<Flux<Double> >& errors,
00144                const Bool verbose=True);
00145 
00146   // Compute the flux densities and their uncertainties for a specified source
00147   // for a set of sets of specified frequencies, i.e. mfreqs[spw] is a set of
00148   // frequencies for channels in spectral window spw, and values and errors are
00149   // arranged the same way.
00150   Bool compute(const String& sourceName,
00151                const MDirection& sourceDir,
00152                const Vector<Vector<MFrequency> >& mfreqs,
00153                const MEpoch& mtime,
00154                Vector<Vector<Flux<Double> > >& values,
00155                Vector<Vector<Flux<Double> > >& errors);
00156 
00157   // Like compute, but it also saves a set of ComponentLists for the source to
00158   // disk and puts the paths (sourceName_mfreq_mtime.cl) in clnames, making it
00159   // suitable for resolved sources.
00160   // mtime is ignored for nonvariable objects.
00161   // Solar System objects are typically resolved and variable!
00162   // The ComponentList names are formed from prefix, sourceName, the
00163   // frequencies, and times.
00164   Bool computeCL(const String& sourceName, const Vector<Vector<MFrequency> >& mfreqs,
00165                  const MEpoch& mtime, const MDirection& position,
00166                  Vector<Vector<Flux<Double> > >& values,
00167                  Vector<Vector<Flux<Double> > >& errors,
00168                  Vector<String>& clnames, const String& prefix="");
00169 
00170   // set interpolation method for a time-variable source
00171   void setInterpMethod(const String& interpmethod);
00172   
00173 
00174   // Take a component cmp and save it to a ComponentList on disk, returning the
00175   // pathname.  ("" if unsuccessful, sourceName_mfreqGHzDateTime.cl otherwise)
00176   //
00177   // This is also used outside of FluxStandard, but it is declared here instead
00178   // of in ComponentList because it is somewhat specialized, mainly in setting
00179   // up the pathname.  The ComponentList name is formed from prefix, sourceName,
00180   // mfreq, and mtime.
00181   //
00182   static String makeComponentList(const String& sourceName, const MFrequency& mfreq,
00183                                   const MEpoch& mtime, const Flux<Double>& fluxval,
00184                                   const ComponentShape& cmp,
00185                                   const SpectralModel& spectrum,
00186                                   const String& prefix="");
00187 
00188   // Variation of the above that will fill a TabularSpectrum with mfreqs and
00189   // values if appropriate.
00190   static String makeComponentList(const String& sourceName,
00191                                   const Vector<MFrequency>& mfreqs,
00192                                   const MEpoch& mtime,
00193                                   const Vector<Flux<Double> >& values,
00194                                   const ComponentShape& cmp,
00195                                   const String& prefix="");
00196 
00197   // Decode a string representation of the standard or catalog name
00198   static Bool matchStandard(const String& name, 
00199                             FluxStandard::FluxScale& stdEnum,
00200                             String& stdName);
00201 
00202   // Return a standard string description for each scale or catalog
00203   static String standardName(const FluxStandard::FluxScale& stdEnum);
00204 
00205  private:
00206   // Flux scale in use
00207   FluxStandard::FluxScale itsFluxScale;
00208 
00209   Bool has_direction_p;
00210 
00211   MDirection direction_p;
00212 
00213   String interpmethod_p;
00214 };
00215 
00216 } //# NAMESPACE CASA - END
00217 
00218 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1