skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.38k stars 208 forks source link

some planets rise and sets not found #918

Closed dyk74 closed 5 months ago

dyk74 commented 7 months ago

Hello, I'm trying to calculate the rise and set for every planet on the Solar System but for some planets doesn't work (i.e Jupiter and Neptune). This is part of the code:

from skyfield import api from skyfield import almanac from datetime import datetime ts = api.load.timescale()

loc= api.wgs84.latlon([canceled], [canceled]) eph = api.load('de421.bsp') sun, earth = eph['sun'], eph['earth'] t0 = ts.utc(2023, 11, 17) t1 = ts.utc(2023, 11, 18) Jupiter=almanac.risings_and_settings(eph,eph['Jupiter'],loc) ==> the error is here... Jupiter_t,Jupiter_y=almanac.find_discrete(t0,t1,Jupiter)

Thank you

Bernmeister commented 7 months ago

Try swapping 'Jupiter' with 'JUPITER BARYCENTER'.

brandon-rhodes commented 7 months ago

@dyk74 — Could you be more specific about the problem you are seeing? Please either share the error message you are getting, or else explain how the output of your script differs from what you would like to see instead.

dyk74 commented 7 months ago

Hello, my project is to know when a planet is visible during the night. I mean after the sunset (or the planet rise) until the sunrise during a month; if the planet rise during the day and sets before the sunset the software will write "not visible" in the other case just only the visibility date/hour. Hoping it's clear :)

brandon-rhodes commented 5 months ago

@dyk74 — Could you be more specific about the problem you are seeing? The exact text of the error message is necessary, so that folks can see what the problem is and help you fix it.

brandon-rhodes commented 5 months ago

Since we have not been given the specific error message, we don't have enough information to address this issue, so I'm going to go ahead and close it for now. But please feel free to comment further here on the issue, even once it's closed, if you do find the error message text and would like to share it!