astropy / astropy/astroplan

Empty meridian transit time

Open
#612 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
225
Forks
121
Avg merge
28m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the two provided examples and tracing Observer.target_meridian_transit_time with MoonFlag. Inspect the MoonFlag transit calculation and its handling of the June 2025 date; done means it returns the expected non-empty transit time for both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.