Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty meridian transit time #612

Open
libre-hackerman opened this issue Jan 9, 2025 · 0 comments
Open

Empty meridian transit time #612

libre-hackerman opened this issue Jan 9, 2025 · 0 comments

Comments

@libre-hackerman
Copy link

libre-hackerman commented Jan 9, 2025

Hi, I'm building a visual observing planner and I'm trying to get meridian transit times. For DSOs and planets I'm getting no issues, but if I try creating a FixedTarget from the SkyCoord returned by astropy's get_body (like I do for the planets), I get a wrong transit time. So researching, I found astroplan uses a special target for the Moon: MoonFlag, and replacing the FixedTarget with MoonFlag I got the right result (at least for tonight). But testing another date, it would return and empty Time object. Here's a sample code to reproduce the problem:

import astropy.units as u
from astroplan import Observer
from astropy.time import Time
from astroplan.target import MoonFlag

place = Observer(latitude=40.41*u.deg,
                 longitude=-3.7*u.deg,
                 elevation=650*u.m,
                 name='Madrid',
                 timezone='Europe/Madrid')

t = Time('2025-06-11 00:14:21.664266')
meridian_time = place.target_meridian_transit_time(t, MoonFlag)
# Should be the 10th at 23:56 UTC
print(meridian_time)  # Returns empty

t = Time('2025-01-10 00:14:21.664266')  # Tonight for example
meridian_time = place.target_meridian_transit_time(t, MoonFlag)
print(meridian_time)  # Gives correct result

What could be the reason? Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant