Commit cf2864fb authored by Alexander Lapshin's avatar Alexander Lapshin

.

parent 1d146aad
This diff is collapsed.
......@@ -11,159 +11,159 @@
//-----------------------------------------------------------------------------
DigPredictVar::DigPredictVar()
{
Integrator = NULL;
Adapter = NULL;
KOProp = NULL;
FlagInit = false;
Integrator = NULL;
Adapter = NULL;
KOProp = NULL;
FlagInit = false;
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void DigPredictVar::SetIntegrator(IODESolver *slv)
{
Integrator = slv;
Integrator->SetSystem(&System);
Integrator = slv;
Integrator->SetSystem(&System);
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void DigPredictVar::SetKOProp(IKOPropVar *prop)
{
KOProp = prop;
KOProp->Init(MMode);
System.SetKO(*KOProp);
{
KOProp = prop;
KOProp->Init(MMode);
System.SetKO(*KOProp);
};
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void DigPredictVar::SetInitPoint(const PhasePoint6D &src, const DMatrix *vars)
{
TAssert(Integrator != NULL);
TAssert(Adapter != NULL);
TAssert(KOProp != NULL);
//
T0 = src.T;
System.Init(T0, MMode, *Adapter);
// . J2000
double *y;
PhasePoint6D j2000;
J2000Frame f2000;
j2000.SetFrame(f2000);
j2000.Assign(src);
y = new double[6 + 36 + 6 * KOProp->GetNVars()];
y[0] = j2000.CoordsVel.x;
y[1] = j2000.CoordsVel.y;
y[2] = j2000.CoordsVel.z;
y[3] = j2000.CoordsVel.vx;
y[4] = j2000.CoordsVel.vy;
y[5] = j2000.CoordsVel.vz;
int i, j;
if (vars == NULL)
{
//
for (i = 0; i < 6; i++)
{
for (j = 0; j < 6; j++)
y[6 + i * 6 + j] = (i == j) ? 1.0 : 0.0;
}
for (i = 0; i < KOProp->GetNVars(); i++)
{
for (j = 0; j < 6; j++)
y[6 + 36 + i * 6 + j] = 0.0;
}
}
else
{
//
TAssert(vars->Cols() == 6);
TAssert((int)vars->Rows() == 6 + KOProp->GetNVars());
for (i = 0; i < (int)vars->Rows(); i++)
{
for (j = 0; j < 6; j++)
y[6 + i * 6 + j] = (*vars)(i, j);
}
}
Integrator->SetInitial(0.0, y);
FlagInit = true;
delete[] y;
TAssert(Integrator != NULL);
TAssert(Adapter != NULL);
TAssert(KOProp != NULL);
//
T0 = src.T;
System.Init(T0, MMode, *Adapter);
// . J2000
double *y;
PhasePoint6D j2000;
J2000Frame f2000;
j2000.SetFrame(f2000);
j2000.Assign(src);
y = new double[6 + 36 + 6 * KOProp->GetNVars()];
y[0] = j2000.CoordsVel.x;
y[1] = j2000.CoordsVel.y;
y[2] = j2000.CoordsVel.z;
y[3] = j2000.CoordsVel.vx;
y[4] = j2000.CoordsVel.vy;
y[5] = j2000.CoordsVel.vz;
int i, j;
if (vars == NULL)
{
//
for (i = 0; i < 6; i++)
{
for (j = 0; j < 6; j++)
y[6 + i * 6 + j] = (i == j) ? 1.0 : 0.0;
}
for (i = 0; i < KOProp->GetNVars(); i++)
{
for (j = 0; j < 6; j++)
y[6 + 36 + i * 6 + j] = 0.0;
}
}
else
{
//
TAssert(vars->Cols() == 6);
TAssert((int)vars->Rows() == 6 + KOProp->GetNVars());
for (i = 0; i < (int)vars->Rows(); i++)
{
for (j = 0; j < 6; j++)
y[6 + i * 6 + j] = (*vars)(i, j);
}
}
Integrator->SetInitial(0.0, y);
FlagInit = true;
delete[] y;
}
//-----------------------------------------------------------------------------
// ""
//-----------------------------------------------------------------------------
void DigPredictVar::ReRun()
{
PhasePoint6D v;
DMatrix m;
PhasePoint6D v;
DMatrix m;
GetDestPoint(v);
GetDestMatrix(m);
SetInitPoint(v, &m);
GetDestPoint(v);
GetDestMatrix(m);
SetInitPoint(v, &m);
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
bool DigPredictVar::Run(const TimeJD &t)
{
TAssert(FlagInit);
// ,
// ( )
double dt = (t - T0).GetDouble() * 86.4;
return Integrator->Run(dt);
TAssert(FlagInit);
// ,
// ( )
double dt = (t - T0).GetDouble() * 86.4;
return Integrator->Run(dt);
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void DigPredictVar::GetDestPoint(PhasePoint6D &dest)
{
TAssert(FlagInit);
TAssert(FlagInit);
dest.T = T0;
dest.T += Integrator->GetX() / 86.4;
dest.T = T0;
dest.T += Integrator->GetX() / 86.4;
J2000Frame f2000;
dest.SetFrame(f2000);
J2000Frame f2000;
dest.SetFrame(f2000);
const double *y = Integrator->GetSolution();
const double *y = Integrator->GetSolution();
dest.CoordsVel.x = y[0];
dest.CoordsVel.y = y[1];
dest.CoordsVel.z = y[2];
dest.CoordsVel.vx = y[3];
dest.CoordsVel.vy = y[4];
dest.CoordsVel.vz = y[5];
dest.CoordsVel.x = y[0];
dest.CoordsVel.y = y[1];
dest.CoordsVel.z = y[2];
dest.CoordsVel.vx = y[3];
dest.CoordsVel.vy = y[4];
dest.CoordsVel.vz = y[5];
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
void DigPredictVar::GetDestMatrix(DMatrix &m)
{
TAssert(FlagInit);
int i, j, n;
n = 6 + KOProp->GetNVars();
m.Init(n, n);
//m.Init(0);
const double *y = Integrator->GetSolution() + 6;
for (i = 0; i < n; i++)
{
for (j = 0; j < 6; j++){
m(i, j) = y[6 * i + j];
}
for (j = 6; j < 6+KOProp->GetNVars(); j++){
m(i, j) = i==j ? 1 : 0;
}
}
TAssert(FlagInit);
int i, j, n;
n = 6 + KOProp->GetNVars();
m.Init(n, n);
//m.Init(0);
const double *y = Integrator->GetSolution() + 6;
for (i = 0; i < n; i++)
{
for (j = 0; j < 6; j++) {
m(i, j) = y[6 * i + j];
}
for (j = 6; j < 6 + KOProp->GetNVars(); j++) {
m(i, j) = i == j ? 1 : 0;
}
}
}
......@@ -175,71 +175,71 @@ void DigPredictVar::GetDestMatrix(DMatrix &m)
///////////////////////////////////////////////////////////////////////////////
//
//-----------------------------------------------------------------------------
DigStPredictVar::DigStPredictVar()
:
DigPredictVar(),
m_eps(1E-9),
m_stepinit(10E-3),
m_stepmin(.1E-3)
DigStPredictVar::DigStPredictVar()
:
DigPredictVar(),
m_eps(1E-9),
m_stepinit(10E-3),
m_stepmin(.1E-3)
{
//
DigPredictVar::SetAdapter(&SAdapter);
//
DigPredictVar::SetKOProp(&KOModel);
//
DigPredictVar::SetIntegrator(&SIntegrator);
//
SetAccuracy(m_eps, m_stepinit, m_stepmin, false);
//
DigPredictVar::SetAdapter(&SAdapter);
//
DigPredictVar::SetKOProp(&KOModel);
//
DigPredictVar::SetIntegrator(&SIntegrator);
//
SetAccuracy(m_eps, m_stepinit, m_stepmin, false);
}
DigStPredictVar::DigStPredictVar(double eps, double stepinit, double stepmin, bool precItrf)
:
DigPredictVar(),
m_eps(eps),
m_stepinit(stepinit),
m_stepmin(stepmin)
DigStPredictVar::DigStPredictVar(double eps, double stepinit, double stepmin, bool precItrf)
:
DigPredictVar(),
m_eps(eps),
m_stepinit(stepinit),
m_stepmin(stepmin)
{
//
DigPredictVar::SetAdapter(&SAdapter);
//
DigPredictVar::SetKOProp(&KOModel);
//
DigPredictVar::SetIntegrator(&SIntegrator);
//
SetAccuracy(m_eps, m_stepinit, m_stepmin, precItrf);
//
DigPredictVar::SetAdapter(&SAdapter);
//
DigPredictVar::SetKOProp(&KOModel);
//
DigPredictVar::SetIntegrator(&SIntegrator);
//
SetAccuracy(m_eps, m_stepinit, m_stepmin, precItrf);
}
void DigStPredictVar::SetKOParams(double kb, double kappa, bool iskbvar, bool iskappavar)
{
KOModel.Kb = kb;
KOModel.Kappa = kappa;
if ((iskbvar != KOModel.IsKbVar) || (iskappavar != KOModel.IsKappaVar)){
KOModel.IsKbVar = iskbvar;
KOModel.IsKappaVar = iskappavar;
// - ,
//
SIntegrator.SetSystem(&System);
//
SetAccuracy(m_eps, m_stepinit, m_stepmin, System.getPrecItrf());
}
KOModel.Kb = kb;
KOModel.Kappa = kappa;
if ((iskbvar != KOModel.IsKbVar) || (iskappavar != KOModel.IsKappaVar)) {
KOModel.IsKbVar = iskbvar;
KOModel.IsKappaVar = iskappavar;
// - ,
//
SIntegrator.SetSystem(&System);
//
SetAccuracy(m_eps, m_stepinit, m_stepmin, System.getPrecItrf());
}
}
void DigStPredictVar::SetAccuracy(double eps, double stepinit, double stepmin, bool precItrf){
void DigStPredictVar::SetAccuracy(double eps, double stepinit, double stepmin, bool precItrf) {
double* epsd = new double[6 + 36 + KOModel.GetNVars() * 6];
double* epsd = new double[6 + 36 + KOModel.GetNVars() * 6];
for (int i = 0; i < 6; i++){
epsd[i] = eps;
}
for (int i = 0; i < 6; i++) {
epsd[i] = eps;
}
for (int i = 0; i < 36 + KOModel.GetNVars() * 6; i++){
epsd[i + 6] = 1.e30;
}
for (int i = 0; i < 36 + KOModel.GetNVars() * 6; i++) {
epsd[i + 6] = 1.e30;
}
SIntegrator.SetParams(epsd, stepinit /* . */, stepmin /* . */);
SIntegrator.SetParams(epsd, stepinit /* . */, stepmin /* . */);
delete[] epsd;
delete[] epsd;
System.SetPrecItrf(precItrf);
}
\ No newline at end of file
System.SetPrecItrf(precItrf);
}
......@@ -146,7 +146,7 @@ bool LagrTrajectVar::IsValid(const DVector &u) const
// std::cout << "rp:" << rp << "\n";
// std::cout << "ecc:" << lagr.GetEcc() << "\n";
// std::cout << "period:" << lagr.GetPeriod() << "\n\n";
double ecc = lagr.GetEcc();
// double ecc = lagr.GetEcc();
// double period = lagr.GetPeriod();
if(lagr.GetEcc() > 0.99){
......
......@@ -212,7 +212,6 @@ void ObservePoint::GetRAGtFast(const Vect6 &p, const FrameConverter6D& cnv, RAzG
rag.SetXYZ(Vect6(-top_s*1E-3,top_e*1E-3,top_z*1E-3, -Ptop_s, Ptop_e, Ptop_z));
*/
int x = 1;
}
//-----------------------------------------------------------------------------
......
......@@ -99,8 +99,6 @@ bool OpticDelayMeasurement::DetectPositionEx(ITraject &trj, TimeJD &t, Vect6& f)
tau = tau1;
}
return true;
}
//-----------------------------------------------------------------------------
......
......@@ -63,7 +63,6 @@ void CovMtx::load(const jsonval& parent)
std::map<std::string, double> covmap;
for (int i = 0; i < 36 ; ++i){
double value;
bool loaded;
if(loadjson(parent, names[i], value, false)){
covmap[names[i]] = value;
}
......
......@@ -152,8 +152,6 @@ void AlongAcross(Vect6 satPosJ2000, Vect3 sitePosJ2000, double ra, double de, do
double x0=sitePosJ2000.x;
double y0=sitePosJ2000.y;
double z0=sitePosJ2000.z;
double RA=ra;
double DE=de;
double x1,y1,z1, x2,y2,z2, x3,y3,z3, xi,yi,zi, r1,r2,s;
......
......@@ -114,13 +114,13 @@ void XInterpolator::calc_positions(const SInitOrbit& orbit, const TimeJD& beg, c
}
static void init(ei& ephi, int size){
int i, j;
int idir;
int mjd;
double sod;
double dgast = 0.e0;
int j;
// int idir;
// int mjd;
// double sod;
// double dgast = 0.e0;
double pi;
char ephstr[256];
// char ephstr[256];
/* initialize all the arrays, in case there is nothing to read */
......@@ -306,8 +306,8 @@ void XInterpolator::create(const SInitOrbit& orbit, const TimeJD& beg, const Tim
TimeJD date = it->get_date();
PhasePoint6D itrf(static_cast<const IFrame&>(J2000Frame()), pos, date);
//itrf.Convert(GreenwichFrame());
double jdi = date.GetDays();
double jdf = date.GetFraction();
//double jdi = date.GetDays();
//double jdf = date.GetFraction();
fill(itrf.CoordsVel, date.GetDays(), date.GetFraction(), *m_ephi);
}
......@@ -320,7 +320,6 @@ bool XInterpolator::get_pos(const TimeJD& date, Vect6& res) const
assert(date >= m_beg);
assert(date <= m_end);
double jdint, seci;
double outvec[6], backvec[6], aberout[3], aberback[3];
double relcorrout, relcorrback;
int fvel = 1;
......
......@@ -16,4 +16,4 @@ private:
TimeJD m_date;
int m_step;
bool m_addon;
};
\ No newline at end of file
};
......@@ -37,7 +37,7 @@ SInitOrbits OrbBlocksStore::filter(SInitOrbits orbits) const
SInitOrbits result;
for (int i = 0; i < orbits.size(); i++ ){
for (int i = 0; i < (int)orbits.size(); i++ ){
const SInitOrbit& orb1 = orbits[i];
TimeJD orb1beg = ShiftDate(orb1.GetDate(), -orb1.GetInterval()*86400);
......@@ -52,7 +52,7 @@ SInitOrbits OrbBlocksStore::filter(SInitOrbits orbits) const
}*/
bool found = false;
for (int j = i+1; j < orbits.size(); j++ ){
for (int j = i+1; j < (int)orbits.size(); j++ ){
const SInitOrbit& orb2 = orbits[j];
TimeJD orb2beg = ShiftDate(orb2.GetDate(),-orb2.GetInterval()*86400);
......@@ -102,14 +102,14 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
// std::string beg_s = DateToStr(beg);
// std::string end_s = DateToStr(end);
for (int i = 0; i < orbits.size() && !stop; i++ ){
for (int i = 0; i < (int)orbits.size() && !stop; i++ ){
const SInitOrbit& orb1 = orbits[i];
TimeJD orb1beg = ShiftDate(orb1.GetDate(),-orb1.GetInterval()*86400);
TimeJD orb1end = orb1.GetDate();
if (i == orbits.size() - 1){
if (i == (int)orbits.size() - 1){
m_blocks.push_back(OrbBlock(orb1, left, end));
break;
}
......@@ -201,7 +201,7 @@ void OrbBlocksStore::calc_min_dist(const SInitOrbit& orb1, const SInitOrbit& orb
double time = 0;
double time_end = DaysInterval(beg, end);
double min = -1;
double time_min;
double time_min = 0;
bool exit = false;
while(!exit){
......
#include "uncert.h"
Uncert::Uncert()
:m_hasdata(false)
:m_hasdata(false)
{
}
Uncert::Uncert(double harosh, double oshvr, double oshpp)
:
m_harosh(harosh),
m_oshvr(oshvr),
m_oshpp(oshpp),
m_hasdata(true)
:
m_harosh(harosh),
m_oshvr(oshvr),
m_oshpp(oshpp),
m_hasdata(true)
{
int test=11;
}
void Uncert::load(const jsonval& parent)
{
loadjson(parent, "harosh", m_harosh, false);
loadjson(parent, "oshvr", m_oshvr);
loadjson(parent, "oshpp", m_oshpp);
loadjson(parent, "harosh", m_harosh, false);
loadjson(parent, "oshvr", m_oshvr);
loadjson(parent, "oshpp", m_oshpp);
m_hasdata = true;
}
\ No newline at end of file
m_hasdata = true;
}
......@@ -17,7 +17,7 @@ template<typename T> double golden_section_search(const T& f, double a, double b
return (a + b) / 2.0;
}
int n = ceil( std::log(tol/h) / std::log(invphi) );
int n = (int)ceil( std::log(tol/h) / std::log(invphi) );
double c = a + invphi2 * h;
double d = a + invphi * h;
......
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