@saber-usa/node-common 1.7.41-alpha.2 → 1.7.41

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/udl.js +14 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saber-usa/node-common",
3
- "version": "1.7.41-alpha.2",
3
+ "version": "1.7.41",
4
4
  "description": "Common node functions for Saber",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/udl.js CHANGED
@@ -26,7 +26,8 @@ import _ from "lodash";
26
26
  */
27
27
  const getSensorId = (ob) => ob.idSensor ?? ob.origSensorId ?? null;
28
28
 
29
- const getObsSatno = (udlRow) => udlRow.idOnOrbit ?? udlRow.origObjectId ?? null;
29
+ const getObsSatno = (udlRow) =>
30
+ udlRow.idOnOrbit ?? udlRow.origObjectId ?? udlRow.satNo ?? null;
30
31
 
31
32
  /**
32
33
  * Converts a UDL EOObservation row to NPS EoObs (PascalCase keys).
@@ -524,6 +525,17 @@ const udlToNpsState = (udlRow) => {
524
525
  // [ a, e, i, Ω, ω, θ ]
525
526
  // sma (km), eccentricity, inclination (deg), raan (deg), arg of perigee (deg), true anomaly (deg)
526
527
  keplerians = cartesianToKeplerian(pos, vel);
528
+ if (_.isEmpty(keplerians)) {
529
+ const idStateVector = _.get(udlRow, "idStateVector", null);
530
+ const epoch = _.get(udlRow, "epoch", null);
531
+ console.error(
532
+ "Keplerian conversion failed. "
533
+ + `idStateVector: ${idStateVector}, epoch: ${epoch}, `
534
+ + `xpos: ${Xpos} km, ypos: ${Ypos} km, zpos: ${Zpos} km, `
535
+ + `xvel: ${Xvel} km/s, yvel: ${Yvel} km/s, zvel: ${Zvel} km/s`,
536
+ );
537
+ keplerians = {a: null, e: null, i: null, raan: null, w: null, f: null};
538
+ }
527
539
  }
528
540
 
529
541
  const regime = computeStateRegimeFromKeplerians(keplerians);
@@ -577,6 +589,7 @@ export {
577
589
  udlToNpsState,
578
590
  enrichUdlFields,
579
591
  getSensorId,
592
+ getObsSatno,
580
593
  udlToNpsObs,
581
594
  udlToRadarObs,
582
595
  };