Skip to content
Snippets Groups Projects
Commit 2ce1b9bc authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

TMSS-259: comments

parent ec812e4f
No related branches found
No related tags found
1 merge request!284Resolve TMSS-259
......@@ -25,7 +25,7 @@ def create_astroplan_observer_for_station(station: str) -> Observer:
SUN_SET_RISE_ANGLE_TO_HORIZON = Angle(10, unit=astropy.units.deg)
SUN_SET_RISE_PRECISION = 15 # n_grid_points; higher is more precise but very costly; astropy defaults to 150, 15 seems to cause errors of typically one minute
@lru_cache(maxsize=256, typed=False) # does not like lists, so use sets to allow caching
@lru_cache(maxsize=256, typed=False) # does not like lists, so use tuples to allow caching
def timestamps_and_stations_to_sun_rise_and_set(timestamps: tuple, stations: tuple, angle_to_horizon: Angle=SUN_SET_RISE_ANGLE_TO_HORIZON) -> dict:
"""
compute sunrise, sunset, day and night of the given stations at the given timestamps
......@@ -63,7 +63,8 @@ def timestamps_and_stations_to_sun_rise_and_set(timestamps: tuple, stations: tup
return return_dict
@lru_cache(maxsize=256, typed=False) # does not like lists, so use sets to allow caching
# Depending on usage patterns, we should consider refactoring this a little so that we cache on a function with a single timestamp as input. Requests with similar (but not identical) timestamps or bodies currently make no use of cached results for the subset computed in previous requests.
@lru_cache(maxsize=256, typed=False) # does not like lists, so use tuples to allow caching
def coordinates_and_timestamps_to_separation_from_bodies(angle1: float, angle2: float, direction_type: str, timestamps: tuple, bodies: tuple) -> dict:
"""
compute angular distances of the given sky coordinates from the given solar system bodies at the given timestamps (seen from LOFAR core)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment