@saber-usa/node-common 1.7.9-alpha.1 → 1.7.9-alpha.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saber-usa/node-common",
3
- "version": "1.7.9-alpha.1",
3
+ "version": "1.7.9-alpha.3",
4
4
  "description": "Common node functions for Saber",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -29,9 +29,9 @@
29
29
  "winston": "3.3.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/core": "7.16.0",
33
- "@babel/eslint-parser": "7.16.3",
34
- "@babel/plugin-transform-modules-commonjs": "7.16.0",
32
+ "@babel/core": "7.23.0",
33
+ "@babel/eslint-parser": "^7.23.0",
34
+ "@babel/plugin-transform-modules-commonjs": "7.23.0",
35
35
  "@jest/globals": "27.4.4",
36
36
  "eslint-config-google": "0.14.0",
37
37
  "eslint-plugin-jest": "25.3.0",
package/src/astro.js CHANGED
@@ -1057,6 +1057,16 @@ const RaDecToGeodetic = (
1057
1057
  * @return {Number} range The range from the sensor to the satellite
1058
1058
  */
1059
1059
  const estimateSlantRange = (obTime, ra, dec, senLat, senLon, senAltKm) => {
1060
+ // check for nulls
1061
+ if (!isDefined(obTime)
1062
+ || !isDefined(ra)
1063
+ || !isDefined(dec)
1064
+ || !isDefined(senLat)
1065
+ || !isDefined(senLon)
1066
+ || !isDefined(senAltKm)) {
1067
+ return null;
1068
+ }
1069
+
1060
1070
  // A very rough initial guess, akso initialization
1061
1071
  let range = 35786;
1062
1072
 
package/src/udl.js CHANGED
@@ -195,8 +195,12 @@ const enrichGeoLon = (npsOb, enrichedFields) => {
195
195
  );
196
196
  npsOb.GeoLon = geodetic.Longitude;
197
197
  npsOb.GeoLat = geodetic.Latitude;
198
- npsOb.GeoRange = slantRange;
199
- if (!npsOb.Range && !npsOb.GeoRange) enrichedFields.push("GeoRange");
198
+
199
+ if (typeof slantRange === "number" && !isNaN(slantRange)) {
200
+ if (!npsOb.Range && !npsOb.GeoRange) enrichedFields.push("GeoRange");
201
+ npsOb.GeoRange = slantRange;
202
+ }
203
+
200
204
  if (npsOb.GeoLon) enrichedFields.push("GeoLon");
201
205
  if (npsOb.GeoLat) enrichedFields.push("GeoLat");
202
206
  return enrichedFields;