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
Andrew Goetz
Orekit
Commits
1195843a
Unverified
Commit
1195843a
authored
Mar 02, 2021
by
Andrew Goetz
Browse files
Added new method to UTCScale which exposes the raw UTC-TAI offset data.
Closes #764
parent
636d1820
Pipeline
#947
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/changes/changes.xml
View file @
1195843a
...
...
@@ -21,6 +21,9 @@
</properties>
<body>
<release
version=
"11.0"
date=
"TBD"
description=
"TBD"
>
<action
dev=
"andrewsgoetz"
type=
"add"
issue=
"764"
>
Added new method to UTCScale which exposes the raw UTC-TAI offset data.
</action>
<action
dev=
"bryan"
type=
"fix"
issue=
"670"
>
Fixed call to ForceModel.init() in AbstractGaussianContribution class.
</action>
...
...
src/main/java/org/orekit/time/UTCScale.java
View file @
1195843a
...
...
@@ -133,6 +133,21 @@ public class UTCScale implements TimeScale {
}
/**
* Returns the UTC-TAI offsets underlying this UTC scale.
* <p>
* Modifications to the returned list will not affect this UTC scale instance.
* @return new non-null modifiable list of UTC-TAI offsets time-sorted from
* earliest to latest
*/
public
List
<
UTCTAIOffset
>
getUTCTAIOffsets
()
{
final
List
<
UTCTAIOffset
>
offsetList
=
new
ArrayList
<>(
offsets
.
length
);
for
(
int
i
=
0
;
i
<
offsets
.
length
;
++
i
)
{
offsetList
.
add
(
offsets
[
i
]);
}
return
offsetList
;
}
/** {@inheritDoc} */
@Override
public
double
offsetFromTAI
(
final
AbsoluteDate
date
)
{
...
...
src/test/java/org/orekit/time/UTCScaleTest.java
View file @
1195843a
...
...
@@ -454,6 +454,16 @@ public class UTCScaleTest {
Assert
.
assertEquals
(
new
AbsoluteDate
(
1960
,
12
,
31
,
23
,
59
,
60
,
utc
),
first
);
}
@Test
public
void
testGetUTCTAIOffsets
()
{
final
List
<
UTCTAIOffset
>
offsets
=
utc
.
getUTCTAIOffsets
();
Assert
.
assertEquals
(
40
,
offsets
.
size
());
final
UTCTAIOffset
firstOffset
=
offsets
.
get
(
0
);
final
UTCTAIOffset
lastOffset
=
offsets
.
get
(
offsets
.
size
()
-
1
);
Assert
.
assertEquals
(
37300
,
firstOffset
.
getMJD
());
// 1961-01-01
Assert
.
assertEquals
(
57204
,
lastOffset
.
getMJD
());
// 2015-07-01
}
@Before
public
void
setUp
()
{
Utils
.
setDataRoot
(
"regular-data"
);
...
...
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