Commit a96e1ee9 authored by Alexander Lapshin's avatar Alexander Lapshin

.

parent afdd399e
...@@ -178,7 +178,7 @@ CAA2DCoordinate EquatorialAberration(double Alpha, double Delta, double JD) ...@@ -178,7 +178,7 @@ CAA2DCoordinate EquatorialAberration(double Alpha, double Delta, double JD)
OpticMeasurement::OpticMeasurement() : AFreeMeasurement() OpticMeasurement::OpticMeasurement() : AFreeMeasurement()
{ {
Type = mtOptic; Type = mtOptic;
IsCorrected = true; m_aberation_method = aberration_method::NONE;
m_isBad = false; m_isBad = false;
RecPosFrInit = false; RecPosFrInit = false;
VAlpha = 0; VAlpha = 0;
...@@ -410,15 +410,10 @@ void OpticMeasurement::AberrationCorrect(double alpha, double delta, TimeJD date ...@@ -410,15 +410,10 @@ void OpticMeasurement::AberrationCorrect(double alpha, double delta, TimeJD date
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Коррекция с учетом звездной аберрации // Коррекция с учетом звездной аберрации
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void OpticMeasurement::Correct(aberration_method ab) void OpticMeasurement::Correct(const aberration_method& ab)
{ {
if (IsCorrected || ab == aberration_method::NONE) {
return;
}
AberrationCorrect(Alpha, Delta, MTime, false, ab, Alpha, Delta); AberrationCorrect(Alpha, Delta, MTime, false, ab, Alpha, Delta);
m_aberation_method = ab;
IsCorrected = true;
} }
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
......
...@@ -80,18 +80,11 @@ public: ...@@ -80,18 +80,11 @@ public:
// bool SimulateEx(int matrixSize, ITraject &trj, TimeJD &t, Vect6 &f, double* v, double *del) const; // bool SimulateEx(int matrixSize, ITraject &trj, TimeJD &t, Vect6 &f, double* v, double *del) const;
virtual bool DetectPositionEx(ITraject& trj, TimeJD& t, Vect6& f) const { return false; }; virtual bool DetectPositionEx(ITraject& trj, TimeJD& t, Vect6& f) const { return false; };
// Установка флага коррекции аберрации
void SetCorrectFlag(bool f)
{
IsCorrected = f;
};
// Получение флага коррекции аберрации // Получение флага коррекции аберрации
bool GetCorrectFlag() const const aberration_method& get_aberation_method() const { return m_aberation_method; }
{
return IsCorrected;
};
// Коррекция с учетом звездной аберрации // Коррекция с учетом звездной аберрации
void Correct(aberration_method ab); void Correct(const aberration_method& ab);
// Получение координат станции в Гринвиче // Получение координат станции в Гринвиче
virtual const Vect3& GetStationCoord() const = 0; virtual const Vect3& GetStationCoord() const = 0;
...@@ -109,13 +102,12 @@ public: ...@@ -109,13 +102,12 @@ public:
static void AberrationCorrect(double alpha, double delta, TimeJD date, bool backwardCorrection, aberration_method ab, double& correctedAlpha, double& correctedDelta); static void AberrationCorrect(double alpha, double delta, TimeJD date, bool backwardCorrection, aberration_method ab, double& correctedAlpha, double& correctedDelta);
protected: protected:
// Флаг учета аберрации
bool IsCorrected;
Vect3 RecPosFr; Vect3 RecPosFr;
bool RecPosFrInit; bool RecPosFrInit;
bool m_isBad; bool m_isBad;
// Флаг учета аберрации
aberration_method m_aberation_method;
}; };
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
......
...@@ -8,7 +8,7 @@ PropInfoBase::PropInfoBase( ...@@ -8,7 +8,7 @@ PropInfoBase::PropInfoBase(
AtmModel atmModel, AtmModel atmModel,
const bool sun, const bool sun,
const bool moon, const bool moon,
const bool prec_itrf, const IntegratorCfg& icfg,
const int type) const int type)
: :
m_atmModel(std::move(atmModel)), m_atmModel(std::move(atmModel)),
...@@ -17,7 +17,7 @@ PropInfoBase::PropInfoBase( ...@@ -17,7 +17,7 @@ PropInfoBase::PropInfoBase(
m_sun(sun), m_sun(sun),
m_moon(moon), m_moon(moon),
m_type(type), m_type(type),
m_prec_itrf(prec_itrf) m_integrator_cfg(icfg)
{ {
} }
...@@ -44,9 +44,7 @@ bool PropInfoBase::Load(myXML::Contain* parent) ...@@ -44,9 +44,7 @@ bool PropInfoBase::Load(myXML::Contain* parent)
LoadXML(con, "EarthModel", m_earthModel); LoadXML(con, "EarthModel", m_earthModel);
LoadXML(con, "AtmModel", m_atmModel, false); LoadXML(con, "AtmModel", m_atmModel, false);
LoadXML(con, "Id", m_id, false, &idloaded); LoadXML(con, "Id", m_id, false, &idloaded);
m_integrator_cfg.Load(parent);
m_prec_itrf = false;
LoadXML(con, "prec_itrf", m_prec_itrf, false);
return true; return true;
} }
...@@ -70,8 +68,7 @@ void PropInfoBase::load(const jsonval& parent) ...@@ -70,8 +68,7 @@ void PropInfoBase::load(const jsonval& parent)
loadjson(parent, "earth", m_earthModel); loadjson(parent, "earth", m_earthModel);
loadjson(parent, "atm", m_atmModel, false); loadjson(parent, "atm", m_atmModel, false);
m_prec_itrf = false; m_integrator_cfg.load(parent);
loadjson(parent, "prec_itrf", m_prec_itrf, false);
} }
std::string PropInfoBase::GetAsXML() const std::string PropInfoBase::GetAsXML() const
...@@ -87,7 +84,10 @@ std::string PropInfoBase::GetAsXML() const ...@@ -87,7 +84,10 @@ std::string PropInfoBase::GetAsXML() const
PutValue(outs, "Sun", m_sun); PutValue(outs, "Sun", m_sun);
PutValue(outs, "Moon", m_moon); PutValue(outs, "Moon", m_moon);
PutValue(outs, "LightModel", m_lightModel); PutValue(outs, "LightModel", m_lightModel);
PutValue(outs, "prec_itrf", m_prec_itrf); PutValue(outs, "integratorEps", get_integrator_cfg().getEps());
PutValue(outs, "integratorStepInit", get_integrator_cfg().getStepInit());
PutValue(outs, "integratorStepMin", get_integrator_cfg().getStepMin());
PutValue(outs, "prec_itrf", get_integrator_cfg().getPrecItfr());
outs << "<EarthModel>"; outs << "<EarthModel>";
PutValue(outs, "Model", m_earthModel.GetModel()); PutValue(outs, "Model", m_earthModel.GetModel());
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "AtmModel.h" #include "AtmModel.h"
#include "EarthModel.h" #include "EarthModel.h"
#include "json_functions.h" #include "json_functions.h"
#include "integratorcfg.h"
enum proptypes enum proptypes
{ {
...@@ -27,7 +28,7 @@ public: ...@@ -27,7 +28,7 @@ public:
AtmModel atmModel, AtmModel atmModel,
const bool sun, const bool sun,
const bool moon, const bool moon,
const bool prec_itrf, const IntegratorCfg& icfg,
const int type); const int type);
bool Load(myXML::Contain* parent); bool Load(myXML::Contain* parent);
...@@ -35,12 +36,13 @@ public: ...@@ -35,12 +36,13 @@ public:
bool IsSun() const { return m_sun; } bool IsSun() const { return m_sun; }
bool IsMoon() const { return m_moon; } bool IsMoon() const { return m_moon; }
int GetType() const { return m_type; } int GetType() const { return m_type; }
bool is_prec_itrf() const { return m_prec_itrf; } //bool is_prec_itrf() const { return m_prec_itrf; }
const AtmModel& GetAtmModel() const { return m_atmModel; } const AtmModel& GetAtmModel() const { return m_atmModel; }
const EarthModel& GetEarthModel() const { return m_earthModel; } const EarthModel& GetEarthModel() const { return m_earthModel; }
std::string GetLightModel() const { return m_lightModel; } std::string GetLightModel() const { return m_lightModel; }
std::string GetAsXML() const; std::string GetAsXML() const;
void ToXml(std::ostream& outs) const; void ToXml(std::ostream& outs) const;
const IntegratorCfg& get_integrator_cfg() const { return m_integrator_cfg; }
private: private:
static std::string TypeConvert(int value) ; static std::string TypeConvert(int value) ;
...@@ -53,7 +55,7 @@ private: ...@@ -53,7 +55,7 @@ private:
bool m_moon; bool m_moon;
int m_type; int m_type;
int m_id; int m_id;
bool m_prec_itrf {false}; IntegratorCfg m_integrator_cfg;
}; };
typedef std::map<int, PropInfoBase> PropInfoBases; typedef std::map<int, PropInfoBase> PropInfoBases;
......
...@@ -41,15 +41,22 @@ bool Propagator::Init(const PropInfoBase& propInfo, const SInitOrbit& initOrbit, ...@@ -41,15 +41,22 @@ bool Propagator::Init(const PropInfoBase& propInfo, const SInitOrbit& initOrbit,
m_variates = variates; m_variates = variates;
if (propInfo.GetType() == ST_PROP) { if (propInfo.GetType() == ST_PROP) {
const IntegratorCfg& icfg = initOrbit.GetIntegratorCfg();
if (!m_variates) { if (!m_variates) {
InitStPredictor(m_stPredictor, initOrbit, propInfo); InitStPredictor(m_stPredictor, initOrbit, propInfo);
m_stPredictor.GetPredictor()->SetAccuracy(icfg.getEps(), icfg.getStepInit(), icfg.getStepMin(), icfg.getPrecItfr()); m_stPredictor.GetPredictor()->SetAccuracy(
propInfo.get_integrator_cfg().getEps(),
propInfo.get_integrator_cfg().getStepInit(),
propInfo.get_integrator_cfg().getStepMin(),
propInfo.get_integrator_cfg().getPrecItfr());
m_predictor = &m_stPredictor; m_predictor = &m_stPredictor;
} }
else { else {
InitStvPredictor(m_stvPredictor, initOrbit, propInfo); InitStvPredictor(m_stvPredictor, initOrbit, propInfo);
m_stvPredictor.GetPredictor()->SetAccuracy(icfg.getEps(), icfg.getStepInit(), icfg.getStepMin(), icfg.getPrecItfr()); m_stvPredictor.GetPredictor()->SetAccuracy(
propInfo.get_integrator_cfg().getEps(),
propInfo.get_integrator_cfg().getStepInit(),
propInfo.get_integrator_cfg().getStepMin(),
propInfo.get_integrator_cfg().getPrecItfr());
m_predictor = &m_stvPredictor; m_predictor = &m_stvPredictor;
} }
} }
...@@ -262,7 +269,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const ...@@ -262,7 +269,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
0, 0,
m_initOrbit.GetId() m_initOrbit.GetId()
); );
res.SetIntegratorCfg(m_initOrbit.GetIntegratorCfg());
return true; return true;
} }
else { else {
...@@ -283,7 +289,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const ...@@ -283,7 +289,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
0, 0,
m_initOrbit.GetId() m_initOrbit.GetId()
); );
res.SetIntegratorCfg(m_initOrbit.GetIntegratorCfg());
return true; return true;
} }
else { else {
...@@ -304,7 +309,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const ...@@ -304,7 +309,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
0, 0,
m_initOrbit.GetId() m_initOrbit.GetId()
); );
res.SetIntegratorCfg(m_initOrbit.GetIntegratorCfg());
return true; return true;
} }
else { else {
......
...@@ -78,9 +78,6 @@ public: ...@@ -78,9 +78,6 @@ public:
void SetMotionModel(const MotionModel& motionModel); void SetMotionModel(const MotionModel& motionModel);
void SetDate(const TimeJD& date); void SetDate(const TimeJD& date);
void SetId(TOrbitId id) { m_id = id; } void SetId(TOrbitId id) { m_id = id; }
void SetIntegratorCfg(const IntegratorCfg& icfg) { m_integratorCfg = icfg; }
const IntegratorCfg& GetIntegratorCfg() const { return m_integratorCfg; }
protected: protected:
static int ParseSrcType(const TOrbitId& id); static int ParseSrcType(const TOrbitId& id);
void CreateFromKepler(const KepData& kd, const std::string& frame); void CreateFromKepler(const KepData& kd, const std::string& frame);
...@@ -102,7 +99,6 @@ protected: ...@@ -102,7 +99,6 @@ protected:
TOrbitId m_id; TOrbitId m_id;
TOrbitId m_baseid; TOrbitId m_baseid;
PropInfoBase m_propInfo; PropInfoBase m_propInfo;
IntegratorCfg m_integratorCfg;
int rev_; int rev_;
}; };
......
#include "integratorcfg.h" #include "integratorcfg.h"
#include "XMLFunctions.h"
void IntegratorCfg::load(const jsonval& parent) void IntegratorCfg::load(const jsonval& parent)
{ {
m_eps = -1;
loadjson(parent, "eps", m_eps, false); loadjson(parent, "eps", m_eps, false);
m_stepinit = -1;
loadjson(parent, "init_step", m_stepinit, false); loadjson(parent, "init_step", m_stepinit, false);
m_stepmin = -1;
loadjson(parent, "min_step", m_stepmin, false); loadjson(parent, "min_step", m_stepmin, false);
m_precItrf = false;
loadjson(parent, "prec_itrf", m_precItrf, false); loadjson(parent, "prec_itrf", m_precItrf, false);
} }
bool IntegratorCfg::Load(myXML::Contain* parent)
{
std::map<std::string, myXML::Contain*> con;
GetChildren(parent, con);
LoadXML(con, "integratorEps", m_eps, false);
LoadXML(con, "integratorStepInit", m_stepinit, false);
LoadXML(con, "integratorStepMin", m_stepmin, false);
LoadXML(con, "prec_itrf", m_precItrf, false);
return true;
}
#pragma once #pragma once
#include "json_functions.h" #include "json_functions.h"
#include <myXML_Document.hpp>
#define IEPS 1E-9
#define ISTEPINIT 10E-3
#define ISTEPMIN .1E-3
class IntegratorCfg class IntegratorCfg
{ {
public: public:
IntegratorCfg() : IntegratorCfg()
m_eps(IEPS), m_stepinit(ISTEPINIT), m_stepmin(ISTEPMIN), m_precItrf(false)
{ {
} }
...@@ -20,13 +16,14 @@ public: ...@@ -20,13 +16,14 @@ public:
} }
void load(const jsonval& parent); void load(const jsonval& parent);
double getEps() const { return m_eps > 0 ? m_eps : IEPS; } bool Load(myXML::Contain* parent);
double getStepInit() const { return m_stepinit > 0 ? m_stepinit : ISTEPINIT; } double getEps() const { return m_eps; }
double getStepMin() const { return m_stepmin > 0 ? m_stepmin : ISTEPMIN; } double getStepInit() const { return m_stepinit; }
double getStepMin() const { return m_stepmin; }
bool getPrecItfr() const { return m_precItrf; } bool getPrecItfr() const { return m_precItrf; }
private: private:
double m_eps; double m_eps{1E-9};
double m_stepinit; double m_stepinit{10E-3};
double m_stepmin; double m_stepmin{.1E-3};
bool m_precItrf; bool m_precItrf{false};
}; };
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