casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluxCalc_SS_JPL_Butler.h
Go to the documentation of this file.
1 //# FluxCalc_SS_JPL_Butler.h: class for getting the fluxes and angular
2 //# diameters of various Solar System objects.
3 //# Copyright (C) 2010
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 addressed 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_FLUXCALC_SS_JPL_BUTLER_H
29 #define COMPONENTS_FLUXCALC_SS_JPL_BUTLER_H
30 
31 //# include directives
32 #include <casa/aips.h>
33 #include <casa/BasicSL/String.h>
35 //#include <measures/Measures/MFrequency.h>
39 
40 namespace casacore{
41 
42 class MFrequency;
43 //class ScalarColumn<casacore::Double>; There doesn't seem to be a way to forward
44 }
45 
46 namespace casa { //# NAMESPACE CASA - BEGIN
47 
48 //declare a template.
49 
50 // <summary>
51 // FluxCalc_SS_JPL_Butler: Compute flux densities and get angular diameters
52 // for standard Solar System reference sources.
53 // </summary>
54 
55 // <use visibility=export>
56 
57 // <reviewed reviewer="" date="" tests="" demos="">
58 
59 // <prerequisite>
60 // <li><linkto class="FluxStandard">FluxStandard</linkto> module
61 // </prerequisite>
62 //
63 // <etymology>
64 // From "flux density",
65 // "Solar System",
66 // "JPL" (ephemeris provides position and angular diameter),
67 // and (Bryan) "Butler" (provides model to convert the above to a flux density).
68 // </etymology>
69 //
70 // <synopsis>
71 // This class organizes a set of functions to compute expected flux densities
72 // and angular diameters for several Solar System sources commonly used for
73 // flux calibration in (sub)mm astronomy.
74 // </synopsis>
75 //
76 // <example>
77 // <srcblock>
78 // </srcblock>
79 // </example>
80 //
81 // <motivation>
82 // Make available and encapsulate the Butler Solar System flux density models.
83 // </motivation>
84 //
85 // <todo asof="10/07/07">
86 // <li> Support more complicated (image) models.
87 // <li> Support a choice of models for a given object.
88 // <li> Refine the error estimate by looking at the extremes of the time and
89 // frequency intervals.
90 // </todo>
91 
93 {
94  public:
95  // Default constructor; provided mainly so an array of these can be made more
96  // easily. (Not that there appears to be an immediate need for that.)
98 
99  // The more useful constructor.
101 
103 
104  // Chooses an object, and returns whether was successful. It ignores the
105  // case of objname.
106  casacore::Bool setObj(const casacore::String& objname);
107 
108  void setTime(const casacore::MEpoch& time);
109  //void setFreq(const casacore::MFrequency& freq);
110 
111  // These return whether or not the item has been set, and if has, copy their
112  // item to the arg.
113  casacore::Bool getName(casacore::String& output) const;
114  casacore::Bool getTime(casacore::MEpoch& output) const;
115  //casacore::Bool getFreq(casacore::MFrequency& output) const;
116 
117  // Returns the default direction (N. Pole) on failure.
119 
120  // Sets angdiam to the source's angular diameter in radians and returns the
121  // object's component type (i.e. DISK), or UNKNOWN_SHAPE on failure.
123 
124  // Returns the distance from the object to the Sun in AU, or -1 if unknown.
126 
127  // returns the number of objects supported by this class.
128  casacore::uInt n_known() const;
129 
130  // Compute the flux densities, their uncertainties, and the angular diameter
131  // of the calibration source for a set of frequencies. It will try to read
132  // the right table in data/ephemerides/JPL-Horizons/.
133  //
134  // Return value:
135  // the model's shape, or UNKNOWN_SHAPE on failure.
136  // Inputs:
137  // must be already set, or it returns UNKNOWN_SHAPE.
138  // report: If false, suppress logger messages like e.g. references for the
139  // temperature. Intended for use in a loop, i.e. print the
140  // messages for the 1st spw but do not repeat them for the others.
141  // Output args:
142  // value: the calculated flux.
143  // error: the estimated uncertainty of value.
144  // angdiam: angular diameter in radians
148  const casacore::Bool report=true);
149 
150  // Same as the above, but for a set of sets of frequencies, i.e.
151  // mfreqs[spw] is a set of frequencies for channels in spectral window spw.
154  casacore::Double& angdiam,
156  private:
158  Mercury = 0,
160  // Earth, // Too highly resolved
163  Io,
167  // Saturn, // Modeling the rings is too complicated.
180  };
181 
182  // Tries to set objnum_p to the KnownObject matching name_p.
183  // Returns whether or not it found a match.
185 
186  // Reads a JPL-Horizons ephemeris table to get temperature_p,
187  // r_p (heliocentric distance), delta_p (geocentric distance),
188  // and phang_p (phase angle).
189  // Returns whether or not it was able to get the info.
191 
192  // Compute the flux densities assuming a uniform disk blackbody,
193  // and their uncertainties.
194  // It does not check whether everything is setup, since it assumes
195  // compute() already took care of it!
199 
200  // Like compute_BB(), except it uses a graybody model where each frequency
201  // has a corresponding temperature.
206 
222 
223  // Uses objnum_p to look up a mean temperature, and uses that.
224  // report: If false, suppress logger messages like references for the
225  // temperature. Intended for use in a loop, i.e. print the
226  // messages for the 1st spw but do not repeat them for the others.
227  // Returns whether or not it was successful.
230  const casacore::Double angdiam,
232  const casacore::Bool report=true);
233 
234  // Find the row in mjd closest to time_p, and the rows just before and after
235  // it, taking boundaries into account.
238 
239  // Put a quadratic, linear, or nearest neighbor interpolation of colname into
240  // val. Returns whether or not it did it.
241  // verbose: Send a message to the logger if nearest neighbor is used.
243  const casacore::Table& tab, const casacore::uInt rowbef,
244  const casacore::uInt rowclosest, const casacore::uInt rowaft,
245  const casacore::Double f, const casacore::Double dt,
246  const casacore::Double tp1mt0, const casacore::Double t0mtm1,
247  const casacore::Bool verbose=true);
248 
249  // casacore::Data members which are initialized in the c'tor's initialization list:
254  // casacore::MFrequency freq_p;
255  // casacore::Bool hasFreq_p;
257  casacore::Unit hertz_p; // make it static and/or const?
261 
262  // These are also initialized by the c'tor, but not in the initialization
263  // list:
266 
267  // casacore::Data members that are not initialized by the c'tor:
269  casacore::Double mean_rad_p; // in AU (really!)
270  casacore::Double r_p; // heliocentric distance in AU
271  casacore::Double delta_p; // geocentric distance in AU
272  casacore::Double phang_p; // Phase angle in radians.
274  casacore::Double illu_p; // Illumination, as a fraction.
275  casacore::Double ra_p; // RA, in deg.
276  casacore::Double dec_p; // Declination, in deg.
277 };
278 
279 
280 } //# NAMESPACE CASA - END
281 
282 #endif
A Measure: astronomical direction.
Definition: MDirection.h:174
A 1-D Specialization of the Array class.
ComponentType::Shape compute(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, casacore::Double &angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs, const casacore::Bool report=true)
Compute the flux densities, their uncertainties, and the angular diameter of the calibration source f...
Main interface class to a read/write table.
Definition: Table.h:153
Shape
The shapes of all the components.
casacore::Bool get_row_numbers(casacore::uInt &rowbef, casacore::uInt &rowclosest, casacore::uInt &rowaft, const casacore::ScalarColumn< casacore::Double > &mjd)
Find the row in mjd closest to time_p, and the rows just before and after it, taking boundaries into ...
void compute_venus(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs)
casacore::Bool compute_constant_temperature(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs, const casacore::Bool report=true)
Uses objnum_p to look up a mean temperature, and uses that.
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active and will not send events to later tools or event handlers if the latest tool was blocking In this way a single tool can be used to handle ALL user interaction via the GUI at one time
Definition: PlotTool.h:43
casacore::uInt n_known() const
returns the number of objects supported by this class.
Earth, // Too highly resolved.
TableExprNode mjd(const TableExprNode &node)
Definition: ExprNode.h:1464
void compute_neptune(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs)
casacore::Bool setObjNum()
Tries to set objnum_p to the KnownObject matching name_p.
A Measure: instant in time.
Definition: MEpoch.h:104
defines physical units
Definition: Unit.h:189
casacore::Bool getTime(casacore::MEpoch &output) const
casacore::MDirection getDirection()
casacore::Bool getFreq(casacore::MFrequency&amp; output) const;
void compute_pluto(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs)
ComponentType::Shape getShape(casacore::Double &angdiam)
Sets angdiam to the source&#39;s angular diameter in radians and returns the object&#39;s component type (i...
double Double
Definition: aipstype.h:55
FluxCalc_SS_JPL_Butler()
Default constructor; provided mainly so an array of these can be made more easily.
void compute_uranus(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs)
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
void compute_BB(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs)
Compute the flux densities assuming a uniform disk blackbody, and their uncertainties.
casacore::Double temperature_p
casacore::Data members that are not initialized by the c&#39;tor:
void setTime(const casacore::MEpoch &time)
void compute_jupiter(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs)
Saturn, // Modeling the rings is too complicated.
casacore::Bool getName(casacore::String &output) const
void setFreq(const casacore::MFrequency&amp; freq);
static casacore::Bool get_interpolated_value(casacore::Double &val, const casacore::String &colname, const casacore::Table &tab, const casacore::uInt rowbef, const casacore::uInt rowclosest, const casacore::uInt rowaft, const casacore::Double f, const casacore::Double dt, const casacore::Double tp1mt0, const casacore::Double t0mtm1, const casacore::Bool verbose=true)
Put a quadratic, linear, or nearest neighbor interpolation of colname into val.
casacore::Bool readEphem()
Reads a JPL-Horizons ephemeris table to get temperature_p, r_p (heliocentric distance), delta_p (geocentric distance), and phang_p (phase angle).
casacore::String name_p
casacore::Data members which are initialized in the c&#39;tor&#39;s initialization list:
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void compute_GB(casacore::Vector< Flux< casacore::Double > > &values, casacore::Vector< Flux< casacore::Double > > &errors, const casacore::Double angdiam, const casacore::Vector< casacore::MFrequency > &mfreqs, const casacore::Vector< casacore::Double > &temps)
Like compute_BB(), except it uses a graybody model where each frequency has a corresponding temperatu...
casacore::Bool hasEphemInfo_p
casacore::MFrequency freq_p; casacore::Bool hasFreq_p;
casacore::Double getHeliocentricDist()
Returns the distance from the object to the Sun in AU, or -1 if unknown.
FluxCalc_SS_JPL_Butler::KnownObjects objnum_p
These are also initialized by the c&#39;tor, but not in the initialization list:
casacore::Bool setObj(const casacore::String &objname)
Chooses an object, and returns whether was successful.
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