@saber-usa/node-common 1.7.25 → 1.7.27
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 +12 -11
- package/src/astro.js +75 -0
- package/src/udl.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saber-usa/node-common",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.27",
|
|
4
4
|
"description": "Common node functions for Saber",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"author": "Saber USA",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@aws-sdk/client-s3": "^3.
|
|
26
|
+
"@aws-sdk/client-s3": "^3.1084.0",
|
|
27
27
|
"date-fns": "^4.4.0",
|
|
28
28
|
"lodash": "4.18.1",
|
|
29
29
|
"mathjs": "^15.2.0",
|
|
@@ -31,20 +31,21 @@
|
|
|
31
31
|
"plotly": "^1.0.6",
|
|
32
32
|
"satellite.js": "^7.0.1",
|
|
33
33
|
"solar-calculator": "^0.3.0",
|
|
34
|
-
"three": "^0.
|
|
34
|
+
"three": "^0.185.1",
|
|
35
35
|
"winston": "3.19.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@babel/
|
|
38
|
+
"@babel/core": "^8.0.1",
|
|
39
|
+
"@babel/preset-env": "^8.0.2",
|
|
39
40
|
"@eslint/js": "^10.0.1",
|
|
40
|
-
"@jest/globals": "^30.
|
|
41
|
-
"@sonar/scan": "^4.3.
|
|
41
|
+
"@jest/globals": "^30.4.1",
|
|
42
|
+
"@sonar/scan": "^4.3.8",
|
|
42
43
|
"cross-env": "^10.1.0",
|
|
43
|
-
"eslint": "^10.
|
|
44
|
-
"eslint-plugin-jest": "^29.15.
|
|
45
|
-
"globals": "^17.
|
|
46
|
-
"jest": "^30.
|
|
47
|
-
"jest-diff": "^30.
|
|
44
|
+
"eslint": "^10.6.0",
|
|
45
|
+
"eslint-plugin-jest": "^29.15.4",
|
|
46
|
+
"globals": "^17.7.0",
|
|
47
|
+
"jest": "^30.4.2",
|
|
48
|
+
"jest-diff": "^30.4.1",
|
|
48
49
|
"nodemon": "3.1.14"
|
|
49
50
|
},
|
|
50
51
|
"overrides": {
|
package/src/astro.js
CHANGED
|
@@ -1779,6 +1779,79 @@ const cartesianToElsetElements = (pv, epoch) => {
|
|
|
1779
1779
|
return elset;
|
|
1780
1780
|
};
|
|
1781
1781
|
|
|
1782
|
+
/**
|
|
1783
|
+
* Geodetic longitude and drift from propagated P/V at two times one day apart.
|
|
1784
|
+
* @param {Object} pvAtT satellite.js-style position/velocity at gmstTime (km, km/s)
|
|
1785
|
+
* @param {Object} pvAtTPlusOneDay position/velocity at gmst2Time
|
|
1786
|
+
* @param {Date|number} gmstTime passed to gstime for the first geodetic conversion
|
|
1787
|
+
* @param {Date|number} gmst2Time passed to gstime for the second geodetic conversion
|
|
1788
|
+
* @return {Object} latitude, longitude, longitude360, lonDriftDegreesPerDay
|
|
1789
|
+
*/
|
|
1790
|
+
const getLonAndDriftFromPv = (pvAtT, pvAtTPlusOneDay, gmstTime, gmst2Time) => {
|
|
1791
|
+
try {
|
|
1792
|
+
const gmst = gstime(gmstTime);
|
|
1793
|
+
const gmst2 = gstime(gmst2Time);
|
|
1794
|
+
|
|
1795
|
+
const positionGd = eciToGeodetic(pvAtT.position, gmst);
|
|
1796
|
+
const positionGd2 = eciToGeodetic(pvAtTPlusOneDay.position, gmst2);
|
|
1797
|
+
|
|
1798
|
+
const lon = degreesLong(positionGd.longitude);
|
|
1799
|
+
const lon2 = degreesLong(positionGd2.longitude);
|
|
1800
|
+
const lat = degreesLat(positionGd.latitude);
|
|
1801
|
+
|
|
1802
|
+
let diff = lon2 - lon;
|
|
1803
|
+
if (diff < -180) {
|
|
1804
|
+
diff = (diff % 180) + 180;
|
|
1805
|
+
} else if (diff > 180) {
|
|
1806
|
+
diff = (diff % 180) - 180;
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
return {
|
|
1810
|
+
latitude: lat,
|
|
1811
|
+
longitude: lon,
|
|
1812
|
+
longitude360: (lon + 360) % 360,
|
|
1813
|
+
lonDriftDegreesPerDay: diff,
|
|
1814
|
+
};
|
|
1815
|
+
} catch (e) {
|
|
1816
|
+
console.error(e);
|
|
1817
|
+
return {
|
|
1818
|
+
latitude: 0,
|
|
1819
|
+
longitude: 0,
|
|
1820
|
+
longitude360: 0,
|
|
1821
|
+
lonDriftDegreesPerDay: 0,
|
|
1822
|
+
};
|
|
1823
|
+
}
|
|
1824
|
+
};
|
|
1825
|
+
|
|
1826
|
+
/**
|
|
1827
|
+
* Osculating RAAN precession (deg/day) from P/V one day apart.
|
|
1828
|
+
* @param {Object} pvAtT satellite.js-style position/velocity (km, km/s)
|
|
1829
|
+
* @param {Object} pvAtTPlusOneDay position/velocity one day later
|
|
1830
|
+
* @return {number} RAAN drift in degrees per day
|
|
1831
|
+
*/
|
|
1832
|
+
const getOsculatingRaanPrecessionFromPv = (pvAtT, pvAtTPlusOneDay) => {
|
|
1833
|
+
try {
|
|
1834
|
+
const kepl = cartesianToKeplerian(
|
|
1835
|
+
multiply(posToArray(pvAtT.position), 1000),
|
|
1836
|
+
multiply(posToArray(pvAtT.velocity), 1000),
|
|
1837
|
+
);
|
|
1838
|
+
const kepl2 = cartesianToKeplerian(
|
|
1839
|
+
multiply(posToArray(pvAtTPlusOneDay.position), 1000),
|
|
1840
|
+
multiply(posToArray(pvAtTPlusOneDay.velocity), 1000),
|
|
1841
|
+
);
|
|
1842
|
+
let diff = kepl2.raan - kepl.raan;
|
|
1843
|
+
if (diff < -180) {
|
|
1844
|
+
diff += 360;
|
|
1845
|
+
} else if (diff > 180) {
|
|
1846
|
+
diff -= 360;
|
|
1847
|
+
}
|
|
1848
|
+
return diff;
|
|
1849
|
+
} catch (e) {
|
|
1850
|
+
console.error(e);
|
|
1851
|
+
return 0;
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
|
|
1782
1855
|
/**
|
|
1783
1856
|
* Get LEO RPO data for a given target satellite and a set of potential threat satellites.
|
|
1784
1857
|
* @param {String} line1, line 1 of the target satellite
|
|
@@ -3524,6 +3597,8 @@ export {
|
|
|
3524
3597
|
getTRIC,
|
|
3525
3598
|
getSunDirection,
|
|
3526
3599
|
getLonAndDrift,
|
|
3600
|
+
getLonAndDriftFromPv,
|
|
3601
|
+
getOsculatingRaanPrecessionFromPv,
|
|
3527
3602
|
getRaanPrecession,
|
|
3528
3603
|
checkTle,
|
|
3529
3604
|
validateTle,
|
package/src/udl.js
CHANGED
|
@@ -121,7 +121,7 @@ const udlToNpsConjunction = (udlRow) => {
|
|
|
121
121
|
SatNo1: satno1,
|
|
122
122
|
SatNo2: satno2,
|
|
123
123
|
Type: _.get(udlRow, "type", null),
|
|
124
|
-
Tca:
|
|
124
|
+
Tca: _.get(udlRow, "tca", null),
|
|
125
125
|
MissDistance: _.get(udlRow, "missDistance", null),
|
|
126
126
|
CollisionProb: _.get(udlRow, "collisionProb", null),
|
|
127
127
|
CollisionProbMethod: _.get(udlRow, "collisionProbMethod", null),
|
|
@@ -143,14 +143,14 @@ const udlToNpsConjunction = (udlRow) => {
|
|
|
143
143
|
HardBodyRadius: _.get(udlRow, "hardBodyRadius", null),
|
|
144
144
|
HardBodyRadiusShape: _.get(udlRow, "hardBodyRadiusShape", null),
|
|
145
145
|
PocDilution: _.get(udlRow, "pocDilution", null),
|
|
146
|
-
ScreenEntryTime:
|
|
147
|
-
ScreenExitTime:
|
|
146
|
+
ScreenEntryTime: _.get(udlRow, "screenEntryTime", null),
|
|
147
|
+
ScreenExitTime: _.get(udlRow, "screenExitTime", null),
|
|
148
148
|
ScreenVolumeX: _.get(udlRow, "screenVolumeX", null),
|
|
149
149
|
ScreenVolumeY: _.get(udlRow, "screenVolumeY", null),
|
|
150
150
|
ScreenVolumeZ: _.get(udlRow, "screenVolumeZ", null),
|
|
151
151
|
VolShape: _.get(udlRow, "volShape", null),
|
|
152
|
-
VolEntryTime:
|
|
153
|
-
VolExitTime:
|
|
152
|
+
VolEntryTime: _.get(udlRow, "volEntryTime", null),
|
|
153
|
+
VolExitTime: _.get(udlRow, "volExitTime", null),
|
|
154
154
|
PenetrationLevelSigma: _.get(udlRow, "penetrationLevelSigma", null),
|
|
155
155
|
CdAoM1: _.get(udlRow, "cdAoM1", null),
|
|
156
156
|
CrAoM1: _.get(udlRow, "crAoM1", null),
|