Unverified Commit 1195843a authored by Andrew Goetz's avatar 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
......@@ -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>
......
......@@ -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) {
......
......@@ -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");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment