casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Aberration.h
Go to the documentation of this file.
00001 //# Aberration.h: Aberration class
00002 //# Copyright (C) 1995,1996,1997,1998
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 addressed 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: Aberration.h 20739 2009-09-29 01:15:15Z Malte.Marquarding $
00028 
00029 #ifndef MEASURES_ABERRATION_H
00030 #define MEASURES_ABERRATION_H
00031 
00032 //# Includes
00033 #include <casa/aips.h>
00034 #include <casa/Quanta/MVPosition.h>
00035 
00036 
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 
00039 // <summary>
00040 // Aberration class and calculations
00041 // </summary>
00042 
00043 // <use visibility=export>
00044 
00045 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasMath" demos="">
00046 // </reviewed>
00047 
00048 // <prerequisite>
00049 //   <li> <linkto class=Measure>Measure</linkto> class, 
00050 //              especially <linkto class=MEpoch>MEpoch</linkto>
00051 //   <li> <linkto class=MeasData>MeasData</linkto> class for constants
00052 // </prerequisite>
00053 //
00054 // <etymology>
00055 // Aberration
00056 // </etymology>
00057 //
00058 // <synopsis>
00059 // Aberration forms the class for Aberration calculations. It is a simple
00060 // container with the selected method, and the mean epoch.<br>
00061 // The method is selected from one of the following:
00062 // <ul>
00063 //   <li> Aberration::STANDARD   (at 1995/09/04 the IAU1980 definition)
00064 //   <li> Aberration::NONE
00065 //   <li> Aberration::B1950
00066 // </ul>
00067 // Epochs can be specified as the MJD (with defined constants MeasData::MJD2000
00068 // and MeasData::MJDB1950 or the actual MJD),
00069 // leading to the following constructors:
00070 // <ul>
00071 //   <li> Aberration() default; assuming JD2000, IAU1980
00072 //   <li> Aberration(method) assuming the correct default epoch of
00073 //              JD2000 or B1950
00074 //   <li> Aberration(method,epoch) with epoch Double(MJD).
00075 // </ul>
00076 // Actual Aberration for a certain Epoch is calculated by the () operator
00077 // as Aberration(epoch), with epoch Double MJD, values returned as an
00078 // MVPosition.<br>
00079 // The derivative (d<sup>-1</sup>) can be obtained as well by
00080 // derivative(epoch).<br>
00081 // The following details can be set with the 
00082 // <linkto class=Aipsrc>Aipsrc</linkto> mechanism:
00083 // <ul>
00084 //  <li> measures.aberration.d_interval: approximation interval as time 
00085 //      (fraction of days is default unit) over which linear approximation
00086 //      is used
00087 //  <li> measures.aberration.b_usejpl: use the JPL database values for IAU1980.
00088 //      Else analytical expression, relative error about 10<sup>-9</sup>
00089 //      Note that the JPL database to be used can be set with 
00090 //              measures.jpl.ephemeris (at the moment of writing DE200 (default),
00091 //              or DE405). If using the JPL database, the d_interval (and the
00092 //              output of derivative()) are irrelevant.
00093 // </ul>
00094 // </synopsis>
00095 //
00096 // <example>
00097 // </example>
00098 //
00099 // <motivation>
00100 // To calculate the Aberration angles. An alternate route could have been
00101 // a global function, but having a simple container allows
00102 // caching of some calculations for speed.<br>
00103 // Using MJD (JD-2400000.5) rather than JD is for precision reasons.
00104 // </motivation>
00105 //
00106 // <todo asof="1997/12/02">
00107 // </todo>
00108 
00109 class Aberration
00110 {
00111 public:
00112 //# Constants
00113 // Interval to be used for linear approximation (in days)
00114     static const Double INTV;
00115 
00116 //# Enumerations
00117 // Types of known Aberration calculations (at 1995/09/04 STANDARD == IAU1980)
00118     enum AberrationTypes {STANDARD,NONE,B1950};
00119 
00120 //# Constructors
00121 // Default constructor, generates default J2000 Aberration identification
00122     Aberration();
00123 // Copy constructor
00124     Aberration(const Aberration &other);
00125 // Constructor with type
00126     Aberration(AberrationTypes type);
00127 // Copy assignment
00128     Aberration &operator=(const Aberration &other);
00129 
00130 //# Destructor
00131     ~Aberration();
00132 
00133 //# Operators
00134 // Operator () calculates the Aberration direction cosine vector
00135     const MVPosition &operator()(Double epoch);
00136 
00137 //# General Member Functions
00138 // Return derivative of Aberration (d<sup>-1</sup>) w.r.t. time
00139     const MVPosition &derivative (Double epoch);
00140 
00141 // Re-initialise Aberration object
00142 // <group>
00143     void init();
00144     void init(AberrationTypes type);
00145 // </group>
00146 
00147 // Refresh calculations
00148     void refresh();
00149 
00150 private:
00151 //# Data menbers
00152 // Method to be used
00153     AberrationTypes method;
00154 // Check epoch for linear approximation
00155     Double checkEpoch;
00156 // Cached calculated angles
00157     Double aval[3];
00158 // Cached derivatives
00159     Double dval[3];
00160 // To be able to use referenced results in simple calculations, a circular
00161 // result buffer is used.
00162 // Current buffer pointer.
00163     Int lres;
00164 // Last calculation
00165     MVPosition result[4];
00166 // Interpolation interval
00167     static uInt interval_reg;
00168 // JPL use
00169     static uInt usejpl_reg;
00170 
00171 //# Member functions
00172 // Copy
00173     void copy(const Aberration &other);
00174 // Fill an empty copy
00175     void fill();
00176 // Calculate Aberration angles for time t
00177     void calcAber(Double t);
00178 };
00179 
00180 
00181 } //# NAMESPACE CASA - END
00182 
00183 #endif
00184 
00185