trafos.h

Go to the documentation of this file.
00001 /*
00002  *  This file is part of libcxxsupport.
00003  *
00004  *  libcxxsupport is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  libcxxsupport is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with libcxxsupport; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017  */
00018 
00019 /*
00020  *  libcxxsupport is being developed at the Max-Planck-Institut fuer Astrophysik
00021  *  and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
00022  *  (DLR).
00023  */
00024 
00025 /*! \file trafos.h
00026  *  Celestial coordinate transformations.
00027  *
00028  *  Copyright (C) 2005-2011 Max-Planck-Society
00029  * \author Martin Reinecke
00030  */
00031 #ifndef PLANCK_TRAFOS_H
00032 #define PLANCK_TRAFOS_H
00033 
00034 #include "vec3.h"
00035 #include "pointing.h"
00036 #include "rotmatrix.h"
00037 
00038 enum coordsys { Ecliptic, Equatorial, Galactic };
00039 
00040 /*! Class for celestial coordinate transformations. */
00041 class Trafo
00042   {
00043   private:
00044     rotmatrix mat;
00045 
00046     static vec3 xcc_dp_precess (const vec3 &iv, double iepoch, double oepoch);
00047     static double get_epsilon (double epoch);
00048     static vec3 xcc_dp_e_to_q (const vec3 &iv, double epoch);
00049     static vec3 xcc_dp_q_to_e (const vec3 &iv, double epoch);
00050     static vec3 xcc_dp_g_to_e (const vec3 &iv, double epoch);
00051     static vec3 xcc_dp_e_to_g (const vec3 &iv, double epoch);
00052     static vec3 xcc_v_convert(const vec3 &iv, double iepoch, double oepoch,
00053       coordsys isys,coordsys osys);
00054     static void coordsys2matrix (double iepoch, double oepoch, coordsys isys,
00055       coordsys osys, rotmatrix &matrix);
00056 
00057   public:
00058     /*! Creates a \a Trafo for transformation from \a iepoch and \a isys
00059         to \a oepoch and \a osys. */
00060     Trafo (double iepoch, double oepoch, coordsys isys, coordsys osys);
00061 
00062     /*! Transforms the vector \a vec and returns the result. */
00063     vec3 operator() (const vec3 &vec) const
00064       { return mat.Transform(vec); }
00065 
00066     /*! Transforms the pointing \a ptg and returns the result. */
00067     pointing operator() (const pointing &ptg) const;
00068 
00069     /*! Transforms the pointing \a ptg and returns it in \a newptg.
00070         On exit, \a delta_psi holds the change in orientation. */
00071     void rotatefull (const pointing &ptg, pointing &newptg,
00072       double &delta_psi) const;
00073 
00074     /*! Transforms the pointing \a ptg and adjusts \a psi accordingly. */
00075     void rotatefull (pointing &ptg, double &psi) const;
00076 
00077     /*! Transforms the vector \a vec and returns it in \a newvec.
00078         On exit, \a delta_psi holds the change in orientation. */
00079     void rotatefull (const vec3 &vec, vec3 &newvec, double &delta_psi) const;
00080 
00081     /*! Transforms the vector \a vec and adjusts \a psi accordingly. */
00082     void rotatefull (vec3 &vec, double &psi) const;
00083 
00084     /*! Returns the internally used rotation matrix. */
00085     const rotmatrix &Matrix() const
00086       { return mat; }
00087   };
00088 
00089 #endif

Generated on Thu Oct 8 14:48:51 2015 for LevelS C++ support library