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 #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,
00036 Equinoctal
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
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
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
00070 inline bool operator < (const PreliminaryOrbit &orbit) const {
00071 return (rms < orbit.rms);
00072 }
00073
00074 private:
00075 double rms;
00076 };
00077
00078
00079 double MOID(const Orbit&, const Orbit&, Vector&, Vector&);
00080
00081
00082 double MOID2RB(const Vector&, const Vector&, const Orbit&, const Orbit&, Vector&, Vector&);
00083
00084
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
00112
00113 class CloseApproach {
00114 public:
00115 std::string name;
00116 UniverseTypeAwareTime epoch;
00117 double distance;
00118 double relative_velocity;
00119
00120 double tp_xy, tp_z;
00121 };
00122
00123
00124
00125
00126
00127
00128
00129 void SearchCloseApproaches(const Evolution *, const unsigned int, const unsigned int, std::vector<CloseApproach> &, const double, const double = FromUnits(1,SECOND));
00130
00131
00132 void OrbitDifferentialCorrectionsLeastSquares(OrbitWithCovarianceMatrixGSL&, const std::vector<Observation>&);
00133
00134 }
00135
00136 #endif // _ORSA_ORBIT_GSL_H_