You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
From my local comparison, equal calculations of position using ootk vs satellite.js are ~2x slower on ootk.
To Reproduce
Preparation code on ootk:
import*asootkfrom'ootk'import*assatellitefrom'satellite.js'const{ degreesToRadians }=satellite;// the only thing needed from satellite.jsconstTLE: Array<[string,string,string]>=[];// here, each item is 3 strings of a three-line element setconstsatellites=TLE.map((tle)=>{constname=tle[0].slice(2)returnnewootk.Satellite({ name,tle1: tle[1]asootk.TleLine1,tle2: tle[2]asootk.TleLine2})}).filter(sat=>sat.satrec.error===0)// tried to get the least restrictive min/max values here to not filter satellites at allconstsensor=newootk.Sensor({alt: location.altitudeasootk.Kilometers,lat: location.latitudeasootk.Degrees,lon: location.longitudeasootk.Degrees,maxAz: 360asootk.Degrees,maxEl: 180asootk.Degrees,maxRng: Infinityasootk.Kilometers,minAz: 0asootk.Degrees,minEl: 0asootk.Degrees,minRng: 0asootk.Kilometers,})
import*assatellitefrom'satellite.js'constTLE: Array<[string,string,string]>=[];// here, each item is 3 strings of a three-line element set as aboveconstsatRecs=TLE.map(tle=>satellite.twoline2satrec(tle[1],tle[2])).filter(satRec=>satRec.error===0)constgmst=satellite.gstime(date)constlocationForLib={longitude: satellite.degreesToRadians(location.longitude),latitude: satellite.degreesToRadians(location.latitude),height: location.altitude/1000}
Describe the bug
From my local comparison, equal calculations of position using
ootk
vssatellite.js
are ~2x slower onootk
.To Reproduce
Preparation code on
ootk
:Code to measure using
ootk
:Preparation code on
satellite.js
:Code to measure using
satellite.js
With full space-track database, takes about 150-160 ms on
ootk
vs 80 ms onsatellite.js
on my machine.Expected behavior
Performance is about the same or even better, considering less function calls from client code for
ootk
.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: