You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that when I tried to use MoonIlluminationConstraint when scheduling, it was very slow. When running a profiler on the code, I found that for an array of 90 times: moon_coord = get_moon(...).transform_to(altaz_frame) took 26 seconds sun_coord = get_sun(t).transform_to(altaz_frame) took 7 seconds sun_coord.separation(moon_coord) took 9 seconds.
The information is cached (so it only has to do this once for all targets), but it takes nearly .5 seconds per time which adds up for large time ranges and fine time resolutions. Is there a way to speed this up while retaining precision? Otherwise, for finer time resolutions it may be beneficial to have an interpolation method so that only a fraction of the times need to be calculated.
moon_coord = get_moon(...).transform_to(altaz_frame) takes 461 ms illumination = np.array(moon_illumination(times)) takes 344 ms
the total call to evaluate a MoonIlluminationConstraint for 100 times and a scalar target is 780ms. For two targets the vectorisation in the above PRs means it still only takes 811 ms.
Activity
kvyh commentedon Aug 5, 2016
#213 solves part of the problem, but
MoonIlluminationConstraintstill callsObserver.moon_altazwhich didn't get changed in it.StuartLittlefair commentedon Feb 9, 2017
This is fixed in #286 and #285.
Benchmarking on #286 I find that for 100 times:
moon_coord = get_moon(...).transform_to(altaz_frame)takes 461 msillumination = np.array(moon_illumination(times))takes 344 msthe total call to evaluate a
MoonIlluminationConstraintfor 100 times and a scalar target is 780ms. For two targets the vectorisation in the above PRs means it still only takes 811 ms.