Closed martindevora closed 3 years ago
Hi Martín,
This occurs when the Sun does not rise above the horizon within the twenty-four hours following the specified reference time. The code you've placed above raises the warning:
WARNING: TargetNeverUpWarning: Target with index 0 does not cross horizon=0.0 deg within 24 hours [astroplan.observer]
which indicates this exception as the source of the problem. This problem occurs for the time that you've supplied because the nearest sun set time is 2459537.4612224135
, which is nearly the same exact time that you're querying. You shouldn't run into this problem if you query nearly any other time that is >a few minutes a way from the precise time of a sunset. For example, if you center your near local noon, this error won't arise.
Does that help?
Hello,
I guessed so. The problem is that all of this is part of an automated code calling plot_air_mass
and I'm interested in precise timings. That is, I think that such an exception from sun_set_time
should probably be handled within the plot_air_mass
method somehow, because it can receive a list of times from which I don't know which one caused the exception that broke the method. I could handle it though. To me you can close the issue.
Regards.
Hi, I've experienced the error where
sun_set_time
method does not return a valid time. Hence, all my further calculations fail. By slightly modifying the time or the observer site, it seems to not be happening, but it is not something I can predict automatically.Python version: 3.8 Astroplan version: 0.8 Astropy version: 4.3.1
Reproducible with this code:
This problem makes the
plot_air_mass
method fail with an exception because it cannot find the datetime of the sunset, as it is NaN. That is the root cause that triggered my issue.Regards, Martín.