casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluxCalcVQS.h
Go to the documentation of this file.
1 //# FluxCalcVQS.h: Base class for flux standard calculations taking into account for
2 //# time variability
3 //# Copyright (C) 2013
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be adressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 //#
28 #ifndef COMPONENTS_FLUXCALCVQS_H
29 #define COMPONENTS_FLUXCALCVQS_H
30 
33 #include <casa/BasicSL/String.h>
34 #include <casa/OS/Path.h>
36 #include <tables/Tables/Table.h>
37 
38 //# Handy for passing anonymous arrays to functions.
40 
42 #include <map>
43 
44 
45 namespace casacore{
46 
47 class MFrequency;
48 //class Vector;
49 }
50 
51 namespace casa { //# NAMESPACE CASA - BEGIN
52 
53 //class Flux;
54 
55 // <summary>
56 // FluxCalcVQS: Base class for flux standard calculations taking account for
57 // time variability of the sources.
58 // </summary>
59 
60 // <use visibility=export>
61 
62 // <reviewed reviewer="" date="" tests="" demos="">
63 
64 // <prerequisite>
65 // <li><linkto class="FluxStandard">FluxStandard</linkto> module
66 // </prerequisite>
67 //
68 // <etymology>
69 // From "flux density", "calculator", "variable", and "quasistatic".
70 // </etymology>
71 //
72 // <synopsis>
73 // The FluxCalcVQS class provides an interface and a small amount of machinery
74 // for computing total flux densities of calibrators which may be variable in time.
75 // For the source with significant enough time variability, inteploation in time
76 // with choice of nearest neighbour, linear, cubic, or cubic spline, is performed.
77 // See FluxStdsQS for actual definitions of the standards. The polynomial coefficents
78 // for the standard include time-variable sources are assumed to be stored in an external
79 // table.
80 // </synopsis>
81 //
82 // <example>
83 // <srcblock>
84 // </srcblock>
85 // </example>
86 //
87 // <motivation>
88 // Provide a base interface for calculating standard flux
89 // densities, and include any common functions.
90 // </motivation>
91 
92 class FluxCalcVQS: public FluxStdSrcs
93 {
94 public:
95 
96  typedef FluxCalcVQS FCVQS;
99 
100  // Source identifiers.
101  /****
102  enum Source {
103  THREEC286 = 0, // 3C286
104  THREEC48,
105  THREEC147,
106  THREEC138,
107  NINETEEN34M638, // 1934-638
108  THREEC295,
109  THREEC196,
110  THREEC123,
111  // The number of standards in this enumerator.
112  NUMBER_SOURCES,
113  UNKNOWN_SOURCE = NUMBER_SOURCES
114  };
115  ***/
116  virtual ~FluxCalcVQS();
117 
119  const casacore::MFrequency& mfreq, const casacore::Bool updatecoeffs) = 0;
123 
124  //for time variable case with interpolation method
128  const casacore::MEpoch& mtime,
129  const casacore::String& interpmethod);
130 
131  // If a FS::Source enum matches srcName, returns the enum.
132  // Otherwise, FCQS::UNKNOWN_SOURCE.
133  //FCQS::Source srcNameToEnum(const casacore::String& srcName) const;
134 
135  // Sets srcEnum_p = srcNameToEnum(sourceName), and returns
136  // srcEnum_p != FCQS::UNKNOWN_SOURCE
137  virtual casacore::Bool setSource(const casacore::String& sourceName, const casacore::MDirection& sourceDir);
138 
140 
141  //casacore::MDirection getDirection() {return directions_p[srcEnum_p];}
143 
144  // Read the coefficient data table
145  void readQSCoeffsTable(const casacore::Path& fileName);
146  // Interpolate for time variable source
147  void interpolate(const casacore::String& interpmethod);
148  // Set the coefficients from one epoch where i is row number in the original data table
150  // Get currently set coefficients
152  //casacore::RigidVector<casacore::Double,2 > getValidFreqRange() {return validfreqrange_p;}
154 
155  //keep track if it is non-time var source for Perley-Butler2013
156  void isTimeVar(casacore::Bool istimevar);
157 
158 protected:
159  FluxCalcVQS(); // Initializes names_p.
160 
161 private:
162  FCVQS::Source srcEnum_p; // The source identifier.
163 
164  // A map from an FS::Source enum to a list of recognized names for it.
165  //std::map<FCQS::Source, casacore::Vector<casacore::String> > names_p;
166 
167  // A map from an FS::Source enum to its J2000 direction.
168  //std::map<FCQS::Source, casacore::MDirection> directions_p;
169 
170  // get interpolate method enum
172 
173  //convert epochs in year.frac to mjds
175 
180  //casacore::Vector<casacore::Float> tvcoeffs_p;
185  //virtual casacore::Bool setCoeffs() = 0;
186  //
187 };
188 
189 } //# NAMESPACE CASA - END
190 
191 #endif /* COMPONENTS_FLUXCALCVQS_H */
A Measure: astronomical direction.
Definition: MDirection.h:174
A 1-D Specialization of the Array class.
FluxCalcVQS()
casacore::Vector< casacore::Double > epochvec_p
Definition: FluxCalcVQS.h:176
virtual casacore::Bool setSource(const casacore::String &sourceName, const casacore::MDirection &sourceDir)
If a FS::Source enum matches srcName, returns the enum.
Main interface class to a read/write table.
Definition: Table.h:153
casacore::RigidVector< casacore::String, 4 > RVS4
Definition: FluxCalcVQS.h:97
void isTimeVar(casacore::Bool istimevar)
keep track if it is non-time var source for Perley-Butler2013
void readQSCoeffsTable(const casacore::Path &fileName)
Read the coefficient data table.
void setSourceCoeffsfromVec(casacore::uInt &i)
Set the coefficients from one epoch where i is row number in the original data table.
casacore::MDirection getDirection(const FSS::Source srcEnum) const
Get source direction of srcEnum.
class Flux;
Definition: FluxCalcVQS.h:92
Path name of a file.
Definition: Path.h:126
A Measure: instant in time.
Definition: MEpoch.h:104
casacore::Vector< casacore::MFrequency > getValidFreqRange()
casacore::RigidVector&lt;casacore::Double,2 &gt; getValidFreqRange() {return validfreqrange_p;} ...
Definition: FluxCalcVQS.h:153
casacore::Matrix< casacore::Float > coefferrsmat_p
Definition: FluxCalcVQS.h:178
***virtual ~FluxCalcVQS()
A Measure: wave characteristics.
Definition: MFrequency.h:161
void interpolate(const casacore::String &interpmethod)
Interpolate for time variable source.
Fast Vector classes with fixed (templated) length.
casacore::Matrix< casacore::Float > coeffsmat_p
Definition: FluxCalcVQS.h:177
casacore::Table Table_p
Definition: FluxCalcVQS.h:183
casacore::Interpolate1D< casacore::Double, casacore::Float >::Method getInterpMethod_p(const casacore::String &interpmethod)
A map from an FS::Source enum to a list of recognized names for it.
Source
Source identifiers.
Definition: FluxStdSrcs.h:76
casacore::Vector< casacore::Float > fluxes_p
Definition: FluxCalcVQS.h:179
void convertYearFracToMjd(const casacore::Vector< casacore::Double > &yearfrac, casacore::Vector< casacore::Double > &mjds)
convert epochs in year.frac to mjds
casacore::RigidVector< casacore::Vector< casacore::Float >, 2 > tvcoeffs_p
casacore::Vector&lt;casacore::Float&gt; tvcoeffs_p;
Definition: FluxCalcVQS.h:181
Method
The different interpolation methods are enumerated here.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
FluxCalcVQS FCVQS
Definition: FluxCalcVQS.h:96
FCVQS::Source getSrcEnum()
casacore::RigidVector< casacore::String, 5 > RVS5
Definition: FluxCalcVQS.h:98
casacore::Bool istimevar_p
Definition: FluxCalcVQS.h:184
virtual casacore::Bool operator()(Flux< casacore::Double > &value, Flux< casacore::Double > &error, const casacore::MFrequency &mfreq, const casacore::Bool updatecoeffs)=0
casacore::Vector< casacore::MFrequency > validfreqrange_p
Definition: FluxCalcVQS.h:182
casacore::RigidVector< casacore::Vector< casacore::Float >, 2 > getCurrentCoeffs()
Get currently set coefficients.
Definition: FluxCalcVQS.h:151
FCVQS::Source srcEnum_p
Definition: FluxCalcVQS.h:162
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Basic calibrator data used in the flux standards.
Definition: FluxStdSrcs.h:68
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42