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 (see get_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, vectorized m4opt.fov.contains() test get_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). Raise nside to 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 – see get_healpix_coverage_index(). Either may be None (the default) to use config["healpix.default_nside"]/config["healpix.default_order"].

  • order (str, optional) – See nside above.

  • 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 flattened coord (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 flattened coord (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) – int64 array, one entry per matched observation, giving which element of flattened coord it belongs to (values in [0, coord.size) – always 0 if coord is scalar). Chronological within each query position.

  • row_index (numpy.ndarray) – int64 array, the same length as query_index, of row indices into observe_rows for the matched observations.

Raises:

ValueError – If exactly one of start_time/end_time is given, or either is an array not the same length as flattened coord.