Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
afd957f1
Commit
afd957f1
authored
Sep 29, 2019
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c2284a41
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
259 additions
and
94 deletions
+259
-94
OpticDelayMeasurement.cpp
bnolib/OpticDelayMeasurement.cpp
+13
-0
OpticDelayMeasurement.h
bnolib/OpticDelayMeasurement.h
+2
-2
OpticMeasurement.cpp
bnolib/OpticMeasurement.cpp
+74
-1
OpticMeasurement.h
bnolib/OpticMeasurement.h
+1
-0
json_functions.h
json/json_functions.h
+29
-4
Site.cpp
utils/Site.cpp
+4
-0
Site.h
utils/Site.h
+6
-0
TimeFunctions.h
utils/TimeFunctions.h
+39
-23
interpolate.cpp
utils/interpolate.cpp
+7
-52
interpolate.h
utils/interpolate.h
+0
-1
ires.cpp
utils/ires.cpp
+22
-0
ires.h
utils/ires.h
+4
-5
orbBlock.cpp
utils/orbBlock.cpp
+2
-2
orbBlock.h
utils/orbBlock.h
+1
-1
trj_inter.h
utils/trj_inter.h
+2
-3
trj_inter_x.cpp
utils/trj_inter_x.cpp
+31
-0
trj_inter_x.h
utils/trj_inter_x.h
+22
-0
No files found.
bnolib/OpticDelayMeasurement.cpp
View file @
afd957f1
...
@@ -141,4 +141,17 @@ bool OpticDelayMeasurement::PrepareDstFrame(const IFrame& fr)
...
@@ -141,4 +141,17 @@ bool OpticDelayMeasurement::PrepareDstFrame(const IFrame& fr)
return
true
;
return
true
;
}
}
bool
OpticDelayMeasurement
::
PrepareDstFrame_gr
(
const
IFrame
&
fr
)
{
SetWrkFrame
(
J2000Frame
());
if
(
!
DetectRecieverPos
(
GetTime
(),
fr
,
RecPosFr
))
{
return
false
;
}
RecPosFrInit
=
true
;
return
true
;
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
bnolib/OpticDelayMeasurement.h
View file @
afd957f1
...
@@ -13,8 +13,7 @@
...
@@ -13,8 +13,7 @@
#include "OpticMeasurement.h"
#include "OpticMeasurement.h"
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
class
OpticDelayMeasurement
:
public
OpticMeasurement
class
OpticDelayMeasurement
:
public
OpticMeasurement
{
{
public
:
public
:
// Конструктор по умолчанию
// Конструктор по умолчанию
OpticDelayMeasurement
();
OpticDelayMeasurement
();
...
@@ -40,6 +39,7 @@ public:
...
@@ -40,6 +39,7 @@ public:
};
};
bool
PrepareDstFrame
(
const
IFrame
&
fr
);
bool
PrepareDstFrame
(
const
IFrame
&
fr
);
bool
PrepareDstFrame_gr
(
const
IFrame
&
fr
);
protected
:
protected
:
// Точность, с которой определяется время распространения сигнала
// Точность, с которой определяется время распространения сигнала
double
TimePrec
;
double
TimePrec
;
...
...
bnolib/OpticMeasurement.cpp
View file @
afd957f1
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include "Consts.h"
#include "Consts.h"
#include "LocalJ2000Frame.h"
#include "LocalJ2000Frame.h"
#include <iostream>
#include <iostream>
#include "GreenwichFrame.h"
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Конструктор по умолчанию
// Конструктор по умолчанию
...
@@ -219,7 +220,7 @@ bool OpticMeasurement::Simulate(int matrixSize, ITraject& trj, TimeJD& t, const
...
@@ -219,7 +220,7 @@ bool OpticMeasurement::Simulate(int matrixSize, ITraject& trj, TimeJD& t, const
if
(
!
DetectPosition
(
trj
,
t
,
(
const
IFrame
*
)
&
wrkfrm
,
f
))
{
if
(
!
DetectPosition
(
trj
,
t
,
(
const
IFrame
*
)
&
wrkfrm
,
f
))
{
return
false
;
return
false
;
}
}
if
(
v
==
0
&&
m
==
0
&&
del
==
0
)
{
if
(
v
==
0
&&
m
==
0
&&
del
==
0
)
{
return
true
;
return
true
;
}
}
...
@@ -271,6 +272,78 @@ bool OpticMeasurement::Simulate(int matrixSize, ITraject& trj, TimeJD& t, const
...
@@ -271,6 +272,78 @@ bool OpticMeasurement::Simulate(int matrixSize, ITraject& trj, TimeJD& t, const
return
true
;
return
true
;
}
}
//-----------------------------------------------------------------------------
// Метод осуществляет моделирование измерения для космического объекта,
// движение которого описывается с помощью переменной trj.
//-----------------------------------------------------------------------------
bool
OpticMeasurement
::
Simulate_gr
(
int
matrixSize
,
ITraject
&
trj
,
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
*
f
,
DVector
*
v
,
DMatrix
*
m
,
DVector
*
del
)
const
{
Vect6
pv
;
if
(
f
==
0
&&
(
v
!=
0
||
m
!=
0
||
del
!=
0
))
{
f
=
&
pv
;
}
//J2000Frame wrkfrm;
GreenwichFrame
wrkfrm
;
if
(
!
DetectPosition
(
trj
,
t
,
(
const
IFrame
*
)
&
wrkfrm
,
f
))
{
return
false
;
}
PhasePoint6D
pp
(
wrkfrm
,
*
f
,
t
);
pp
.
Convert
(
fr
);
*
f
=
pp
.
CoordsVel
;
if
(
v
==
0
&&
m
==
0
&&
del
==
0
)
{
return
true
;
}
DVector
ang
(
2
);
Vect6
crd
;
FrameConverter
.
Convert
(
*
f
,
crd
);
double
r2
=
crd
.
Len
();
ang
(
1
)
=
r2
>
0
?
asin
(
crd
.
z
/
r2
)
:
0.0
;
ang
(
0
)
=
(
crd
.
x
!=
0
||
crd
.
y
!=
0
)
?
atan2
(
crd
.
y
,
crd
.
x
)
:
0.0
;
// <-- [-PI,+PI]
ang
(
0
)
=
Angle2Pi
(
ang
(
0
));
if
(
v
!=
0
)
{
*
v
=
ang
;
}
if
(
del
!=
0
)
{
Diff
(
*
del
,
NULL
,
&
ang
);
}
if
(
m
!=
0
)
{
double
ra2
=
crd
.
Len2
();
double
ras2
=
crd
.
x
*
crd
.
x
+
crd
.
y
*
crd
.
y
;
double
ras
=
sqrt
(
ras2
);
Vect3
dalfaa
,
ddeltaa
,
dalfaf
,
ddeltaf
;
dalfaa
[
0
]
=
-
crd
.
y
/
ras2
;
dalfaa
[
1
]
=
crd
.
x
/
ras2
;
dalfaa
[
2
]
=
0.0
;
ddeltaa
[
0
]
=
-
crd
.
x
*
crd
.
z
/
(
ras
*
ra2
);
ddeltaa
[
1
]
=
-
crd
.
y
*
crd
.
z
/
(
ras
*
ra2
);
ddeltaa
[
2
]
=
ras
/
ra2
;
FrameConverter3D
inv
;
FrameConverter
.
Converter3D
.
Invert
(
inv
);
dalfaf
=
dalfaa
;
dalfaf
.
MulLeft
(
inv
.
Rotation
);
ddeltaf
=
ddeltaa
;
ddeltaf
.
MulLeft
(
inv
.
Rotation
);
m
->
Init
(
2
,
matrixSize
);
m
->
Init
(
0.0
);
unsigned
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
{
(
*
m
)(
0
,
i
)
=
dalfaf
[
i
];
(
*
m
)(
1
,
i
)
=
ddeltaf
[
i
];
}
}
return
true
;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Вычисление невязок между измерениями
// Вычисление невязок между измерениями
// Если m1 или m2 == NULL, принмается текущее измерение
// Если m1 или m2 == NULL, принмается текущее измерение
...
...
bnolib/OpticMeasurement.h
View file @
afd957f1
...
@@ -57,6 +57,7 @@ public:
...
@@ -57,6 +57,7 @@ public:
// del - вектор невязок измеряемых параметров. Если этот параметр равен 0,
// del - вектор невязок измеряемых параметров. Если этот параметр равен 0,
// вектор невязок не вычисляется
// вектор невязок не вычисляется
virtual
bool
Simulate
(
int
matrixSize
,
ITraject
&
trj
,
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
*
f
=
0
,
DVector
*
v
=
0
,
DMatrix
*
m
=
0
,
DVector
*
del
=
0
)
const
;
virtual
bool
Simulate
(
int
matrixSize
,
ITraject
&
trj
,
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
*
f
=
0
,
DVector
*
v
=
0
,
DMatrix
*
m
=
0
,
DVector
*
del
=
0
)
const
;
virtual
bool
Simulate_gr
(
int
matrixSize
,
ITraject
&
trj
,
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
*
f
=
0
,
DVector
*
v
=
0
,
DMatrix
*
m
=
0
,
DVector
*
del
=
0
)
const
;
virtual
void
Diff
(
DVector
&
d
,
const
DVector
*
m1
=
NULL
,
const
DVector
*
m2
=
NULL
)
const
;
virtual
void
Diff
(
DVector
&
d
,
const
DVector
*
m1
=
NULL
,
const
DVector
*
m2
=
NULL
)
const
;
...
...
json/json_functions.h
View file @
afd957f1
...
@@ -95,6 +95,31 @@ static bool loadjson(const jsonval& parent, const std::string& key, std::vector<
...
@@ -95,6 +95,31 @@ static bool loadjson(const jsonval& parent, const std::string& key, std::vector<
return
true
;
return
true
;
}
}
static
bool
loadjson
(
const
jsonval
&
parent
,
const
std
::
string
&
key
,
std
::
vector
<
size_t
>&
vec
,
const
bool
exist
=
true
,
bool
*
loaded
=
nullptr
)
{
jsonval
::
ConstMemberIterator
itr
;
if
(
!
extract_value
(
parent
,
key
,
exist
,
loaded
,
itr
))
{
return
false
;
}
const
jsonval
&
a
=
itr
->
value
;
if
(
!
a
.
IsArray
())
{
throw
Exp
()
<<
"error: element is not an array"
;
}
for
(
jsonval
::
ConstValueIterator
it
=
a
.
Begin
();
it
!=
a
.
End
();
++
it
)
{
if
(
it
->
IsInt
())
{
vec
.
push_back
(
it
->
GetInt
());
}
else
{
throw
Exp
()
<<
"error: unsupported type"
;
}
}
return
true
;
}
static
bool
loadjson
(
const
jsonval
&
parent
,
const
std
::
string
&
key
,
std
::
vector
<
int
>&
vec
,
const
bool
exist
=
true
,
bool
*
loaded
=
nullptr
)
static
bool
loadjson
(
const
jsonval
&
parent
,
const
std
::
string
&
key
,
std
::
vector
<
int
>&
vec
,
const
bool
exist
=
true
,
bool
*
loaded
=
nullptr
)
{
{
jsonval
::
ConstMemberIterator
itr
;
jsonval
::
ConstMemberIterator
itr
;
...
@@ -161,15 +186,15 @@ bool loadjson(const jsonval& parent, std::string key, std::vector<T>& vec, const
...
@@ -161,15 +186,15 @@ bool loadjson(const jsonval& parent, std::string key, std::vector<T>& vec, const
for
(
rapidjson
::
SizeType
i
=
0
;
i
<
a
.
Size
();
i
++
)
{
for
(
rapidjson
::
SizeType
i
=
0
;
i
<
a
.
Size
();
i
++
)
{
T
item
;
T
item
;
loadjson
(
a
[
i
],
item
);
item
.
load
(
a
[
i
]
);
vec
.
push
_back
(
item
);
vec
.
emplace
_back
(
item
);
}
}
return
true
;
return
true
;
}
}
template
<
typename
T
,
typename
Tid
>
template
<
typename
T
,
typename
Tid
>
bool
loadjson
(
const
jsonval
&
parent
,
std
::
string
key
,
std
::
map
<
Tid
,
T
>&
map
,
const
bool
exist
=
true
,
bool
*
loaded
=
nullptr
)
bool
loadjson
(
const
jsonval
&
parent
,
const
std
::
string
key
,
std
::
map
<
Tid
,
T
>&
map
,
const
bool
exist
=
true
,
bool
*
loaded
=
nullptr
)
{
{
jsonval
::
ConstMemberIterator
itr
;
jsonval
::
ConstMemberIterator
itr
;
if
(
!
extract_value
(
parent
,
key
,
exist
,
loaded
,
itr
))
{
if
(
!
extract_value
(
parent
,
key
,
exist
,
loaded
,
itr
))
{
...
@@ -184,7 +209,7 @@ bool loadjson(const jsonval& parent, std::string key, std::map<Tid, T>& map, con
...
@@ -184,7 +209,7 @@ bool loadjson(const jsonval& parent, std::string key, std::map<Tid, T>& map, con
for
(
rapidjson
::
SizeType
i
=
0
;
i
<
a
.
Size
();
i
++
)
{
for
(
rapidjson
::
SizeType
i
=
0
;
i
<
a
.
Size
();
i
++
)
{
T
item
;
T
item
;
loadjson
(
a
[
i
],
item
);
item
.
load
(
a
[
i
]
);
map
[
item
.
getId
()]
=
item
;
map
[
item
.
getId
()]
=
item
;
}
}
...
...
utils/Site.cpp
View file @
afd957f1
...
@@ -82,6 +82,10 @@ void Site::load(const jsonval& parent)
...
@@ -82,6 +82,10 @@ void Site::load(const jsonval& parent)
converter
.
Lam
=
sgc
.
GetLon
();
converter
.
Lam
=
sgc
.
GetLon
();
converter
.
H
=
sgc
.
GetAlt
();
converter
.
H
=
sgc
.
GetAlt
();
converter
.
GetXYZ
(
m_coordinates
);
converter
.
GetXYZ
(
m_coordinates
);
m_lat_deg
=
sgc
.
GetLat
()
*
rad2deg
;
m_lon_deg
=
sgc
.
GetLon
()
*
rad2deg
;
m_alt_m
=
sgc
.
GetAlt
()
*
1E6
;
}
}
}
}
...
...
utils/Site.h
View file @
afd957f1
...
@@ -19,12 +19,18 @@ public:
...
@@ -19,12 +19,18 @@ public:
bool
IsNeedAberrationCorrection
()
const
{
return
m_needAberrationCorrection
;
}
bool
IsNeedAberrationCorrection
()
const
{
return
m_needAberrationCorrection
;
}
double
GetSigmaAlpha
()
const
{
return
m_sigmaAlpha
;
}
double
GetSigmaAlpha
()
const
{
return
m_sigmaAlpha
;
}
double
GetSigmaDelta
()
const
{
return
m_sigmaDelta
;
}
double
GetSigmaDelta
()
const
{
return
m_sigmaDelta
;
}
double
get_lat_deg
()
const
{
return
m_lat_deg
;
}
double
get_lon_deg
()
const
{
return
m_lon_deg
;
}
double
get_alt_m
()
const
{
return
m_alt_m
;
}
private
:
private
:
bool
m_needAberrationCorrection
;
bool
m_needAberrationCorrection
;
double
m_sigmaAlpha
;
double
m_sigmaAlpha
;
double
m_sigmaDelta
;
double
m_sigmaDelta
;
Vect3
m_coordinates
;
Vect3
m_coordinates
;
TSiteId
m_id
;
TSiteId
m_id
;
double
m_lat_deg
;
double
m_lon_deg
;
double
m_alt_m
;
};
};
typedef
std
::
vector
<
Site
>
Sites
;
typedef
std
::
vector
<
Site
>
Sites
;
...
...
utils/TimeFunctions.h
View file @
afd957f1
...
@@ -3,22 +3,10 @@
...
@@ -3,22 +3,10 @@
#include "Converter.h"
#include "Converter.h"
#include "TM.h"
#include "TM.h"
#include <string>
#include <string>
#include <iostream>
#include <iomanip>
#include <iomanip>
#include <sstream>
#include <sstream>
#include "globals.h"
#include "globals.h"
#include "TextFunctions.h"
/*void IncJ(double& JD, double sec);
double MoveJ(double JD, double sec);
double LocalTimeToJ(int Cyear, int Cmonth, int Cday,int Chour,int Cminute,int Csecond, int Cms);
double LocalTimeToJTz(int Cyear, int Cmonth, int Cday,int Chour,int Cminute,int Csecond, int Cms, double tz);
double LocalTimeSTToJ(Time st);
double LocalTimeSTToJTz(Time st, double tz);
double SystemTimeToJ(int Cyear, int Cmonth, int Cday,double Chour,int Cminute,int Csecond, int Cms);
double TimeInterval(double J1, double J2);
void JToSystemTime(double J,int &Cyear,int &Cmonth,int &Cday,int& Chour,int& Cminute,int& Csecond,int& Cms);
std::string PrintFullTime(double J, double tz);
*/
static
void
GetPrecK
(
int
msprec
,
int
&
k1
,
int
&
k2
)
static
void
GetPrecK
(
int
msprec
,
int
&
k1
,
int
&
k2
)
{
{
...
@@ -113,7 +101,7 @@ static int mthdays(int month, int year)
...
@@ -113,7 +101,7 @@ static int mthdays(int month, int year)
return
days
[
leap
][
month
];
return
days
[
leap
][
month
];
}
}
static
std
::
string
DateToStr
(
int
year
,
int
month
,
int
day
,
int
hour
,
int
minute
,
int
second
,
double
fraction
,
int
prec
)
static
std
::
string
DateToStr
(
int
year
,
int
month
,
int
day
,
int
hour
,
int
minute
,
int
second
,
double
fraction
,
int
prec
,
bool
year_first
=
false
)
{
{
int
d
=
hour
;
int
d
=
hour
;
int
m
=
minute
;
int
m
=
minute
;
...
@@ -155,14 +143,24 @@ static std::string DateToStr(int year, int month, int day, int hour, int minute,
...
@@ -155,14 +143,24 @@ static std::string DateToStr(int year, int month, int day, int hour, int minute,
std
::
ostringstream
ss
;
std
::
ostringstream
ss
;
ss
<<
std
::
setfill
(
'0'
);
if
(
!
year_first
)
{
ss
<<
std
::
setw
(
2
)
<<
day
<<
"/"
;
ss
<<
std
::
setfill
(
'0'
);
ss
<<
std
::
setw
(
2
)
<<
month
<<
"/"
;
ss
<<
std
::
setw
(
2
)
<<
day
<<
"/"
;
ss
<<
std
::
setw
(
4
)
<<
year
<<
" "
;
ss
<<
std
::
setw
(
2
)
<<
month
<<
"/"
;
ss
<<
std
::
setw
(
2
)
<<
d
<<
":"
;
ss
<<
std
::
setw
(
4
)
<<
year
<<
" "
;
ss
<<
std
::
setw
(
2
)
<<
m
<<
":"
;;
ss
<<
std
::
setw
(
2
)
<<
d
<<
":"
;
ss
<<
std
::
setw
(
2
)
<<
s
;
ss
<<
std
::
setw
(
2
)
<<
m
<<
":"
;;
ss
<<
std
::
setw
(
2
)
<<
s
;
}
else
{
ss
<<
std
::
setfill
(
'0'
);
ss
<<
std
::
setw
(
4
)
<<
year
<<
"/"
;
ss
<<
std
::
setw
(
2
)
<<
month
<<
"/"
;
ss
<<
std
::
setw
(
2
)
<<
day
<<
" "
;
ss
<<
std
::
setw
(
2
)
<<
d
<<
":"
;
ss
<<
std
::
setw
(
2
)
<<
m
<<
":"
;;
ss
<<
std
::
setw
(
2
)
<<
s
;
}
if
(
prec
>
0
)
{
if
(
prec
>
0
)
{
ss
<<
"."
;
ss
<<
"."
;
ss
<<
std
::
setw
(
prec
)
<<
msec
;
ss
<<
std
::
setw
(
prec
)
<<
msec
;
...
@@ -451,7 +449,7 @@ static TimeGD ToGD(double jd)
...
@@ -451,7 +449,7 @@ static TimeGD ToGD(double jd)
{
{
int
Cyear
,
Cmonth
,
Cday
,
Chour
,
Cminute
,
Csecond
,
Cms
;
int
Cyear
,
Cmonth
,
Cday
,
Chour
,
Cminute
,
Csecond
,
Cms
;
JToSystemTime
(
jd
,
Cyear
,
Cmonth
,
Cday
,
Chour
,
Cminute
,
Csecond
,
Cms
);
JToSystemTime
(
jd
,
Cyear
,
Cmonth
,
Cday
,
Chour
,
Cminute
,
Csecond
,
Cms
);
return
TimeGD
(
Cday
,
Cmonth
,
Cyear
,
Chour
,
Cminute
,
Csecond
,
Cms
/
1000
.
0
)
;
return
{
Cday
,
Cmonth
,
Cyear
,
Chour
,
Cminute
,
Csecond
,
Cms
/
1000
.
0
}
;
}
}
static
double
date2jd
(
const
std
::
string
&
date
)
static
double
date2jd
(
const
std
::
string
&
date
)
...
@@ -468,3 +466,21 @@ static std::string jd2date(double jd, int prec = 3)
...
@@ -468,3 +466,21 @@ static std::string jd2date(double jd, int prec = 3)
JToSystemTime
(
jd
,
year
,
month
,
day
,
hour
,
minute
,
second
,
ms
);
JToSystemTime
(
jd
,
year
,
month
,
day
,
hour
,
minute
,
second
,
ms
);
return
DateToStr
(
year
,
month
,
day
,
hour
,
minute
,
second
,
ms
/
1000
.
0
,
prec
);
return
DateToStr
(
year
,
month
,
day
,
hour
,
minute
,
second
,
ms
/
1000
.
0
,
prec
);
}
}
static
std
::
string
calc_nightid
(
const
TimeJD
&
date
,
const
double
lon_deg
)
{
const
double
jd
=
date
.
GetDays
()
+
date
.
GetFraction
()
+
lon_deg
/
15
/
24
-
0
.
5
;
int
year
;
unsigned
short
int
month
;
unsigned
short
int
day
;
unsigned
short
int
hour
;
unsigned
short
int
minutes
;
unsigned
short
int
seconds
;
double
fraction
;
convertTimeJG
((
int
)
jd
,
jd
-
(
int
)
jd
,
year
,
month
,
day
,
hour
,
minutes
,
seconds
,
fraction
);
std
::
string
str
=
DateToStr
(
year
,
month
,
day
,
hour
,
minutes
,
seconds
,
fraction
,
3
,
true
);
str
=
str
.
substr
(
0
,
10
);
string_replace
(
str
,
"/"
,
""
);
return
str
;
}
utils/interpolate.cpp
View file @
afd957f1
...
@@ -3,17 +3,6 @@
...
@@ -3,17 +3,6 @@
#include "GreenwichFrame.h"
#include "GreenwichFrame.h"
#include <algorithm>
#include <algorithm>
template
<
bool
dir
,
typename
vartype
>
struct
cmppos
:
public
std
::
binary_function
<
vartype
,
vartype
,
bool
>
{
bool
operator
()(
vartype
s1
,
vartype
s2
)
const
{
const
TimeJD
&
v1
=
s1
.
get_date
();
const
TimeJD
&
v2
=
s2
.
get_date
();
return
(
v1
==
v2
)
?
false
:
(
v1
<
v2
)
^
dir
;
}
};
static
double
get_step
(
const
double
period
,
const
double
ecc
)
static
double
get_step
(
const
double
period
,
const
double
ecc
)
{
{
if
(
ecc
<
0.1
)
{
if
(
ecc
<
0.1
)
{
...
@@ -51,7 +40,12 @@ XInterpolator::XInterpolator(const SInitOrbit& orbit, const TimeJD& beg, const T
...
@@ -51,7 +40,12 @@ XInterpolator::XInterpolator(const SInitOrbit& orbit, const TimeJD& beg, const T
XInterpolator
::
XInterpolator
(
const
std
::
vector
<
IRes
>&
vec
)
XInterpolator
::
XInterpolator
(
const
std
::
vector
<
IRes
>&
vec
)
{
{
create
(
vec
);
std
::
vector
<
IRes
>
svec
=
vec
;
std
::
sort
(
svec
.
begin
(),
svec
.
end
(),
[](
const
IRes
&
a
,
const
IRes
&
b
)
{
return
(
a
.
get_date
()
<
b
.
get_date
());
});
create
(
svec
);
}
}
void
XInterpolator
::
propagate_dir
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
,
const
int
dir
,
std
::
vector
<
IRes
>&
result
)
void
XInterpolator
::
propagate_dir
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
,
const
int
dir
,
std
::
vector
<
IRes
>&
result
)
...
@@ -161,39 +155,6 @@ void finalize(ei& ephi)
...
@@ -161,39 +155,6 @@ void finalize(ei& ephi)
}
}
}
}
/*void Interpolator::filter_addons()
{
std::vector<IRes> filtered;
std::sort(m_positions.begin(), m_positions.end(), cmpfunc3<false, IRes>());
int first_real;
for (int it = 0; it < m_positions.size(); it++){
if(!m_positions[it].is_addon()){
first_real = it;
break;
}
filtered.push_back(m_positions[it]);
}
int last_real;
for (int it = m_positions.size() - 1; it >= 0; it--){
if(!m_positions[it].is_addon()){
last_real = it;
break;
}
filtered.push_back(m_positions[it]);
}
for (int it = first_real; it <= last_real; it++){
if(!m_positions[it].is_addon()){
filtered.push_back(m_positions[it]);
}
}
std::sort(filtered.begin(), filtered.end(), cmpfunc3<false, IRes>());
m_positions = filtered;
}*/
void
XInterpolator
::
create
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
)
void
XInterpolator
::
create
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
)
{
{
std
::
vector
<
IRes
>
positions
;
std
::
vector
<
IRes
>
positions
;
...
@@ -210,13 +171,7 @@ void XInterpolator::create(const std::vector<IRes>& positions)
...
@@ -210,13 +171,7 @@ void XInterpolator::create(const std::vector<IRes>& positions)
init
(
m_ephi
,
positions
.
size
());
init
(
m_ephi
,
positions
.
size
());
for
(
const
auto
&
p
:
positions
)
{
for
(
const
auto
&
p
:
positions
)
{
Vect6
pos
=
p
.
get_pos
();
fill
(
p
.
get_pos
(),
p
.
get_date
().
GetDays
(),
p
.
get_date
().
GetFraction
(),
m_ephi
);
TimeJD
date
=
p
.
get_date
();
PhasePoint6D
itrf
(
static_cast
<
const
IFrame
&>
(
J2000Frame
()),
pos
,
date
);
//itrf.Convert(GreenwichFrame());
//double jdi = date.GetDays();
//double jdf = date.GetFraction();
fill
(
itrf
.
CoordsVel
,
date
.
GetDays
(),
date
.
GetFraction
(),
m_ephi
);
}
}
finalize
(
m_ephi
);
finalize
(
m_ephi
);
...
...
utils/interpolate.h
View file @
afd957f1
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
#include "TM.h"
#include "TM.h"
#include "ephi.h"
#include "ephi.h"
#include "DVectors.h"
#include "DVectors.h"
#include "Propagator.h"
#include "ires.h"
#include "ires.h"
class
XInterpolator
class
XInterpolator
...
...
utils/ires.cpp
View file @
afd957f1
#include "ires.h"
#include "ires.h"
#include <utility>
#include <utility>
#include "json_functions_bno.h"
IRes
::
IRes
()
=
default
;
IRes
::
IRes
(
const
Vect6
&
vec
,
const
TimeJD
&
date
,
const
double
age
,
std
::
string
orbitid
,
const
bool
addon
)
IRes
::
IRes
(
const
Vect6
&
vec
,
const
TimeJD
&
date
,
const
double
age
,
std
::
string
orbitid
,
const
bool
addon
)
:
:
...
@@ -10,3 +13,22 @@ IRes::IRes(const Vect6& vec, const TimeJD& date, const double age, std::string o
...
@@ -10,3 +13,22 @@ IRes::IRes(const Vect6& vec, const TimeJD& date, const double age, std::string o
m_addon
(
addon
)
m_addon
(
addon
)
{
{
}
}
void
IRes
::
load
(
const
jsonval
&
parent
)
{
double
x
,
y
,
z
;
loadjson
(
parent
,
"x_km"
,
x
);
loadjson
(
parent
,
"y_km"
,
y
);
loadjson
(
parent
,
"z_km"
,
z
);
double
vx
=
0
,
vy
=
0
,
vz
=
0
;
loadjson
(
parent
,
"vx_km/s"
,
vx
,
false
);
loadjson
(
parent
,
"vy_km/s"
,
vy
,
false
);
loadjson
(
parent
,
"vz_km/s"
,
vz
,
false
);
loadjson
(
parent
,
"date"
,
m_date
);
loadjson
(
parent
,
"orbitid"
,
m_orbitid
,
false
);
loadjson
(
parent
,
"age_days"
,
m_age
,
false
);
m_vec
=
Vect6
(
x
/
1E3
,
y
/
1E3
,
z
/
1E3
,
vx
,
vy
,
vz
);
}
utils/ires.h
View file @
afd957f1
...
@@ -3,14 +3,13 @@
...
@@ -3,14 +3,13 @@
#include "DVectors.h"
#include "DVectors.h"
#include "TM.h"
#include "TM.h"
#include <string>
#include <string>
#include "json_functions.h"
class
IRes
class
IRes
{
{
public
:
public
:
IRes
()
IRes
();
{
};
IRes
(
const
Vect6
&
vec
,
const
TimeJD
&
date
,
double
age
,
std
::
string
orbitid
,
bool
addon
=
false
);
IRes
(
const
Vect6
&
vec
,
const
TimeJD
&
date
,
double
age
,
std
::
string
orbitid
,
bool
addon
=
false
);
void
load
(
const
jsonval
&
parent
);
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
;
}
bool
is_addon
()
const
{
return
m_addon
;
}
bool
is_addon
()
const
{
return
m_addon
;
}
...
...
utils/orbBlock.cpp
View file @
afd957f1
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
#include "TextFunctions.h"
#include "TextFunctions.h"
OrbBlock
::
OrbBlock
()
OrbBlock
::
OrbBlock
()
:
:
m_ip
(
nullptr
)
m_ip
(
nullptr
)
{
{
}
}
...
...
utils/orbBlock.h
View file @
afd957f1
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
class
OrbBlock
{
class
OrbBlock
{
public
:
public
:
OrbBlock
();
;
OrbBlock
();
OrbBlock
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
);
OrbBlock
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
);
OrbBlock
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
,
double
mind
,
std
::
string
next_orbitid
);
OrbBlock
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
,
double
mind
,
std
::
string
next_orbitid
);
~
OrbBlock
();
~
OrbBlock
();
...
...
utils/trj_inter.h
View file @
afd957f1
...
@@ -15,10 +15,9 @@ public:
...
@@ -15,10 +15,9 @@ public:
virtual
void
SetTime
(
const
TimeJD
&
t
)
virtual
void
SetTime
(
const
TimeJD
&
t
)
{
{
}
;
}
virtual
const
TimeJD
&
GetTime
()
const
{
return
m_dummy
;
};
virtual
const
TimeJD
&
GetTime
()
const
{
return
TimeJD
()
;
};
virtual
IPredict
*
GetPredictor
()
{
return
0
;
}
virtual
IPredict
*
GetPredictor
()
{
return
0
;
}
private
:
private
:
const
OrbBlocksStore
&
m_orbit_processor
;
const
OrbBlocksStore
&
m_orbit_processor
;
TimeJD
m_dummy
;
};
};
utils/trj_inter_x.cpp
0 → 100644
View file @
afd957f1
#include "trj_inter_x.h"
#include "GreenwichFrame.h"
TrjInterX
::
TrjInterX
(
const
XInterpolator
&
itp
)
:
m_itp
(
itp
)
{
}
bool
TrjInterX
::
Predict
(
const
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
&
f
)
{
PhasePoint6D
pp
(
GreenwichFrame
(),
m_itp
.
get_pos
(
t
,
true
),
t
);
pp
.
Convert
(
fr
);
f
=
pp
.
CoordsVel
;
return
true
;
}
bool
TrjInterX
::
PredictMatrix
(
const
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
&
f
,
DMatrix
&
m
)
{
return
true
;
}
bool
TrjInterX
::
Move
(
const
TimeJD
&
t
,
DVector
&
u
)
{
return
true
;
}
bool
TrjInterX
::
Init
(
const
DVector
&
u0
)
{
return
true
;
}
utils/trj_inter_x.h
0 → 100644
View file @
afd957f1
#pragma once
#include "ITraject.h"
#include "interpolate.h"
class
TrjInterX
:
public
ITraject
{
public
:
TrjInterX
(
const
XInterpolator
&
itp
);
virtual
bool
Predict
(
const
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
&
f
);
virtual
bool
PredictMatrix
(
const
TimeJD
&
t
,
const
IFrame
&
fr
,
Vect6
&
f
,
DMatrix
&
m
);
virtual
bool
Move
(
const
TimeJD
&
t
,
DVector
&
u
);
virtual
unsigned
Size
()
const
{
return
6
;
}
virtual
bool
Init
(
const
DVector
&
u0
);
virtual
void
SetTime
(
const
TimeJD
&
t
)
{
}
virtual
const
TimeJD
&
GetTime
()
const
{
return
TimeJD
();
}
virtual
IPredict
*
GetPredictor
()
{
return
0
;
}
private
:
const
XInterpolator
&
m_itp
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment