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
compute angular distances of the given sky coordinates from the given solar system bodies at the given timestamps and stations
:param coords: list of SkyCoord objects to measure separation
:param timestamps: list of datetimes, e.g. [datetime(2020, 1, 1, 15, 0, 0), datetime(2020, 1, 1, 16, 0, 0)]
:param stations: list of station names, e.g. ["CS002"]
:param bodies: list of solar system bodies, e.g. ['sun', 'moon', 'jupiter']
:return A dict that maps station names to a list with a dict for each given coordinate, which maps each body body to a list of separation angles for each given timestamp.
compute angular distances of the given sky coordinates from the given solar system bodies at the given timestamps (seen from LOFAR core)
:param angle1: first angle of celectial coordinates, e.g. RA
:param angle2: second angle of celectial coordinates, e.g. Dec
:param direction_type: direction_type of celectial coordinates, e.g. 'J2000'
:param timestamps: tuple of datetimes, e.g. (datetime(2020, 1, 1, 15, 0, 0), datetime(2020, 1, 1, 16, 0, 0))
:param bodies: tuple of solar system bodies, e.g. ('sun', 'moon', 'jupiter')
:return A dict that maps each body to a dict that maps the given timestamp to a separation angle from the given coordinate.
timestamps=[dateutil.parser.parse(timestamp)fortimestampintimestamps]# isot to datetime
timestamps=tuple([dateutil.parser.parse(timestamp)fortimestampintimestamps])# isot to datetime
ifstationsisNone:
stations=["CS002"]
stations=("CS002",)
else:
stations=stations.split(',')
stations=tuple(stations.split(','))
# todo: to improve speed for the frontend, we should probably precompute/cache these and return those (where available), to revisit after constraint table / TMSS-190 is done
responses={200:'A JSON object with angular distances of the given sky coordinates from the given solar system bodies at the given timestamps and stations. \n'
'Outer list contains results per coordinate in given order, inner list per timestamp.'},
operation_description="Get angular distances of the given sky coordinates from the given solar system bodies at all given timestamps and stations. \n\n"
description="comma-separated list of station names"),
responses={200:'A JSON object with angular distances of the given sky coordinates from the given solar system bodies at the given timestamps (seen from LOFAR core)'},
operation_description="Get angular distances of the given sky coordinates from the given solar system bodies at all given timestamps. \n\n"