trafos.h
Go to the documentation of this file.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
00030
00031
00032
00033 #ifndef PLANCK_TRAFOS_H
00034 #define PLANCK_TRAFOS_H
00035
00036 #include "vec3.h"
00037 #include "pointing.h"
00038 #include "rotmatrix.h"
00039 #include "cxxutils.h"
00040 #include "geom_utils.h"
00041
00042 typedef enum { Ecliptic, Equatorial, Galactic } coordsys;
00043
00044
00045 class Trafo
00046 {
00047 private:
00048 rotmatrix mat;
00049
00050 static vec3 xcc_dp_precess (const vec3 &iv, double iepoch, double oepoch);
00051 static double get_epsilon (double epoch);
00052 static vec3 xcc_dp_e_to_q (const vec3 &iv, double epoch);
00053 static vec3 xcc_dp_q_to_e (const vec3 &iv, double epoch);
00054 static vec3 xcc_dp_g_to_e (const vec3 &iv, double epoch);
00055 static vec3 xcc_dp_e_to_g (const vec3 &iv, double epoch);
00056 static vec3 xcc_v_convert(const vec3 &iv, double iepoch, double oepoch,
00057 coordsys isys,coordsys osys);
00058 static void coordsys2matrix (double iepoch, double oepoch, coordsys isys,
00059 coordsys osys, rotmatrix &matrix);
00060
00061 public:
00062
00063
00064 Trafo (double iepoch, double oepoch, coordsys isys, coordsys osys)
00065 { coordsys2matrix (iepoch, oepoch, isys, osys, mat); }
00066
00067
00068 vec3 operator() (const vec3 &vec) const
00069 { return mat.Transform(vec); }
00070
00071
00072 pointing operator() (const pointing &ptg) const
00073 { return pointing(operator()(vec3(ptg))); }
00074
00075
00076
00077 void rotatefull (const pointing &ptg, pointing &newptg,
00078 double &delta_psi) const
00079 {
00080 vec3 vec (ptg);
00081 vec3 east (-vec.y,vec.x,0.);
00082 vec3 newvec = operator()(vec);
00083 vec3 neweast = operator()(east);
00084 delta_psi = orientation(newvec,neweast)+halfpi;
00085 newptg = newvec;
00086 }
00087
00088
00089
00090 void rotatefull (const vec3 &vec, vec3 &newvec, double &delta_psi) const
00091 {
00092 vec3 east (-vec.y,vec.x,0.);
00093 newvec = operator()(vec);
00094 vec3 neweast = operator()(east);
00095 delta_psi = orientation(newvec,neweast)+halfpi;
00096 }
00097
00098
00099 const rotmatrix &Matrix() const
00100 { return mat; }
00101 };
00102
00103 #endif