uvex_transients.simulation.exposure_catalog.ExposureCatalog.rebin#
- ExposureCatalog.rebin(time_bins: Time | int) ExposureCatalog[source]#
Rebin this catalog onto an arbitrary new time binning.
Unlike ~uvex_transients.simulation.core.SurveySimulator.compute_effective_exposure, this never re-queries the schedule’s footprint – it redistributes each original bin’s own effective_exposure/expected_events across whichever new bin(s) it overlaps, weighted by the fraction of the original bin’s own duration that falls inside each new bin (see _bin_overlap_weights, applied once per new bin here). This is exact regardless of how the new edges align with the old ones – including new bins narrower than, wider than, or straddling several original bins – because both quantities are additive across disjoint time intervals and this class already treats a bin’s own visited footprint as constant across its own duration (the same assumption compute_effective_exposure made when tabulating it in the first place).
The new solid_angle is recovered as a duration-weighted average,
effective_exposure / duration, over whatever original-bin overlap contributed to each new bin – exact only if the actually-visited footprint happens to be identical across every original bin contributing to a given new bin; otherwise it’s the equivalent constant footprint that reproduces the same effective_exposure. n_pixels_visited is derived from that same solid_angle, converted back through nside’s own pixel area and rounded to the nearest integer – not a re-union of pixel ids, which isn’t retained per row. A new bin whose window doesn’t overlap any original bin (e.g. it extends past this catalog’s own time_bins range) gets zeros throughout, including a duration short of the new bin’s own width.- Parameters:
time_bins (
Timeorint) – Either an explicit, monotonically increasing Time array ofn + 1new bin edges, or a positive int giving the number of evenly-spaced bins to divide this catalog’s own time_bins span into.- Returns:
A new catalog, one row per
(transient type, new time bin), with time_bins set to the resolved new edges.- Return type:
- Raises:
TypeError – If time_bins is neither a ~astropy.time.Time array nor an int.
ValueError – If time_bins is a Time array with fewer than 2 edges, or a non-positive int.