Comments (7)
I realize this issue thread is really old, but thought I would post my solution here for calculating ECF velocity in case others have the same question. If accuracy is vital and you're able to track down and decipher the math mentioned above, then great! I was not though, and this seemed to worked out pretty well for me. :)
Basically, you can determine ecf velocity using the eci data that satellite.js provides via the propagate
or sgp4
methods (Note: I'm using dayjs elsewhere in my project, so that's why I'm using it here in this example. It is certainly not required)
const now = dayjs(); // date/time right now
const pv = propagate(satrec, now.toDate()); // eci position and velocity for a given satrec
if (pv.position && pv.velocity) {
const ecfPosition = eciToEcf(pv.position, gstime(now.toDate())); // convert eci position to ecf
const ecfMoved = eciToEcf( // add eci velocity to eci position, and convert the result to ecf
{
x: pv.position.x + pv.velocity.x,
y: pv.position.y + pv.velocity.y,
z: pv.position.z + pv.velocity.z,
},
gstime(now.add(1, 'second').toDate()) // be sure to use a time 1 second later, since velocity is km/s
);
const ecfVelocity = { // subtract original ecf from ecfMoved to obtain velocity in ecf
x: ecfMoved.x - ecfPosition.x,
y: ecfMoved.y - ecfPosition.y,
z: ecfMoved.z - ecfPosition.z,
};
}
from satellite-js.
I apologize for the extreme delay in response.
You will have to define those yourself using the functions described in the README.
from satellite-js.
The readme code doesn't quite run. velocityEcf and observerCoordsEcf just aren't defined.
velocityEcf = satellite.eciToEcf(velocityEci, gmst);
dopplerFactor = satellite.dopplerFactor(observerEcf, positionEcf, velocityEcf);
from satellite-js.
Recommend using Eci for the dopplerFactor example in the readme. There is no available function to convert velocityEci to velocityEcf and the readme already explains you can use ecf if you have those values.
from satellite-js.
satellite.eciToEcf converts it
from satellite-js.
It converts ECI Position but it doesn't convert ECI Velocity because it doesn't account for the rotation of the earth.
There is a reference at http://www.dtic.mil/dtic/tr/fulltext/u2/a015815.pdf on page 29 and 30 that explains the math to convert ECI Velocity to ECF Velocity.
from satellite-js.
Slick idea. That should actually account for the rotation of the earth perfectly. Feels super obvious now that you post it - thanks for helping out!
from satellite-js.
Related Issues (20)
- Does satellite.js provide a way to determine if a satellite is above a ground station? HOT 2
- ecfToEci not defined in index.d.ts HOT 1
- TLE Errors - CelesTrak data now at https://celestrak.org HOT 1
- Two Errors in Existing Implementation HOT 8
- Detail units in README HOT 1
- Possible issue with accuracy HOT 5
- Non-LEO orbits do not properly display HOT 2
- Idea: WASM version of the library? HOT 10
- Cannot read properties of undefined (reading 'twoline2satrec') HOT 2
- How can I get the time for when a satellite will be over the antemeridian again? HOT 2
- Feature request: sgp4-xp HOT 3
- jday not in index.d.ts HOT 3
- Error in calculating the Doppler Factor. HOT 5
- Vulnerabilities in devDependencies
- unable to import in node.js
- Uncaught (in promise) TypeError: longstr1 is undefined
- satellite.min.js HOT 4
- Getting lat/lon for a whole day. HOT 7
- Dates can effect propagation drasitically HOT 7
- In cesuim, I want draw the orbit of the satellite,in ECI Coordinate systemใ HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from satellite-js.