uvex_transients.models.core.detection_horizon.detection_horizon#
- uvex_transients.models.core.detection_horizon.detection_horizon(sed: SpectralModel, mag_limits: ~uvex_transients.models._typing.NumericalInput, bandpasses: ~collections.abc.Mapping[str, ~synphot.spectrum.SpectralElement] | ~collections.abc.Sequence[~synphot.spectrum.SpectralElement], *, t_max: ~astropy.units.quantity.Quantity, t_min: ~astropy.units.quantity.Quantity = <Quantity 0.001 d>, z_min: float = 0.003, z_max: float = 1.0, confidence: float = 0.95, tolerance: float = 0.01, n_samples: int = 1000, n_z: int = 30, n_time: int = 60, rng: ~uvex_transients.models._typing.RNGInput = None, progress: bool = True, interpolate: bool = False, max_extensions: int = 5, lyman_limit: bool = True, lyman_threshold: float = 0.01, **kwargs) tuple[QTable, EffectivePeakGrid][source]#
Find the detection horizon of a population for each magnitude limit.
Evaluates the population on a logarithmic redshift grid from z_min to z_max and doubles z_max until every limit is bracketed, with one seed for every attempt so that widening the grid does not redraw the population. Unless lyman_limit is False, the grid never goes past the redshift at which the Lyman limit reaches the reddest band (lyman_limit_redshift), and a horizon that would lie beyond it is reported as that redshift.
- Parameters:
sed (
SpectralModel) – The model whose priors define the population.mag_limits (
floatorarray-like) – AB magnitude limit(s).bandpasses (
Mapping[str,SpectralElement]orsequenceofSpectralElement) – The bands in which an event may be detected.t_max (
Quantity) – Latest rest-frame time, usually the population’s duration.t_min (
Quantity, optional) – Earliest rest-frame time. The default is 0.001 day.z_min (
float, optional) – Smallest redshift of the grid. A limit cannot be reported below it. The default is 0.003.z_max (
float, optional) – Largest redshift of the first attempt. The default is 1.confidence (
float, optional) – The guarantee; see observability_curve. The defaults are 0.95 and 0.01.tolerance (
float, optional) – The guarantee; see observability_curve. The defaults are 0.95 and 0.01.n_samples (
int, optional) – Number of draws. The default is 1000.n_z (
int, optional) – Number of logarithmically spaced redshifts. The default is 30.n_time (
int, optional) – Number of logarithmically spaced times from t_min to t_max. It must resolve the peak. The default is 60.rng (
numpy.random.Generator,intorNone, optional) – Random-number source; give an integer for reproducible output.progress (
bool, optional) – Whether to show a progress bar. The default is True.interpolate (
bool, optional) – Interpolate the crossings; see observability_curve.max_extensions (
int, optional) – How many times z_max may be doubled. The default is 5.lyman_limit (
bool, optional) – Whether to cap the horizon at the redshift where the Lyman limit enters the reddest band. The default is True. The cap overrides the statistical guarantee: a population that is still detectable there gets the cap as its horizon, flagged in thecappedcolumn.lyman_threshold (
float, optional) – The fraction of its peak throughput at which a band begins; see lyman_limit_redshift.**kwargs – Further arguments of effective_peak_grid, such as
criterion.
- Returns:
curve (
QTable) – As returned by observability_curve, with acappedcolumn that is True where the horizon is the Lyman cap, and the cap inmeta["z_lyman"](absent if lyman_limit is False).grid (
EffectivePeakGrid) – The grid the curve was read from, which can be reused for further limits.
- Raises:
ValueError – If lyman_limit is True and the cap is not above z_min.