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
a1ff8cdb
Commit
a1ff8cdb
authored
Mar 25, 2019
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ orb_date
parent
6969ff1e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
5 deletions
+132
-5
integratorcfg.cpp
utils/integratorcfg.cpp
+17
-0
integratorcfg.h
utils/integratorcfg.h
+4
-5
ires.h
utils/ires.h
+1
-0
orb_date.cpp
utils/orb_date.cpp
+101
-0
orb_date.h
utils/orb_date.h
+9
-0
No files found.
utils/integratorcfg.cpp
0 → 100644
View file @
a1ff8cdb
#include "integratorcfg.h"
void
IntegratorCfg
::
load
(
const
jsonval
&
parent
)
{
m_eps
=
-
1
;
loadjson
(
parent
,
"eps"
,
m_eps
,
false
);
m_stepinit
=
-
1
;
loadjson
(
parent
,
"init_step"
,
m_stepinit
,
false
);
m_stepmin
=
-
1
;
loadjson
(
parent
,
"min_step"
,
m_stepmin
,
false
);
m_precItrf
=
false
;
loadjson
(
parent
,
"prec_itrf"
,
m_precItrf
,
false
);
}
utils/integratorcfg.h
View file @
a1ff8cdb
#ifndef INTEGRATORCFG_H
#define INTEGRATORCFG_H
#pragma once
#include "json_functions.h"
#define IEPS 1E-9
#define ISTEPINIT 10E-3
...
...
@@ -17,6 +18,7 @@ public:
{
}
void
load
(
const
jsonval
&
parent
);
double
getEps
()
const
{
return
m_eps
>
0
?
m_eps
:
IEPS
;
}
double
getStepInit
()
const
{
return
m_stepinit
>
0
?
m_stepinit
:
ISTEPINIT
;
}
double
getStepMin
()
const
{
return
m_stepmin
>
0
?
m_stepmin
:
ISTEPMIN
;
}
...
...
@@ -27,6 +29,3 @@ private:
double
m_stepmin
;
bool
m_precItrf
;
};
#endif
utils/ires.h
View file @
a1ff8cdb
...
...
@@ -12,6 +12,7 @@ public:
Vect6
get_pos
()
const
{
return
m_vec
;
}
int
get_step
()
const
{
return
m_step
;
}
bool
is_addon
()
const
{
return
m_addon
;
}
double
get_age
()
const
{
return
m_age
;
}
private
:
TOrbitId
m_orbitid
;
Vect6
m_vec
;
...
...
utils/orb_date.cpp
0 → 100644
View file @
a1ff8cdb
#include "orb_date.h"
#include "Propagator.h"
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
;
}
};
std
::
vector
<
TimeJD
>
generate_dates
(
const
TimeJD
&
sdate
,
const
TimeJD
&
edate
,
int
step
)
{
std
::
vector
<
TimeJD
>
result
;
result
.
push_back
(
sdate
);
if
(
sdate
>=
edate
)
{
return
result
;
}
int
n
=
(
int
)(
DaysInterval
(
sdate
,
edate
)
*
86400
/
step
);
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
result
.
push_back
(
ShiftDateX
(
sdate
,
step
*
(
i
+
1
)));
}
if
(
result
.
back
()
!=
edate
)
{
result
.
push_back
(
edate
);
}
return
result
;
}
IRes
propagate_date
(
Propagator
&
prop
,
const
TimeJD
&
date
)
{
PhasePoint6D
pos
;
prop
.
Propagate
(
date
,
pos
);
return
IRes
(
pos
.
CoordsVel
,
date
,
0
,
DaysInterval
(
prop
.
GetInitOrbit
().
GetDate
(),
date
),
prop
.
GetInitOrbit
().
GetId
());
}
void
propagate_dir
(
const
SInitOrbit
&
orbit
,
const
std
::
vector
<
TimeJD
>&
dates
,
int
dir
,
std
::
vector
<
IRes
>&
result
)
{
Propagator
prop
(
orbit
,
false
);
if
(
dir
>
0
)
{
for
(
std
::
vector
<
TimeJD
>::
const_iterator
it
=
dates
.
begin
();
it
!=
dates
.
end
();
it
++
)
{
result
.
push_back
(
propagate_date
(
prop
,
*
it
));
}
}
else
if
(
dir
<
0
)
{
for
(
std
::
vector
<
TimeJD
>::
const_reverse_iterator
it
=
dates
.
rbegin
();
it
!=
dates
.
rend
();
it
++
)
{
result
.
push_back
(
propagate_date
(
prop
,
*
it
));
}
}
}
void
split_dates
(
const
std
::
vector
<
TimeJD
>&
dates
,
const
TimeJD
&
date
,
std
::
vector
<
TimeJD
>&
dates_left
,
std
::
vector
<
TimeJD
>&
dates_right
)
{
for
(
std
::
vector
<
TimeJD
>::
const_iterator
it
=
dates
.
begin
();
it
!=
dates
.
end
();
++
it
)
{
if
(
*
it
<
date
)
{
dates_left
.
push_back
(
*
it
);
}
else
{
dates_right
.
push_back
(
*
it
);
}
}
}
std
::
vector
<
IRes
>
calc_positions
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
,
int
step
)
{
std
::
vector
<
IRes
>
result
;
std
::
vector
<
TimeJD
>
dates
=
generate_dates
(
beg
,
end
,
step
);
if
(
dates
.
empty
())
{
return
result
;
}
TimeJD
beg_ext
=
dates
.
front
();
TimeJD
end_ext
=
dates
.
back
();
if
(
orbit
.
GetDate
()
<=
beg_ext
)
{
propagate_dir
(
orbit
,
dates
,
1
,
result
);
}
else
if
(
orbit
.
GetDate
()
>=
end_ext
)
{
propagate_dir
(
orbit
,
dates
,
-
1
,
result
);
}
else
{
std
::
vector
<
TimeJD
>
dates_left
,
dates_right
;
split_dates
(
dates
,
orbit
.
GetDate
(),
dates_left
,
dates_right
);
propagate_dir
(
orbit
,
dates_left
,
-
1
,
result
);
propagate_dir
(
orbit
,
dates_right
,
+
1
,
result
);
}
std
::
sort
(
result
.
begin
(),
result
.
end
(),
cmppos
<
false
,
IRes
>
());
return
result
;
}
utils/orb_date.h
0 → 100644
View file @
a1ff8cdb
#pragma once
#include "TM.h"
#include <vector>
#include "ires.h"
#include "StateVector.h"
std
::
vector
<
TimeJD
>
generate_dates
(
const
TimeJD
&
sdate
,
const
TimeJD
&
edate
,
int
step
);
std
::
vector
<
IRes
>
calc_positions
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
,
int
step
);
\ No newline at end of file
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