question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

observerCoordsEcf, velocityEcf not defined

See original GitHub issue

Example in README references:

dopplerFactor = satellite.dopplerFactor(observerCoordsEcf, positionEcf, velocityEcf);

But neither of observerCoordsEcf or velocityEcf appear to be available.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ericsvendsencommented, Mar 3, 2022

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 - ecf.x,
        y: ecfMoved.y - ecf.y,
        z: ecfMoved.z - ecf.z,
    };
}
0reactions
thkruzcommented, Mar 4, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Earth-centered, Earth-fixed coordinate system - Wikipedia
The Earth-centered, Earth-fixed coordinate system (acronym ECEF), also known as the geocentric coordinate system, is a cartesian spatial reference system ...
Read more >
Reference Frames Coordinate Systems - NASA / NAIF
observation geometry. ... A reference frame (or simply “frame”) is specified by an ... Velocity is typically non-zero, but acceleration is negligible.
Read more >
Orbital Coordinate Systems, Part I - CelesTrak
Inertial, in this context, simply means that the coordinate system is not accelerating (rotating). In other words, it is 'fixed' in space relative...
Read more >
A Simple and Precise Approach to Position and Velocity ...
This document outlines how to estimate, with up to 10cm precision, the position and velocity of a satellite at arbitrary times using sampled...
Read more >
Frequently Asked Questions | STK Components for .NET 2022 r2
Note that STK Components may not be able to calculate the order you request, ... a specified latitude boundary in either the ECI...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found