Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Orekit
Orekit
Commits
b45bdee4
Commit
b45bdee4
authored
May 12, 2022
by
GC
Browse files
First commit for issue-790.
Added optional velocity vector to both CPF parser and writer.
parent
8cce4593
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/orekit/files/ilrs/CPF.java
View file @
b45bdee4
...
...
@@ -141,6 +141,25 @@ public class CPF implements EphemerisFile<CPF.CPFCoordinate, CPF.CPFEphemeris> {
ephemeris
.
get
(
id
).
coordinates
.
add
(
coord
);
}
/**
* Add the velocity to the last CPF coordinate entry.
* @param id satellite ILRS identifier
* @param velocity the velocity vector of the satellite
*/
public
void
addSatelliteVelocityToCPFCoordinate
(
final
String
id
,
final
Vector3D
velocity
)
{
// Get the last coordinate entry, which contains the position vector
final
CPFCoordinate
lastCoordinate
=
ephemeris
.
get
(
id
).
coordinates
.
get
(
ephemeris
.
get
(
id
).
coordinates
.
size
()
-
1
);
// Create a new CPFCoordinate object with both position and velocity information
final
CPFCoordinate
CPFCoordUpdated
=
new
CPFCoordinate
(
lastCoordinate
.
getDate
(),
lastCoordinate
.
getPosition
(),
velocity
,
lastCoordinate
.
getLeap
());
// Patch the last record
ephemeris
.
get
(
id
).
coordinates
.
set
(
ephemeris
.
get
(
id
).
coordinates
.
size
()
-
1
,
CPFCoordUpdated
);
}
/**
* Set the interpolation sample.
* @param interpolationSample interpolation sample
...
...
src/main/java/org/orekit/files/ilrs/CPFParser.java
View file @
b45bdee4
...
...
@@ -496,7 +496,18 @@ public class CPFParser implements EphemerisFileParser<CPF> {
/** {@inheritDoc} */
@Override
public
void
parse
(
final
String
line
,
final
ParseInfo
pi
)
{
// Not implemented yet
// Data contained in the line
final
String
[]
values
=
SEPARATOR
.
split
(
line
);
// Coordinates
final
double
x
=
Double
.
parseDouble
(
values
[
2
]);
final
double
y
=
Double
.
parseDouble
(
values
[
3
]);
final
double
z
=
Double
.
parseDouble
(
values
[
4
]);
final
Vector3D
velocity
=
new
Vector3D
(
x
,
y
,
z
);
// CPF coordinate
pi
.
file
.
addSatelliteVelocityToCPFCoordinate
(
pi
.
file
.
getHeader
().
getIlrsSatelliteId
(),
velocity
);
}
/** {@inheritDoc} */
...
...
Write
Preview
Supports
Markdown
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