orsa_orbit_gsl.h

Go to the documentation of this file.
00001 /* 
00002    ORSA - Orbit Reconstruction, Simulation and Analysis
00003    Copyright (C) 2002-2004 Pasquale Tricarico
00004    
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public License
00007    as published by the Free Software Foundation; either version 2
00008    of the License, or (at your option) any later version.
00009    
00010    As a special exception, Pasquale Tricarico gives permission to
00011    link this program with Qt commercial edition, and distribute the
00012    resulting executable, without including the source code for the Qt
00013    commercial edition in the source distribution.
00014    
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019    
00020    You should have received a copy of the GNU General Public License
00021    along with this program; if not, write to the Free Software
00022    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 */
00024 
00025 #ifndef _ORSA_ORBIT_GSL_H_
00026 #define _ORSA_ORBIT_GSL_H_
00027 
00028 #include <string>
00029 
00030 #include "orsa_orbit.h"
00031 #include "orsa_universe.h"
00032 
00033 namespace orsa {
00034   
00035   enum CovarianceMatrixElements { Osculating, // a,e,i,node,peri,M
00036                                   Equinoctal  // a,k,h,q,p,lambda
00037   };
00038   
00039   class OrbitWithCovarianceMatrixGSL : public OrbitWithEpoch {
00040   public:
00041     OrbitWithCovarianceMatrixGSL();
00042     OrbitWithCovarianceMatrixGSL(Orbit&);
00043     OrbitWithCovarianceMatrixGSL(Orbit&,double**,CovarianceMatrixElements);
00044   public:
00045     void SetCovarianceMatrix(double**,CovarianceMatrixElements);
00046     void GetCovarianceMatrix(double**,CovarianceMatrixElements&) const;
00047   private:
00048     double covm[6][6];
00049     CovarianceMatrixElements cov_base;
00050   public:
00051     // void generate(std::vector<OrbitWithEpoch>&,const int, const int=12345) const;
00052     void GenerateUsingCholeskyDecomposition(std::vector<OrbitWithEpoch>&,const int, const int=12345) const;
00053     void GenerateUsingPrincipalAxisTransformation(std::vector<OrbitWithEpoch>&,const int, const int=12345) const;
00054   public:
00055     bool have_covariance_matrix() const { return bool_have_covariance_matrix; }
00056   private:
00057     bool bool_have_covariance_matrix;
00058   };
00059   
00060   // class PreliminaryOrbit : public OrbitWithEpoch {
00061   class PreliminaryOrbit : public OrbitWithCovarianceMatrixGSL {
00062   public:
00063     double GetRMS() const { return rms; };
00064     
00065   public:       
00066     void ComputeRMS(const std::vector<Observation>&);
00067     
00068   public:
00069     // used to sort 
00070     inline bool operator < (const PreliminaryOrbit &orbit) const {
00071       return (rms < orbit.rms);
00072     }
00073     
00074   private:
00075     double rms;
00076   };
00077   
00078   //! Minimal Orbit Intersection Distance between two orbits
00079   double MOID(const Orbit&, const Orbit&, Vector&, Vector&);
00080   
00081   //! Minimal Orbit Intersection Distance between two orbits with different reference bodies  
00082   double MOID2RB(const Vector&, const Vector&, const Orbit&, const Orbit&, Vector&, Vector&);
00083   
00084   //! General interface to the Orbit computation from a set of observations.
00085   OrbitWithCovarianceMatrixGSL Compute(const std::vector<Observation> &);
00086   
00087   void Compute_Gauss(const std::vector<Observation>&, std::vector<PreliminaryOrbit>&);
00088   void Compute_TestMethod(const std::vector<Observation>&, std::vector<PreliminaryOrbit>&);
00089   
00090   //
00091   
00092   class Asteroid {
00093   public:
00094     int n;    
00095     OrbitWithCovarianceMatrixGSL orb;
00096     std::string name;
00097     double mag;
00098   };
00099   
00100   class AsteroidDatabase : public std::vector<Asteroid> {
00101     
00102   };
00103   
00104   class ObservationCandidate { 
00105   public:
00106     Asteroid        a;
00107     Observation     o;
00108     Angle           delta;
00109   };
00110   
00111   // Close Approaches
00112   
00113   class CloseApproach {
00114   public:
00115     std::string name;
00116     UniverseTypeAwareTime epoch;
00117     double distance;
00118     double relative_velocity;
00119     // target plane xy and z components
00120     double tp_xy, tp_z;
00121   };
00122   
00123   // void ComputeCloseApproaches(const Frame &, const unsigned int, const UniverseTypeAwareTime &, const UniverseTypeAwareTime &, std::vector<CloseApproach> &, const double, const double);
00124   // OLD!
00125   // void ComputeCloseApproaches(const Frame &, const unsigned int, const UniverseTypeAwareTime &, const UniverseTypeAwareTime &, std::vector<CloseApproach> &, const double, const UniverseTypeAwareTimeStep &);
00126   
00127   // void SearchCloseApproaches(const Evolution *, const unsigned int, std::vector<CloseApproach> &, const double, const bool only_planets=true);
00128   
00129   void SearchCloseApproaches(const Evolution *, const unsigned int, const unsigned int, std::vector<CloseApproach> &, const double, const double = FromUnits(1,SECOND));
00130   
00131   // test
00132   void OrbitDifferentialCorrectionsLeastSquares(OrbitWithCovarianceMatrixGSL&, const std::vector<Observation>&);
00133   
00134 }
00135 
00136 #endif // _ORSA_ORBIT_GSL_H_

Generated on Fri Nov 3 20:37:42 2006 for liborsa by  doxygen 1.4.7