diff --git a/test/objects/Satellite.test.ts b/test/objects/Satellite.test.ts index 1d96575..136eae6 100644 --- a/test/objects/Satellite.test.ts +++ b/test/objects/Satellite.test.ts @@ -31,14 +31,6 @@ describe('Basic Satellite functionality', () => { expect(sat.satrec).toBeDefined(); }); - it('should allow chaining', () => { - const eci = new Satellite({ name: 'Test', tle1, tle2 }).propagateTo(dateObj).eci().position; - - expect(eci.x).toBeCloseTo(6512.640035319078); - expect(eci.y).toBeCloseTo(-1545.524934684146); - expect(eci.z).toBeCloseTo(-1195.219347050479); - }); - it('should allow getting eci coordinates', () => { const sat = new Satellite({ name: 'Test', tle1, tle2 }); @@ -94,16 +86,9 @@ describe('Satellite', () => { expect(satellite).toMatchSnapshot(); }); - // can propagate to a given date - it('should propagate Satellite to a given date', () => { - satellite.propagateTo(exampleDate); - - expect(satellite).toMatchSnapshot(); - }); - // can calculate and return RAE coordinates it('should calculate and return RAE coordinates', () => { - const rae = satellite.rae(observer); + const rae = satellite.rae(observer, exampleDate); expect(rae).toMatchSnapshot(); }); diff --git a/test/objects/__snapshots__/Satellite.test.ts.snap b/test/objects/__snapshots__/Satellite.test.ts.snap index c3da6d3..e30aa35 100644 --- a/test/objects/__snapshots__/Satellite.test.ts.snap +++ b/test/objects/__snapshots__/Satellite.test.ts.snap @@ -59,15 +59,15 @@ Object { exports[`Satellite should calculate and return RAE coordinates 1`] = ` RAE { - "azimuth": 6.113212092185137, - "azimuthRate": -0.053738284359553745, - "elevation": -0.8739811433607586, - "elevationRate": -0.017615972911599442, + "azimuth": 1.3489093210949852, + "azimuthRate": 0.031044709157512784, + "elevation": -1.2837885129141846, + "elevationRate": -0.03103994353789119, "epoch": EpochUTC { - "posix": 1705169134155, + "posix": 1705109326817, }, - "range": 10316.599142891455, - "rangeRate": 2.3827483072818723, + "range": 12650.301530537545, + "rangeRate": 1.8799097918581538, } `; @@ -244,172 +244,6 @@ Satellite { "sccNum6": "25544", "semiMajorAxis": 6794.6691566357185, "semiMinorAxis": 6794.668249267928, - "time": 2024-01-13T18:05:34.152Z, - "tle1": "1 25544U 98067A 22203.46960946 .00003068 00000+0 61583-4 0 9996", - "tle2": "2 25544 51.6415 161.8339 0005168 35.9781 54.7009 15.50067047350657", - "totalVelocity": 0, - "type": 0, - "velocity": Object { - "x": 0, - "y": 0, - "z": 0, - }, -} -`; - -exports[`Satellite should propagate Satellite to a given date 1`] = ` -Satellite { - "active": true, - "apogee": 427.1806416558675, - "argOfPerigee": 35.9781, - "bstar": 0.000061583, - "eccentricity": 0.0005168, - "epochDay": 203.46960946, - "epochYear": 22, - "id": undefined, - "inclination": 51.6415, - "intlDes": "98067A", - "meanAnomaly": 54.7009, - "meanMoDev1": 0.00003068, - "meanMoDev2": 0, - "meanMotion": 15.50067047, - "name": "Unknown", - "options": Object { - "notes": "", - }, - "perigee": 420.1576716155696, - "period": 92.89920734635164, - "position": Object { - "x": -5512.260085235448, - "y": -2430.686090702759, - "z": -3117.140819332331, - }, - "rightAscension": 161.8339, - "satrec": Object { - "Om": null, - "PInco": 0, - "a": 1.0653855229682034, - "alta": 0.06593611420647338, - "altp": 0.06483493172993349, - "am": null, - "argpdot": 0.00004469391640450765, - "argpo": 0.6279363036117719, - "atime": 0, - "aycof": 0.0009194351859734261, - "bstar": 0.000061583, - "cc1": 1.054843477494549e-9, - "cc4": 0.0000010146140032928037, - "cc5": 0.000502156969435659, - "con41": 0.1553585313770025, - "d2": 8.920486693245565e-17, - "d2201": 0, - "d2211": 0, - "d3": 1.1284305919522795e-23, - "d3210": 0, - "d3222": 0, - "d4": 1.664351729935925e-30, - "d4410": 0, - "d4422": 0, - "d5220": 0, - "d5232": 0, - "d5421": 0, - "d5433": 0, - "dedt": 0, - "del1": 0, - "del2": 0, - "del3": 0, - "delmo": 1.0180635988014979, - "didt": 0, - "dmdt": 0, - "dnodt": 0, - "domdt": 0, - "e3": 0, - "ecco": 0.0005168, - "ee2": 0, - "em": null, - "epochdays": 203.46960946, - "epochyr": 22, - "error": 0, - "eta": 0.010357978846619898, - "gsto": 1.9068261868288872, - "im": null, - "inclo": 0.9013142056686517, - "init": "n", - "irez": 0, - "isimp": 0, - "j2": 0.001082616, - "j3": -0.00000253881, - "j3oj2": -0.002345069720011528, - "j4": -0.00000165597, - "jdsatepoch": 2459782.96960946, - "mdot": 0.06763444178039692, - "method": "n", - "mm": null, - "mo": 0.9547108088041661, - "mus": 398600.8, - "nddot": 0, - "ndot": 0.00003068, - "nm": null, - "no": 0.06762691649010695, - "nodecf": -2.2167955787538495e-13, - "nodedot": -0.00006007612419537387, - "nodeo": 2.8245343963432514, - "om": null, - "omgcof": 1.0625960227343085e-7, - "operationmode": "i", - "peo": 0, - "pgho": 0, - "pho": 0, - "plo": 0, - "radiusearthkm": 6378.135, - "satnum": "25544", - "se2": 0, - "se3": 0, - "sgh2": 0, - "sgh3": 0, - "sgh4": 0, - "sh2": 0, - "sh3": 0, - "si2": 0, - "si3": 0, - "sinmao": 0.8161466669458108, - "sl2": 0, - "sl3": 0, - "sl4": 0, - "t": 777012.542661354, - "t2cof": 1.5822652162418235e-9, - "t3cof": 9.143025645648123e-17, - "t4cof": 8.748455252805885e-24, - "t5cof": 1.0373269324942988e-30, - "tumin": 13.446839696959309, - "x1mth2": 0.6148804895409992, - "x7thm1": 1.6958365732130058, - "xfact": 0, - "xgh2": 0, - "xgh3": 0, - "xgh4": 0, - "xh2": 0, - "xh3": 0, - "xi2": 0, - "xi3": 0, - "xke": 0.07436691613317342, - "xl2": 0, - "xl3": 0, - "xl4": 0, - "xlamo": 0, - "xlcof": 0.0017312384987971355, - "xli": 0, - "xmcof": -0.001806247608164991, - "xni": 0, - "zmol": 0, - "zmos": 0, - }, - "sccNum": "25544", - "sccNum5": "25544", - "sccNum6": "25544", - "semiMajorAxis": 6794.6691566357185, - "semiMinorAxis": 6794.668249267928, - "time": 2024-01-13T01:28:46.817Z, "tle1": "1 25544U 98067A 22203.46960946 .00003068 00000+0 61583-4 0 9996", "tle2": "2 25544 51.6415 161.8339 0005168 35.9781 54.7009 15.50067047350657", "totalVelocity": 0,