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(), in three stages that each narrow the candidates before the next, more expensive one:

  1. Broad phase. Each query position’s own HEALPix pixel and its eight neighbours are looked up in the cached coverage index (see get_healpix_coverage_index()), and duplicate (query, row) pairs are dropped. The index registers a pointing under a pixel only if that pixel’s center is inside the rolled footprint, so a point near the footprint edge can be covered while its own pixel is unregistered. A pixel center within one pixel of the point is always inside a footprint much larger than a pixel, so the neighbours catch these cases.

  2. Time window. Candidates whose start time falls outside their query’s window are discarded. This is a cheap float comparison, done before the exact test so that test only runs on observations that can matter.

  3. Exact test. The surviving candidates are confirmed with the same vectorized m4opt.fov.contains() test get_observations_of() uses, run once over every pair at once rather than in a Python loop.

The result matches get_observations_of() as long as a pixel is much smaller than the footprint (for example nside 64 or 128 against a footprint of a few degrees). With a pixel comparable to the footprint, a point can still lie inside it with no pixel center from its own or neighbouring pixels inside, and is missed. Nothing is ever falsely included, since the exact test has the final say.

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.