@saber-usa/node-common 1.7.37 → 1.7.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/astro.js +49 -13
package/package.json
CHANGED
package/src/astro.js
CHANGED
|
@@ -334,44 +334,80 @@ const orbitalMeanMotionRevPerDay = (aKm, muKm3s2) => {
|
|
|
334
334
|
};
|
|
335
335
|
|
|
336
336
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
337
|
+
* Classify orbit regime using JCO v1.0.0 primary period/eccentricity cuts
|
|
338
|
+
* (Orbit_Class_Definitions_v1.0.0_11Jun2024.csv).
|
|
339
|
+
*
|
|
340
|
+
* Documentation:
|
|
341
|
+
* https://unifieddatalibrary.com/scs/download?id=/CommunityData/JCO_DOK/JCO_JSON_Requirements/Orbit_Class_Definitions_v1.0.0_11Jun2024.xlsx
|
|
342
|
+
*
|
|
343
|
+
* Symbols (from the `orbit` argument, case-insensitive keys via lowerCaseObjectKeys):
|
|
344
|
+
* - e — eccentricity (dimensionless), where: `orbit.eccentricity`
|
|
345
|
+
* - T — orbital period (minutes), where: `orbit.period`
|
|
346
|
+
* - n — mean motion (revolutions per day), where: `orbit.meanmotion`
|
|
347
|
+
* - i — inclination (degrees), where: `orbit.inclination`
|
|
348
|
+
*
|
|
349
|
+
* Evaluation order:
|
|
350
|
+
*
|
|
351
|
+
* 1. e ≥ 0.25 → HEO (4)
|
|
352
|
+
* 2. 1300 < T < 1800 → GEO family: GeoStationary (256), GeoInclined (8), or GeoDrifter (512)
|
|
353
|
+
* - 256 when 0.99 ≤ n ≤ 1.01 and i ≤ 0.01°
|
|
354
|
+
* - 8 when 0.99 ≤ n ≤ 1.01 and i > 0.01°
|
|
355
|
+
* - 512 for the remainder of the JCO GEO period window (near-geosync / drifters)
|
|
356
|
+
* 3. 600 < T < 900 → MEO (16)
|
|
357
|
+
* 4. T ≤ 225 → LEO (2)
|
|
358
|
+
* 5. else → Undetermined (1) — JCO OTHER, XGEO, and period gaps (no dedicated enums yet)
|
|
359
|
+
*
|
|
360
|
+
* Guards:
|
|
361
|
+
* - missing or undefined `orbit` → Undetermined (1)
|
|
362
|
+
* - missing e → Undetermined (1)
|
|
363
|
+
* - missing T, or T ≤ 0 → Undetermined (1)
|
|
364
|
+
* - GEO subclass (step 2) requires n and i; if either is missing → Undetermined (1)
|
|
365
|
+
*
|
|
339
366
|
* @param {Object} orbit Object with keys eccentricity, inclination (deg), meanmotion (rev/day) and period (min)
|
|
340
|
-
* @return {number}
|
|
367
|
+
* @return {number} REGIMES bitflag index (see constants.js)
|
|
341
368
|
*/
|
|
342
369
|
const calcRegime = (orbit) => {
|
|
343
370
|
if (!isDefined(orbit)) {
|
|
344
371
|
return REGIMES.Undetermined;
|
|
345
372
|
}
|
|
346
373
|
|
|
347
|
-
const {eccentricity, inclination, meanmotion, period}
|
|
374
|
+
const {eccentricity: e, inclination: i, meanmotion: n, period: T}
|
|
348
375
|
= lowerCaseObjectKeys(orbit);
|
|
349
376
|
|
|
350
|
-
if (!isDefined(
|
|
377
|
+
if (!isDefined(e)) {
|
|
351
378
|
return REGIMES.Undetermined;
|
|
352
379
|
}
|
|
353
380
|
|
|
354
|
-
if (
|
|
355
|
-
return REGIMES.
|
|
381
|
+
if (e >= 0.25) {
|
|
382
|
+
return REGIMES.Heo;
|
|
356
383
|
}
|
|
357
384
|
|
|
358
|
-
if (
|
|
359
|
-
return REGIMES.
|
|
385
|
+
if (!isDefined(T) || T <= 0) {
|
|
386
|
+
return REGIMES.Undetermined;
|
|
360
387
|
}
|
|
361
388
|
|
|
362
|
-
if (
|
|
389
|
+
if (T > 1300 && T < 1800) {
|
|
390
|
+
if (!isDefined(n) || !isDefined(i)) {
|
|
391
|
+
return REGIMES.Undetermined;
|
|
392
|
+
}
|
|
393
|
+
if (n >= 0.99 && n <= 1.01 && i <= 0.01) {
|
|
394
|
+
return REGIMES.GeoStationary;
|
|
395
|
+
}
|
|
396
|
+
if (n >= 0.99 && n <= 1.01 && i > 0.01) {
|
|
397
|
+
return REGIMES.GeoInclined;
|
|
398
|
+
}
|
|
363
399
|
return REGIMES.GeoDrifter;
|
|
364
400
|
}
|
|
365
401
|
|
|
366
|
-
if (
|
|
402
|
+
if (T > 600 && T < 900) {
|
|
367
403
|
return REGIMES.Meo;
|
|
368
404
|
}
|
|
369
405
|
|
|
370
|
-
if (
|
|
406
|
+
if (T <= 225) {
|
|
371
407
|
return REGIMES.Leo;
|
|
372
408
|
}
|
|
373
409
|
|
|
374
|
-
return
|
|
410
|
+
return REGIMES.Undetermined;
|
|
375
411
|
};
|
|
376
412
|
|
|
377
413
|
/**
|