Commit 6969ff1e authored by Alexander Lapshin's avatar Alexander Lapshin

.

parent 636205b8
#ifndef ORBITID_H #ifndef ORBITID_H
#define ORBITID_H #define ORBITID_H
#include <string>
typedef std::string TOrbitId; typedef std::string TOrbitId;
#endif #endif
...@@ -66,27 +66,21 @@ void XInterpolator::propagate_dir(const SInitOrbit& orbit, const TimeJD& beg, co ...@@ -66,27 +66,21 @@ void XInterpolator::propagate_dir(const SInitOrbit& orbit, const TimeJD& beg, co
Propagator prop(orbit, false); Propagator prop(orbit, false);
int step = get_step(orbit); int step = get_step(orbit);
//std::string s_beg = DateToStr(beg);
//std::string s_end = DateToStr(end);
bool exit = false; bool exit = false;
TimeJD date = beg; TimeJD date = beg;
while (!exit) { while (!exit) {
//std::string s_date = DateToStr(date);
if (date >= end && dir == 1 || date <= end && dir == -1) { if (date >= end && dir == 1 || date <= end && dir == -1) {
date = end; date = end;
exit = true; exit = true;
} }
double age = DaysInterval(orbit.GetDate(), date);
PhasePoint6D pos; PhasePoint6D pos;
prop.Propagate(date, pos); prop.Propagate(date, pos);
result.push_back(IRes(pos.CoordsVel, date, step)); result.push_back(IRes(pos.CoordsVel, date, step, age, orbit.GetId()));
date = ShiftDate(date, dir * step); date = ShiftDate(date, dir * step);
//double age = DaysInterval(prop.GetInitOrbit().GetDate(), date);
//std::cout << age << "\n";
//int c=8;
} }
} }
...@@ -107,6 +101,7 @@ void XInterpolator::calc_positions(const SInitOrbit& orbit, const TimeJD& beg, c ...@@ -107,6 +101,7 @@ void XInterpolator::calc_positions(const SInitOrbit& orbit, const TimeJD& beg, c
{ {
int n = 100; int n = 100;
int step = get_step(orbit); int step = get_step(orbit);
TimeJD beg_ext = ShiftDate(beg, -n * step); TimeJD beg_ext = ShiftDate(beg, -n * step);
TimeJD end_ext = ShiftDate(end, +n * step); TimeJD end_ext = ShiftDate(end, +n * step);
......
...@@ -12,14 +12,14 @@ public: ...@@ -12,14 +12,14 @@ public:
XInterpolator(); XInterpolator();
XInterpolator(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end); XInterpolator(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end);
~XInterpolator(); ~XInterpolator();
void create(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end);
Vect6 get_pos(const TimeJD& date) const; Vect6 get_pos(const TimeJD& date) const;
int get_size() const { return m_positions.size(); } int get_size() const { return m_positions.size(); }
TimeJD get_beg() const { return m_beg; } TimeJD get_beg() const { return m_beg; }
TimeJD get_end() const { return m_end; } TimeJD get_end() const { return m_end; }
const SInitOrbit& get_orbit() const { return m_orbit; } const SInitOrbit& get_orbit() const { return m_orbit; }
private:
static void calc_positions(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end, std::vector<IRes>& result); static void calc_positions(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end, std::vector<IRes>& result);
private:
void create(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end);
static void propagate(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end, int dir, std::vector<IRes>& result); static void propagate(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end, int dir, std::vector<IRes>& result);
static void propagate_dir(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end, int dir, std::vector<IRes>& result); static void propagate_dir(const SInitOrbit& orbit, const TimeJD& beg, const TimeJD& end, int dir, std::vector<IRes>& result);
//void filter_addons(); //void filter_addons();
......
#include "ires.h" #include "ires.h"
IRes::IRes(Vect6 vec, const TimeJD& date, int step, bool addon) IRes::IRes(Vect6 vec, const TimeJD& date, int step, double age, TOrbitId orbitid, bool addon)
: :
m_vec(vec), m_vec(vec),
m_date(date), m_date(date),
m_step(step), m_step(step),
m_age(age),
m_orbitid(orbitid),
m_addon(addon) m_addon(addon)
{ {
} }
...@@ -2,18 +2,21 @@ ...@@ -2,18 +2,21 @@
#include "DVectors.h" #include "DVectors.h"
#include "TM.h" #include "TM.h"
#include "OrbitId.h"
class IRes { class IRes {
public: public:
IRes() {}; IRes() {};
IRes(Vect6 vec, const TimeJD& date, int step, bool addon = false); IRes(Vect6 vec, const TimeJD& date, int step, double age, TOrbitId orbitid, bool addon = false);
TimeJD get_date() const { return m_date; } TimeJD get_date() const { return m_date; }
Vect6 get_pos() const { return m_vec; } Vect6 get_pos() const { return m_vec; }
int get_step() const { return m_step; } int get_step() const { return m_step; }
bool is_addon() const { return m_addon; } bool is_addon() const { return m_addon; }
private: private:
TOrbitId m_orbitid;
Vect6 m_vec; Vect6 m_vec;
TimeJD m_date; TimeJD m_date;
int m_step; int m_step;
double m_age;
bool m_addon; bool m_addon;
}; };
...@@ -43,14 +43,6 @@ SInitOrbits OrbBlocksStore::filter(SInitOrbits orbits) const ...@@ -43,14 +43,6 @@ SInitOrbits OrbBlocksStore::filter(SInitOrbits orbits) const
TimeJD orb1beg = ShiftDate(orb1.GetDate(), -orb1.GetInterval() * 86400); TimeJD orb1beg = ShiftDate(orb1.GetDate(), -orb1.GetInterval() * 86400);
const TimeJD& orb1end = orb1.GetDate(); const TimeJD& orb1end = orb1.GetDate();
//std::string orb1beg_s = DateToStr(orb1beg);
//std::string orb1end_s = DateToStr(orb1end);
/*if (i == orbits.size() - 1){
//result.push_back(orb1);
break;
}*/
bool found = false; bool found = false;
for (int j = i + 1; j < (int)orbits.size(); j++) { for (int j = i + 1; j < (int)orbits.size(); j++) {
const SInitOrbit& orb2 = orbits[j]; const SInitOrbit& orb2 = orbits[j];
...@@ -58,9 +50,6 @@ SInitOrbits OrbBlocksStore::filter(SInitOrbits orbits) const ...@@ -58,9 +50,6 @@ SInitOrbits OrbBlocksStore::filter(SInitOrbits orbits) const
TimeJD orb2beg = ShiftDate(orb2.GetDate(), -orb2.GetInterval() * 86400); TimeJD orb2beg = ShiftDate(orb2.GetDate(), -orb2.GetInterval() * 86400);
const TimeJD& orb2end = orb2.GetDate(); const TimeJD& orb2end = orb2.GetDate();
//std::string orb2beg_s = DateToStr(orb2beg);
//std::string orb2end_s = DateToStr(orb2end);
bool eq1 = fabs(DaysInterval(orb1beg, orb2beg) * 86400 * 1000) < 1; bool eq1 = fabs(DaysInterval(orb1beg, orb2beg) * 86400 * 1000) < 1;
bool eq2 = fabs(DaysInterval(orb1end, orb2end) * 86400 * 1000) < 1; bool eq2 = fabs(DaysInterval(orb1end, orb2end) * 86400 * 1000) < 1;
...@@ -99,9 +88,6 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg, ...@@ -99,9 +88,6 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
TimeJD left = beg; TimeJD left = beg;
bool stop = false; bool stop = false;
// std::string beg_s = DateToStr(beg);
// std::string end_s = DateToStr(end);
for (int i = 0; i < (int)orbits.size() && !stop; i++) { for (int i = 0; i < (int)orbits.size() && !stop; i++) {
const SInitOrbit& orb1 = orbits[i]; const SInitOrbit& orb1 = orbits[i];
...@@ -114,10 +100,6 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg, ...@@ -114,10 +100,6 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
break; break;
} }
//std::string orb1beg_s = DateToStr(orb1beg);
//std::string orb1end_s = DateToStr(orb1end);
//std::string left_s = DateToStr(left);
if (orb1end < left) { if (orb1end < left) {
continue; continue;
} }
...@@ -126,9 +108,6 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg, ...@@ -126,9 +108,6 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
TimeJD orb2beg = ShiftDate(orb2.GetDate(), -orb2.GetInterval() * 86400); TimeJD orb2beg = ShiftDate(orb2.GetDate(), -orb2.GetInterval() * 86400);
//std::string orb2beg_s = DateToStr(orb2beg);
//std::string orb2end_s = DateToStr(orb2end);
if (orb1end < orb2beg) { if (orb1end < orb2beg) {
//no intersection //no intersection
if (orb2beg < left) { if (orb2beg < left) {
...@@ -139,7 +118,7 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg, ...@@ -139,7 +118,7 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
TimeJD right; TimeJD right;
double minDist; double minDist;
calc_min_dist(orb1, orb2, orb1end, orb2beg, right, minDist); calc_min_dist(orb1, orb2, orb1end, orb2beg, right, minDist);
//std::string minjd_s = DateToStr(right);
if (right > end) { if (right > end) {
right = end; right = end;
stop = true; stop = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment