-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Hour angle constraint #560
base: main
Are you sure you want to change the base?
Conversation
Apologies @bmorris3. I fixed the linting issue. |
@mcoughlin Just a few more:
|
@bmorris3 I think I got those in the last commit. |
Hi @mcoughlin, Thanks for starting this constraint. In astroplan we try to use full-precision astropy methods wherever possible, so that results from astroplan will agree with doing the calculation "the long way" via astropy. Astroplan already has a method for computing hour angle, so an hour angle constraint should use the result of this method: astroplan/astroplan/observer.py Lines 1917 to 1944 in 67c0c6b
|
@bmorris3 We tried that and found the calculation quite slow for constraints. Maybe it makes sense to just have a warning in the doc string? |
I wonder why it's so slow. Is it possible that a different combination of arguments in the |
@bmorris3 Not sure. I just fixed the PR to use Astropy by default though. |
@mhvk We're using Do you know if there are more performant options to give the LST functions, so that we can compute many accurate LSTs quickly (see #560 (comment))? |
If you don't need full precision, you can avoid the correction for the TIO relative to longitude 0. Easiest is picking an old model, "iau1982", which doesn't have it -- this is a factor 4 faster and seems accurate to better than 4e-7 hours. More accurate (1e-10 hours) and almost as fast is
For planning purposes, either seems reasonable. p.s. We probably should have something in our documentation about the speed differences... |
@bmorris3 maybe you can retrigger the tests? |
This PR adds possibility of an hour angle constraint.