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: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.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.
Exact test. The surviving candidates are confirmed with the same vectorized
m4opt.fov.contains()testget_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 examplenside64 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 – 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.