@saber-usa/node-common 1.7.37 → 1.7.38

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/astro.js +25 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saber-usa/node-common",
3
- "version": "1.7.37",
3
+ "version": "1.7.38",
4
4
  "description": "Common node functions for Saber",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/astro.js CHANGED
@@ -334,8 +334,12 @@ const orbitalMeanMotionRevPerDay = (aKm, muKm3s2) => {
334
334
  };
335
335
 
336
336
  /**
337
- * Given eccentricity, inclination, meanmotion, and period
338
- * Calculates & returns type of orbit to include LEO, MEO, HEO, GEO Drifter, GEO Inclined,GEO Stationary, and undetermined if applicable
337
+ * Classify orbit regime using JCO v1.0.0 primary period/eccentricity cuts
338
+ * (Orbit_Class_Definitions_v1.0.0_11Jun2024.csv). Evaluation order matters:
339
+ * HEO first, then GEO family (1300–1800 min), MEO, LEO, else Undetermined.
340
+ *
341
+ * Documentation available at: https://unifieddatalibrary.com/scs/download?id=/CommunityData/JCO_DOK/JCO_JSON_Requirements/Orbit_Class_Definitions_v1.0.0_11Jun2024.xlsx
342
+ *
339
343
  * @param {Object} orbit Object with keys eccentricity, inclination (deg), meanmotion (rev/day) and period (min)
340
344
  * @return {number} the regime index
341
345
  */
@@ -344,34 +348,43 @@ const calcRegime = (orbit) => {
344
348
  return REGIMES.Undetermined;
345
349
  }
346
350
 
347
- const {eccentricity, inclination, meanmotion, period}
351
+ const {eccentricity: e, inclination: i, meanmotion: n, period: T}
348
352
  = lowerCaseObjectKeys(orbit);
349
353
 
350
- if (!isDefined(meanmotion) && (!isDefined(period) || !isDefined(eccentricity))) {
354
+ if (!isDefined(e)) {
351
355
  return REGIMES.Undetermined;
352
356
  }
353
357
 
354
- if (meanmotion >= 0.99 && meanmotion <= 1.01 && inclination <= 0.01) {
355
- return REGIMES.GeoStationary;
358
+ if (e >= 0.25) {
359
+ return REGIMES.Heo;
356
360
  }
357
361
 
358
- if (meanmotion >= 0.99 && meanmotion <= 1.01 && inclination > 0.01) {
359
- return REGIMES.GeoInclined;
362
+ if (!isDefined(T) || T <= 0) {
363
+ return REGIMES.Undetermined;
360
364
  }
361
365
 
362
- if (meanmotion >= 0.94 && meanmotion <= 1.06) {
366
+ if (T > 1300 && T < 1800) {
367
+ if (!isDefined(n) || !isDefined(i)) {
368
+ return REGIMES.Undetermined;
369
+ }
370
+ if (n >= 0.99 && n <= 1.01 && i <= 0.01) {
371
+ return REGIMES.GeoStationary;
372
+ }
373
+ if (n >= 0.99 && n <= 1.01 && i > 0.01) {
374
+ return REGIMES.GeoInclined;
375
+ }
363
376
  return REGIMES.GeoDrifter;
364
377
  }
365
378
 
366
- if (period >= 600 && period <= 800 && eccentricity < 0.25) {
379
+ if (T > 600 && T < 900) {
367
380
  return REGIMES.Meo;
368
381
  }
369
382
 
370
- if (meanmotion > 11.25 && eccentricity < 0.25) {
383
+ if (T <= 225) {
371
384
  return REGIMES.Leo;
372
385
  }
373
386
 
374
- return eccentricity > 0.25 ? REGIMES.Heo : REGIMES.Undetermined;
387
+ return REGIMES.Undetermined;
375
388
  };
376
389
 
377
390
  /**