astropy / astropy/astroplan

rise time not found (too close from reference time ?)

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

Description

Hello,

astroplan 0.7 dev1236

I found several cases where ```obs.target_rise_time``` miss the closest next rise time and return the next one.
It seems it happens when the reference time is too close from the rise time to be found.
Below an example (jupyter notebook) that reproduces this anomaly.
Thanks in advance for your help,
Thierry S.

```
from astropy.coordinates import SkyCoord
from astropy.coordinates import EarthLocation
from astropy.coordinates import AltAz
import astropy.units as u
from astroplan import Observer, FixedTarget
from astropy.time import Time
xyz = EarthLocation.from_geocentric( 5327285.09211954,
-1718777.11250295,
3051786.7327476,
unit="m")

radec = SkyCoord(ra=15.44379741*u.degree, dec=-26.1439*u.degree, frame='icrs')
tref = Time('2046-01-30 13:30:50.505',format="iso",scale="utc")
horizon = 10*u.deg
```
```
obs = Observer(location = xyz, name = "test", timezone ="utc")
target = FixedTarget(coord=radec, name="mysource")
```
```
high = obs.target_is_up(tref, target, horizon=10*u.deg )
if (not high): print("It is below the horizon, compute next rise")
t_rise = obs.target_rise_time(tref,target,which="next",horizon=10*u.deg)
print(t_rise.iso)
```
It is below the horizon, compute next rise
2046-01-31 13:28:17.143
```
# Previous rise
t_rise_bef = obs.target_rise_time(tref,target,which="previous",horizon=10*u.deg)
print(t_rise_bef.iso)
```
2046-01-29 13:36:09.289

```
# Find rise time "manually"
import numpy as np
trange = 500
dt = np.linspace(-trange/2,trange/2,10)
tsamp = tref + dt*u.s
altaz = radec.transform_to(AltAz(obstime = tsamp,location = xyz))
t_rise_guess = tsamp[np.where(altaz.alt.value > 10)][0]
t_rise_guess
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided notebook reproduction and trace Observer.target_rise_time(..., which="next") alongside target_is_up for the reference time. Compare the returned rise with the manually sampled AltAz result; done means the closest upcoming rise is returned for this case without regressing previous-rise behavior.

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.