Skip to content

Commit

Permalink
Merge 33c30de into c726d15
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jan 7, 2021
2 parents c726d15 + 33c30de commit 4c0912d
Show file tree
Hide file tree
Showing 6 changed files with 338 additions and 1 deletion.
34 changes: 34 additions & 0 deletions test/io.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"tleLine1": "1 00001U 57001B 21005.53831292 -.00000083 00000-0 -11575-3 0 9996",
"tleLine2": "2 00001 34.2508 325.6936 1846988 181.8107 177.4919 00.00000000227203",
"description": "Mean motion is zero and that is not allowed.",
"results": [{
"error": 2
}]
},
{
"tleLine1": "1 00002U 57001B 21005.53831292 -.00000083 00000-0 -11575-3 0 9996",
"tleLine2": "2 00002 34.2508 325.6936 1846988 181.8107 177.4919 00.00000001227203",
"description": "Eccentricity is way too high because mean motion is nearly zero.",
"results": [{
"error": 3
}]
},
{
"tleLine1": "1 00004U 57001B 21005.53831292 -.00000083 00000-0 -11575-3 0 9996",
"tleLine2": "2 00004 34.2508 325.6936 9999999 181.8107 177.4919 10.84863720227203",
"description": "Mean motion is zero and that is not allowed.",
"results": [{
"error": 4
}]
},
{
"tleLine1": "1 00006U 57001B 21005.53831292 -.00000083 00000-0 -11575-3 0 9996",
"tleLine2": "2 00005 34.2508 325.6936 1846988 181.8107 177.4919 25.84863720227203",
"description": "Satellite should be decayed already.",
"results": [{
"error": 6
}]
}
]
9 changes: 8 additions & 1 deletion test/io.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import twoline2satrec from '../src/io'; // eslint-disable-line
import badTleData from './io.json';

describe('Twoline', () => {
it('twoline to satellite record', () => {
// TODO:
badTleData.forEach((tleDataItem) => {
const satrec = twoline2satrec(tleDataItem.tleLine1, tleDataItem.tleLine2);
tleDataItem.results.forEach((expected) => {
// Fetching satellite record from incorrectly formatted TLE lines
expect(satrec.error).toEqual(expected.error);
});
});
});
});
222 changes: 222 additions & 0 deletions test/propagation/dsinit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
[
{
"tleLine1": "1 00001U 57001B 21005.53831292 -.00000083 00000-0 -11575-3 0 9996",
"tleLine2": "2 00004 34.2508 325.6936 5000000 181.8107 177.4919 001.8999000000203",
"options": {
"argpm": 0,
"argpo": 3.1731953303556546,
"atime": 0,
"cosim": 0.8265818908073872,
"d2201": 0,
"d2211": 0,
"d3210": 0,
"d3222": 0,
"d4410": 0,
"d4422": 0,
"d5220": 0,
"d5232": 0,
"d5421": 0,
"d5433": 0,
"dedt": 0,
"del1": 0,
"del2": 0,
"del3": 0,
"didt": 0,
"dmdt": 0,
"dnodt": 0,
"domdt": 0,
"ecco": 0.5,
"eccsq": 0.25,
"em": 0.5,
"emsq": 0.25,
"gsto": 5.220883431349307,
"inclm": 0.5977892314420737,
"irez": 0,
"mdot": 0.008289877617360376,
"mm": 0,
"mo": 3.097818050620523,
"nm": 0.00828929401348305,
"no": 0.00828929401348305,
"nodedot": -0.0000010615465631002147,
"nodem": 0,
"nodeo": 5.684425672673404,
"s1": -0.0003758603820133531,
"s2": -0.00003340981173452028,
"s3": 0.000057867491395499995,
"s4": 0.00005011471760178041,
"s5": -0.0814586266145132,
"sinim": 0.5628164690103556,
"ss1": -0.0023400973145719425,
"ss2": -0.0002080086501841727,
"ss3": 0.0003602815505328084,
"ss4": 0.000312012975276259,
"ss5": -0.05506592822076295,
"sz1": 10.0266126658567,
"sz3": 11.96755448889018,
"sz11": -0.26695105200172087,
"sz13": 2.85835691924874,
"sz21": -0.10879395395455185,
"sz23": -0.9817900146669546,
"sz31": 3.2268633174603867,
"sz33": 5.297255866008874,
"t": 0,
"tc": 0,
"xfact": 0,
"xlamo": 0,
"xli": 0,
"xni": 0,
"xpidot": 4.898991347062741e-7,
"z1": 4.101694478238579,
"z3": 16.932733892867283,
"z11": 1.429557720331177,
"z13": 1.9707634473989213,
"z21": -1.4644752902058293,
"z23": 0.2884276608142515,
"z31": -0.8856293737107999,
"z33": 8.908977597159325
},
"results": {
"argpm": 0,
"atime": 0,
"d2201": -1.2099452515548102e-11,
"d2211": 1.0011506195793891e-11,
"d3210": -5.0866898135037016e-12,
"d3222": -3.987984720569471e-13,
"d4410": 4.109492519702797e-13,
"d4422": 9.349618846253649e-14,
"d5220": 2.4097891471717693e-13,
"d5232": 1.6478793629942387e-13,
"d5421": -2.138743302011661e-13,
"d5433": -9.311246040525512e-15,
"dedt": 6.387624124699951e-9,
"del1": 0,
"del2": 0,
"del3": 0,
"didt": -2.4428711570103973e-8,
"dmdt": -7.866458523057076e-8,
"dndt": 0,
"dnodt": -1.5869893761619698e-8,
"domdt": 3.8582690952174514e-8,
"em": 0.5,
"inclm": 0.5977892314420737,
"irez": 2,
"mm": 0,
"nm": 0.00828929401348305,
"nodem": 0,
"xfact": -0.008752188069644229,
"xlamo": 4.024902533268717,
"xli": 4.024902533268717,
"xni": 0.00828929401348305
}
},
{
"tleLine1": "1 00001U 57001B 21005.53831292 -.00000083 00000-0 -11575-3 0 9996",
"tleLine2": "2 00004 34.2508 325.6936 9000000 181.8107 177.4919 001.8999000000203",
"options": {
"argpm": 0,
"argpo": 3.1731953303556546,
"atime": 0,
"cosim": 0.8265818908073872,
"d2201": 0,
"d2211": 0,
"d3210": 0,
"d3222": 0,
"d4410": 0,
"d4422": 0,
"d5220": 0,
"d5232": 0,
"d5421": 0,
"d5433": 0,
"dedt": 0,
"del1": 0,
"del2": 0,
"del3": 0,
"didt": 0,
"dmdt": 0,
"dnodt": 0,
"domdt": 0,
"ecco": 0.9,
"eccsq": 0.81,
"em": 0.9,
"emsq": 0.81,
"gsto": 5.220883431349307,
"inclm": 0.5977892314420737,
"irez": 0,
"mdot": 0.008289882914214362,
"mm": 0,
"mo": 3.097818050620523,
"nm": 0.008285301381233555,
"no": 0.008285301381233555,
"nodedot": -0.000016615977679572516,
"nodem": 0,
"nodeo": 5.684425672673404,
"s1": -0.00034068613392845755,
"s2": -0.0000664105524227013,
"s3": 0.000057895377359053036,
"s4": 0.000025236009920626485,
"s5": -0.0814586266145132,
"sinim": 0.5628164690103556,
"ss1": -0.0021211033279095576,
"ss2": -0.00041347043429036223,
"ss3": 0.00036045516784271263,
"ss4": 0.0001571187650303376,
"ss5": -0.05506592822076295,
"sz1": 11.833656123634515,
"sz3": 14.934017773855151,
"sz11": -0.559025056566349,
"sz13": 6.1122684947234225,
"sz21": -0.012026488033904603,
"sz23": -0.41905685490385947,
"sz31": 3.2268633174603867,
"sz33": 5.297255866008874,
"t": 0,
"tc": 0,
"xfact": 0,
"xlamo": 0,
"xli": 0,
"xni": 0,
"xpidot": 0.000007654165958004881,
"z1": 3.6057420289605315,
"z3": 21.9217613472765,
"z11": 3.1143324610298544,
"z13": 4.157342147158473,
"z21": -0.4580055602764077,
"z23": -0.042575346093936206,
"z31": -0.8856293737107999,
"z33": 8.908977597159325
},
"results": {
"argpm": 0,
"atime": 0,
"d2201": -2.077924583398718e-11,
"d2211": 8.354983905797916e-11,
"d3210": -7.971726821781479e-11,
"d3222": -1.5879590871766552e-11,
"d4410": 1.5757473446619235e-11,
"d4422": 7.56870174312408e-12,
"d5220": 3.642170086460131e-11,
"d5232": 6.090615241770774e-11,
"d5421": -4.636788210900563e-11,
"d5433": -5.740340181834411e-12,
"dedt": 5.789849295568645e-9,
"del1": 0,
"del2": 0,
"del3": 0,
"didt": -1.0389979451500435e-7,
"dmdt": -9.517687076400692e-8,
"dndt": 0,
"dnodt": -1.3136567693239499e-8,
"domdt": 2.3681689509031805e-8,
"em": 0.9,
"inclm": 0.5977892314420737,
"irez": 2,
"mm": 0,
"nm": 0.008285301381233555,
"nodem": 0,
"xfact": -0.00877931004840709,
"xlamo": 4.024902533268717,
"xli": 4.024902533268717,
"xni": 0.008285301381233555
}
}
]
11 changes: 11 additions & 0 deletions test/propagation/dsinit.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import dsinit from "../../src/propagation/dsinit"; // eslint-disable-line
import dsOptionSets from './dsinit.json';

describe('Initialize Resonance Terms', () => {
it('Geopotential Resonance for 12 Hour Orbits', () => {
dsOptionSets.forEach((testSet) => {
const results = dsinit(testSet.options);
expect(results).toEqual(testSet.results);
});
});
});
31 changes: 31 additions & 0 deletions test/propagation/initl.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import initl from '../../src/propagation/initl'; // eslint-disable-line

describe('Propagator Initialization', () => {
it('Legacy Sidereal Time Calculations', () => {
const options = {
ecco: 0.1846988,
epoch: 25938.538312919904,
inclo: 0,
method: 'n',
no: 0.0037028783237264057,
opsmode: 'a',
satn: '00001',
};
const results = initl(options);
expect(results.ainv).toEqual(0.1353414893496189);
expect(results.ao).toEqual(7.3887172721793);
expect(results.con41).toEqual(2);
expect(results.con42).toEqual(-4);
expect(results.cosio).toEqual(1);
expect(results.cosio2).toEqual(1);
expect(results.eccsq).toEqual(0.034113646721439995);
expect(results.gsto).toEqual(5.220883431398299);
expect(results.method).toEqual('n');
expect(results.no).toEqual(0.003702762286531528);
expect(results.omeosq).toEqual(0.96588635327856);
expect(results.posq).toEqual(50.931932818552305);
expect(results.rp).toEqual(6.02403005846851);
expect(results.rteosq).toEqual(0.9827951736137902);
expect(results.sinio).toEqual(0);
});
});
32 changes: 32 additions & 0 deletions test/propagation/sgp4.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,36 @@
"z": 0.284603946
}
}]
}, {
"tleLine1": "1 35009U 09029B 20211.00610242 .02277784 -35844-4 26606-3 0 9997",
"tleLine2": "2 35009 63.2954 149.0177 7112622 249.4396 25.6425 2.59932820 95205",
"results": [{
"time": 0.0,
"position": {
"x": -12653.51813495988,
"y": 7594.314114280105,
"z": 0.06400625597441757
},
"velocity": {
"x": -4.461734922545598,
"y": 0.31971388450669386,
"z": 4.022200806172491
}
}]
}, {
"tleLine1": "1 00005U 58002B 21005.53831292 -.00000083 00000-0 -11575-3 0 9996",
"tleLine2": "2 00005 180.0000 325.6936 1846988 181.8107 177.4919 10.84863720227203",
"results": [{
"time": 0.0,
"position": {
"x": 8426.147415794167,
"y": -5761.018919510716,
"z": 1.1836170303804414e-15
},
"velocity": {
"x": -3.154518844384156,
"y": -4.683223976820316,
"z": 6.914910726640889e-16
}
}]
}]

0 comments on commit 4c0912d

Please sign in to comment.