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.

How to determine how long Earth Satellite has been eclipsed?

See original GitHub issue

I have a long history with PyEphem but I’m still getting used to Skyfield, and have been working on transitioning for years 😃

I have a simple PyEphem script which will tell me whether a satellite is currently eclipsed, and in either case, how long it has been in its current state. I want to use this for the sake of checking the thermals and battery voltages of a satellite currently on-orbit (having sun timing context is useful for making sure these values are nominal).

In PyEphem, the script looks like (abbreviated):

    rise_time, rise_azimuth, max_alt_time, max_alt, set_time, set_azimuth=groundstation.next_pass(satellite)
    initial_eclipse_status = satellite.eclipsed
    while(satellite.eclipsed == initial_eclipse_status):
        #Step back one second and recompute, until we find a change.
        eclipse_time -= ephem.second
        satellite.compute(eclipse_time)
   time_since_eclipse_change = rise_time - eclipse_time

Now the initial eclipse status and the time difference tells me everything I’m looking for.

In Skyfield, I can’t seem to find any such method for stepping back in time until it changes. The closest I can do is:

    sf_risetime_past_hour = ts.utc(*list(sf_risetime.tt_calendar()[:-1]),range(-3600,0,60))
    illum_array = sf_satellite.at(sf_risetime_past_hour).is_sunlit(eph)
    print(illum_array)

So once I know a rise time, I can step back for the past hour and check for any changes, but this is a little more clunky, and if the last change in eclipse was over an hour ago (my PyEphem solution is telling me that a particular pass I’m interested in will have been sunlit for 274 minutes continously), I learn nothing. Is there a way to do the Skyfield solution in a manner which would be as flexible as PyEphem?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
bismurphycommented, Jul 17, 2020

Go ahead and close the issue.

Thanks everyone for the massive learning experience! I got way more than I bargained for 😃

1reaction
brandon-rhodescommented, Jul 17, 2020

Thanks for all of the great diagrams, @glangford!

@tj-murphy — At this point is this issue answered to your satisfaction, or do you have further lingering questions we could address?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Computation of Eclipse Time for Low-Earth Orbiting Small ...
The following method uses JPL DE405 Ephemeris data to compute the eclipse duration.
Read more >
How to calculate GEO (geostationary) satellite eclipse time?
Since the Earth's equator is inclined so far from the ecliptic, this eclipsing depends on the time of year as well. Are there...
Read more >
WeekAM.pdf - NASA Space Math
In this activity, students will examine the orbits of three satellites and from their speeds and the size of Earth's shadow, calculate how...
Read more >
Flight and Orbital Mechanics - TU Delft OpenCourseWare
Whether the satellite is in eclipse (Earth shadow) or not is now fully determined by 2 parameters: Ψ and S. The (requirement on...
Read more >
Tracking Satellites Through GEOSat Eclipse Season
You can spot 'GEOSat' satellites in far-flung orbits… if you know exactly where and ... As of 2020, 554 satellites have been placed...
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