00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef MEASURES_MEASMATH_H
00030 #define MEASURES_MEASMATH_H
00031
00032
00033 #include <casacore/casa/aips.h>
00034 #include <casacore/casa/Quanta/Euler.h>
00035 #include <casacore/casa/Quanta/RotMatrix.h>
00036 #include <casacore/casa/Quanta/MVPosition.h>
00037 #include <casacore/casa/Quanta/MVDirection.h>
00038 #include <casacore/measures/Measures/MeasFrame.h>
00039
00040 namespace casacore {
00041
00042
00043 class Measure;
00044 class MRBase;
00045 class Precession;
00046 class Nutation;
00047 class SolarPos;
00048 class Aberration;
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 class MeasMath {
00097
00098 public:
00099
00100
00101
00102 MeasMath();
00103
00104
00105 ~MeasMath();
00106
00107
00108
00109
00110
00111 void initFrame(MRBase &outref, MRBase &inref);
00112
00113
00114
00115
00116
00117
00118 void createPrecession();
00119 void applyPrecession(MVPosition &in);
00120 void deapplyPrecession(MVPosition &in);
00121
00122
00123
00124 void createPrecessionB1950();
00125 void applyPrecessionB1950(MVPosition &in);
00126 void deapplyPrecessionB1950(MVPosition &in);
00127
00128
00129
00130 void createNutation();
00131 void applyNutation(MVPosition &in);
00132 void deapplyNutation(MVPosition &in);
00133
00134
00135
00136 void createNutationB1950();
00137 void applyNutationB1950(MVPosition &in);
00138 void deapplyNutationB1950(MVPosition &in);
00139
00140
00141
00142 void createPrecNutat();
00143 void applyPrecNutat(MVPosition &in);
00144 void deapplyPrecNutat(MVPosition &in);
00145 void createPrecNutatB1950();
00146 void applyPrecNutatB1950(MVPosition &in, Bool doin=True);
00147 void deapplyPrecNutatB1950(MVPosition &in, Bool doin=True);
00148
00149
00150
00151 void createAberration();
00152 void applyAberration(MVPosition &in, Bool doin=True);
00153 void deapplyAberration(MVPosition &in, Bool doin=True);
00154 void createAberrationB1950();
00155 void applyAberrationB1950(MVPosition &in, Bool doin=True);
00156 void deapplyAberrationB1950(MVPosition &in, Bool doin=True);
00157
00158
00159
00160
00161 void createSolarPos();
00162 void applySolarPos(MVPosition &in, Bool doin=True);
00163 void deapplySolarPos(MVPosition &in, Bool doin=True);
00164
00165
00166
00167 void applyHADECtoITRF(MVPosition &in);
00168 void deapplyHADECtoITRF(MVPosition &in);
00169 void applyHADECtoAZEL(MVPosition &in);
00170 void deapplyHADECtoAZEL(MVPosition &in);
00171 void applyHADECtoAZELGEO(MVPosition &in);
00172 void deapplyHADECtoAZELGEO(MVPosition &in);
00173 void applyJ2000toB1950(MVPosition &in, Double epo, Bool doin);
00174 void deapplyJ2000toB1950(MVPosition &in, Double epo, Bool doin);
00175 void applyJ2000toB1950(MVPosition &in, Bool doin=True);
00176 void deapplyJ2000toB1950(MVPosition &in, Bool doin=True);
00177 void applyJ2000toB1950_VLA(MVPosition &in, Bool doin=True);
00178 void deapplyJ2000toB1950_VLA(MVPosition &in, Bool doin=True);
00179 void applyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0);
00180 void deapplyETerms(MVPosition &in, Bool doin=True, Double epo=2000.0);
00181 void applyGALtoJ2000(MVPosition &in);
00182 void deapplyGALtoJ2000(MVPosition &in);
00183 void applyGALtoB1950(MVPosition &in);
00184 void deapplyGALtoB1950(MVPosition &in);
00185 void applyGALtoSUPERGAL(MVPosition &in);
00186 void deapplyGALtoSUPERGAL(MVPosition &in);
00187 void applyICRStoJ2000(MVPosition &in);
00188 void deapplyICRStoJ2000(MVPosition &in);
00189 void applyTOPOtoHADEC(MVPosition &in, Bool doin=True);
00190 void deapplyTOPOtoHADEC(MVPosition &in, Bool doin=True);
00191 void applyPolarMotion(MVPosition &in);
00192 void deapplyPolarMotion(MVPosition &in);
00193 void applyAZELtoAZELSW(MVPosition &in);
00194 void applyECLIPtoJ2000(MVPosition &in);
00195 void deapplyECLIPtoJ2000(MVPosition &in);
00196 void applyMECLIPtoJMEAN(MVPosition &in);
00197 void deapplyMECLIPtoJMEAN(MVPosition &in);
00198 void applyTECLIPtoJTRUE(MVPosition &in);
00199 void deapplyTECLIPtoJTRUE(MVPosition &in);
00200 void applyAPPtoTOPO(MVPosition &in, const Double len,
00201 Bool doin=True);
00202 void deapplyAPPtoTOPO(MVPosition &in, const Double len,
00203 Bool doin=True);
00204
00205
00206
00207
00208
00209 void getAPP(MVPosition &out);
00210 void getJ2000(MVPosition &out);
00211 void getB1950(MVPosition &out);
00212
00213
00214 private:
00215
00216
00217 enum FrameType {
00218 EPOCH = 0,
00219 POSITION,
00220 DIRECTION,
00221 VELOCITY,
00222 N_FrameType };
00223
00224 enum FrameInfo {
00225 TDB = 0,
00226 LASTR,
00227 TT,
00228 UT1,
00229 LONG,
00230 LAT,
00231 RADIUS,
00232 LATGEO,
00233 J2000LONG,
00234 J2000LAT,
00235 B1950LONG,
00236 B1950LAT,
00237 APPLONG,
00238 APPLAT,
00239 N_FrameDInfo,
00240 J2000DIR = N_FrameDInfo,
00241 B1950DIR,
00242 APPDIR,
00243 N_FrameInfo,
00244 N_FrameMVDInfo = N_FrameInfo-J2000DIR };
00245
00246
00247
00248 typedef const Measure* (MeasFrame::*FRFCT)() const;
00249
00250
00251 typedef Bool (MeasFrame::*FRDINFO)(Double &) const;
00252 typedef Bool (MeasFrame::*FRMVDINFO)(MVDirection &) const;
00253
00254
00255
00256
00257
00258
00259
00260 Bool inOK_p;
00261 Bool outOK_p;
00262 Bool frameOK_p[N_FrameType];
00263 MeasFrame *inFrame_p;
00264 MeasFrame *outFrame_p;
00265 MeasFrame *applyFrame_p[N_FrameType];
00266 MeasFrame *deapplyFrame_p[N_FrameType];
00267
00268
00269
00270 SolarPos *SOLPOSIAU;
00271 Aberration *ABERIAU, *ABERB1950;
00272 Nutation *NUTATIAU, *NUTATB1950;
00273 Precession *PRECESIAU, *PRECESB1950;
00274
00275
00276
00277 RotMatrix ROTMAT1;
00278 MVPosition MVPOS1, MVPOS2, MVPOS3, MVPOS4;
00279 Double g1, g2, g3, lengthE;
00280 Bool infoOK_p[N_FrameInfo];
00281 Double info_p[N_FrameDInfo];
00282 MVDirection infomvd_p[N_FrameMVDInfo];
00283
00284
00285 static uInt b1950_reg_p;
00286
00287
00288
00289
00290
00291 MeasMath(const MeasMath &other);
00292
00293 MeasMath &operator=(const MeasMath &other);
00294
00295
00296
00297 void getFrame(FrameType i);
00298
00299
00300
00301
00302
00303
00304
00305 Bool getInfo(FrameInfo i, Bool ret=False);
00306
00307
00308
00309
00310
00311
00312 void rotateShift(MVPosition &in, const MVPosition &shft,
00313 const FrameInfo lng, const FrameInfo lat,
00314 Bool doin);
00315 };
00316
00317
00318 }
00319
00320 #endif