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
6969ff1e
Commit
6969ff1e
authored
Mar 25, 2019
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
636205b8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
42 deletions
+23
-42
OrbitId.h
utils/OrbitId.h
+2
-0
interpolate.cpp
utils/interpolate.cpp
+6
-11
interpolate.h
utils/interpolate.h
+2
-2
ires.cpp
utils/ires.cpp
+3
-1
ires.h
utils/ires.h
+4
-1
orbBlocks.cpp
utils/orbBlocks.cpp
+6
-27
No files found.
utils/OrbitId.h
View file @
6969ff1e
#ifndef ORBITID_H
#define ORBITID_H
#include <string>
typedef
std
::
string
TOrbitId
;
#endif
utils/interpolate.cpp
View file @
6969ff1e
...
...
@@ -65,28 +65,22 @@ void XInterpolator::propagate_dir(const SInitOrbit& orbit, const TimeJD& beg, co
{
Propagator
prop
(
orbit
,
false
);
int
step
=
get_step
(
orbit
);
//std::string s_beg = DateToStr(beg);
//std::string s_end = DateToStr(end);
bool
exit
=
false
;
TimeJD
date
=
beg
;
while
(
!
exit
)
{
//std::string s_date = DateToStr(date);
if
(
date
>=
end
&&
dir
==
1
||
date
<=
end
&&
dir
==
-
1
)
{
date
=
end
;
exit
=
true
;
}
double
age
=
DaysInterval
(
orbit
.
GetDate
(),
date
);
PhasePoint6D
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
);
//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
{
int
n
=
100
;
int
step
=
get_step
(
orbit
);
TimeJD
beg_ext
=
ShiftDate
(
beg
,
-
n
*
step
);
TimeJD
end_ext
=
ShiftDate
(
end
,
+
n
*
step
);
...
...
utils/interpolate.h
View file @
6969ff1e
...
...
@@ -12,14 +12,14 @@ public:
XInterpolator
();
XInterpolator
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
);
~
XInterpolator
();
void
create
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
);
Vect6
get_pos
(
const
TimeJD
&
date
)
const
;
int
get_size
()
const
{
return
m_positions
.
size
();
}
TimeJD
get_beg
()
const
{
return
m_beg
;
}
TimeJD
get_end
()
const
{
return
m_end
;
}
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
);
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_dir
(
const
SInitOrbit
&
orbit
,
const
TimeJD
&
beg
,
const
TimeJD
&
end
,
int
dir
,
std
::
vector
<
IRes
>&
result
);
//void filter_addons();
...
...
utils/ires.cpp
View file @
6969ff1e
#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_date
(
date
),
m_step
(
step
),
m_age
(
age
),
m_orbitid
(
orbitid
),
m_addon
(
addon
)
{
}
utils/ires.h
View file @
6969ff1e
...
...
@@ -2,18 +2,21 @@
#include "DVectors.h"
#include "TM.h"
#include "OrbitId.h"
class
IRes
{
public
:
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
;
}
Vect6
get_pos
()
const
{
return
m_vec
;
}
int
get_step
()
const
{
return
m_step
;
}
bool
is_addon
()
const
{
return
m_addon
;
}
private
:
TOrbitId
m_orbitid
;
Vect6
m_vec
;
TimeJD
m_date
;
int
m_step
;
double
m_age
;
bool
m_addon
;
};
utils/orbBlocks.cpp
View file @
6969ff1e
...
...
@@ -42,25 +42,14 @@ SInitOrbits OrbBlocksStore::filter(SInitOrbits orbits) const
TimeJD
orb1beg
=
ShiftDate
(
orb1
.
GetDate
(),
-
orb1
.
GetInterval
()
*
86400
);
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
;
for
(
int
j
=
i
+
1
;
j
<
(
int
)
orbits
.
size
();
j
++
)
{
const
SInitOrbit
&
orb2
=
orbits
[
j
];
TimeJD
orb2beg
=
ShiftDate
(
orb2
.
GetDate
(),
-
orb2
.
GetInterval
()
*
86400
);
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
eq2
=
fabs
(
DaysInterval
(
orb1end
,
orb2end
)
*
86400
*
1000
)
<
1
;
...
...
@@ -98,10 +87,7 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
{
TimeJD
left
=
beg
;
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
++
)
{
const
SInitOrbit
&
orb1
=
orbits
[
i
];
...
...
@@ -113,11 +99,7 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
m_blocks
.
push_back
(
OrbBlock
(
orb1
,
left
,
end
));
break
;
}
//std::string orb1beg_s = DateToStr(orb1beg);
//std::string orb1end_s = DateToStr(orb1end);
//std::string left_s = DateToStr(left);
if
(
orb1end
<
left
)
{
continue
;
}
...
...
@@ -125,10 +107,7 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
const
SInitOrbit
&
orb2
=
orbits
[
i
+
1
];
TimeJD
orb2beg
=
ShiftDate
(
orb2
.
GetDate
(),
-
orb2
.
GetInterval
()
*
86400
);
//std::string orb2beg_s = DateToStr(orb2beg);
//std::string orb2end_s = DateToStr(orb2end);
if
(
orb1end
<
orb2beg
)
{
//no intersection
if
(
orb2beg
<
left
)
{
...
...
@@ -139,7 +118,7 @@ void OrbBlocksStore::init_min_dist(const SInitOrbits& orbits, const TimeJD& beg,
TimeJD
right
;
double
minDist
;
calc_min_dist
(
orb1
,
orb2
,
orb1end
,
orb2beg
,
right
,
minDist
);
//std::string minjd_s = DateToStr(right);
if
(
right
>
end
)
{
right
=
end
;
stop
=
true
;
...
...
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