Skip to content

moon_phase_angle slow for large time arrays #211

@kvyh

Description

@kvyh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions