Skip to content

Commit 938b3a7

Browse files
authored
Fix incorrect timestamp parameter key for getGroundTracksSync (#46)
Both the types and documentation indicate that the name should be startTimeMS not optionalTimeMS
1 parent 3baff87 commit 938b3a7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

__tests__/sgp4.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe("getGroundTracksSync", () => {
257257
test("1", () => {
258258
const coords = getGroundTracksSync({
259259
tle: tleArr,
260-
optionalTimeMS: 1501039265000
260+
startTimeMS: 1501039265000
261261
});
262262
expect(coords.length).toBe(3);
263263

@@ -271,7 +271,7 @@ describe("getGroundTracksSync", () => {
271271
const timestamp = 1620583838732;
272272
const result = await getGroundTracksSync({
273273
tle: proxima2,
274-
optionalTimeMS: timestamp
274+
startTimeMS: timestamp
275275
});
276276
expect(result[0][0][0]).toBeCloseTo(-179.65354);
277277
expect(result[0][0][1]).toBeCloseTo(84.57353);

src/sgp4.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ export function getGroundTracks({
620620
export function getGroundTracksSync({
621621
tle,
622622
stepMS = 1000,
623-
optionalTimeMS = Date.now(), // TODO: change to startTimeMS for consistency
623+
startTimeMS = Date.now(),
624624
isLngLatFormat = true
625625
}) {
626626
const parsedTLE = parseTLE(tle);
@@ -629,7 +629,7 @@ export function getGroundTracksSync({
629629
const orbitTimeMS = getAverageOrbitTimeMS(tleArr);
630630
const curOrbitStartMS = getLastAntemeridianCrossingTimeMS(
631631
parsedTLE,
632-
optionalTimeMS
632+
startTimeMS
633633
);
634634

635635
const foundCrossing = curOrbitStartMS !== -1;
@@ -638,7 +638,7 @@ export function getGroundTracksSync({
638638

639639
const partialGroundTrack = getOrbitTrackSync({
640640
tle: parsedTLE,
641-
startTimeMS: optionalTimeMS,
641+
startTimeMS: startTimeMS,
642642
stepMS: _MS_IN_A_MINUTE,
643643
maxTimeMS: _MS_IN_A_DAY / 4
644644
});

0 commit comments

Comments
 (0)