uvex_transients.surveys.base.SurveySchedule.get_observation_indices_of#
- SurveySchedule.get_observation_indices_of(coord: SkyCoord, nside: int | None = None, order: str | None = None, start_time: Time | None = None, end_time: Time | None = None) tuple[ndarray, ndarray][source]#
Row indices of observations whose footprint covers each query position.
The batched, index-returning counterpart to
get_observations_of(): each query position’s own HEALPix pixel is looked up directly in the cached coverage index (seeget_healpix_coverage_index()) – a plain, single-pixel broad-phase filter, not the final answer – and just that (typically small) candidate set is confirmed with the same exact, vectorizedm4opt.fov.contains()testget_observations_of()uses, run once over every query position at once rather than in a Python loop.Because
get_healpix_coverage_index()registers a pointing under a pixel only if that pixel’s center falls inside the rolled footprint, a query point can sit inside a footprint while its own pixel goes unregistered – such a match is silently missed here, never falsely included (the exact contains test can only remove a candidate, never add one back once the pixel lookup already missed it). Raisensideto shrink how often that happens; there is no neighbour-pixel margin here to compensate for a coarse index.- Parameters:
coord (
SkyCoord) – Sky position(s) to test – scalar or array, any shape (flattened internally).nside (
int, optional) – Resolution and pixel ordering of the coverage index to query – seeget_healpix_coverage_index(). Either may be None (the default) to useconfig["healpix.default_nside"]/config["healpix.default_order"].order (
str, optional) – Seensideabove.start_time (
Time, optional) – Optional time window to restrict matches to. Must be given together. Each may be scalar (one shared window for every query position) or an array the same length as flattenedcoord(one window per query position, e.g. an explosion time and duration limit that differs per event – the batched equivalent of calling this once per event with its own window). If both are None (the default), every"observe"row in the schedule is considered.end_time (
Time, optional) – Optional time window to restrict matches to. Must be given together. Each may be scalar (one shared window for every query position) or an array the same length as flattenedcoord(one window per query position, e.g. an explosion time and duration limit that differs per event – the batched equivalent of calling this once per event with its own window). If both are None (the default), every"observe"row in the schedule is considered.
- Returns:
query_index (
numpy.ndarray) –int64array, one entry per matched observation, giving which element of flattenedcoordit belongs to (values in[0, coord.size)– always0ifcoordis scalar). Chronological within each query position.row_index (
numpy.ndarray) –int64array, the same length asquery_index, of row indices intoobserve_rowsfor the matched observations.
- Raises:
ValueError – If exactly one of
start_time/end_timeis given, or either is an array not the same length as flattenedcoord.