SurveySampler#
- class uvex_transients.phase_space.sampling.core.SurveySampler(schedule: SurveySchedule, mission=None, *, band: str | None = None, snr_threshold: float | None = None, n_visits: int | None = None, exclude_first_visit_detections: bool | None = None, detection: Sequence[Mapping] | None = None, mag_limit: float | None = None, time_bins: int | None = None, nside: int | None = None, order: str | None = None, cosmology: Cosmology | None = None, schedule_name: str | None = None)[source]#
Count the recoveries of a transient simulated against a survey: what every survey-backed sampler shares.
A subclass is built in its own
__init__, which callssuper().__init__and then_configure()once, with its space, the redshift out to which the volume is tabulated and the settings it adds to the ones recorded here. It suppliesmake_transient(),redshift_limit(),_place()and_log_window(). If its axes are parameters of the SED, it lists them inparameter_axes, a tuple ofParameterAxis, and_place()calls_fix_parameters()for them and only sets the window and the redshift limit itself.Every setting that is None (the default) takes its default from the configuration, which is resolved once by
SurveySettings:config["phase_space.<kind>.<name>"]if the kind of the sampler (or a kind it is built on) has the key, elseconfig["phase_space.detection.<name>"]orconfig["phase_space.simulation.<name>"]. A subclass takes these as**surveyand passes them on, so a new survey setting is added in this one place.- Parameters:
schedule (
SurveySchedule) – The survey to recover events against.mission (
strorm4opt.missions.Mission, optional) – The mission (detector and background), or the name of one.band (
str, optional) – The detector band that recovers events.snr_threshold (
float, optional) – The signal-to-noise a visit must reach.n_visits (
int, optional) – How many visits must reach it.exclude_first_visit_detections (
bool, optional) – Whether a detection that is only on a field’s first visit is discarded; seeSurveySimulator.filter_by_snr.detection (
sequenceofMapping, optional) – What counts as a recovery, as a list of the simulator’s registered cuts (seecheck_detection()). By default onesnrcut, which is the three settings above. A cut that takes snr_threshold, n_visits, exclude_first_visit_detections orbandsand is not given them gets the sampler’s, withbandsthe band of the map. A rule that is not a list of cuts is written by overridingdetect().mag_limit (
float, optional) – The AB depth that sets the redshift limit of a point. Only events brighter than it are drawn.time_bins (
int, optional) – Number of equal explosion-time bins spanning the survey; seeSurveySimulator.sample_N_events.nside (optional) – HEALPix resolution of the sampling grid; the package defaults if omitted.
order (optional) – HEALPix resolution of the sampling grid; the package defaults if omitted.
cosmology (
Cosmology, optional) – Defaults to the configured cosmology.schedule_name (
str, optional) – The registry name of schedule (seeget_schedule()), recorded insettingsso thatfrom_settings()can fetch the same schedule. Leave it out for a schedule that is not in the registry.
Notes
The tables a sampler interpolates (volume, exposure) are sized by
config["phase_space.numerics"]. They set the precision of the scales, not what is measured, so they are not recorded insettings.Methods
Return the volume-time of the whole sky over the whole survey out to the redshift limit, in Mpc^3 yr.
annotate_map(ax, overlay)Draw the overlay of a sampler on the axes of a figure of its map.
coverage(x)Return the fraction of the sky and survey window that the sampled footprint covers, for points of the space.
describe(settings)Describe the map of a survey sampler: its band and what it counts as a detection.
detect(simulator, catalog)Return the events of a catalog that count as recovered.
draw(x, n, seed)Simulate n events at a point and return how many the survey recovers.
draw_map(grid, points, path, title, *[, ...])Draw the fitted map of a sampler of this class and save the figure.
from_run_config(run, **options)Build a sampler from the arguments of a map in a run-config, for the survey and mission the run-config names.
from_settings(settings, *[, schedule, ...])Rebuild a sampler from the settings of another one.
kinds()Return the registered kinds this class is, the most specific first.
Return a new transient of this sampler, not yet placed at a point of the space.
measure_overlay([n_draws, seed])Measure a population in the plane of the map, to be shaded on its figure.
Return the SED parameters that a point of the space sets, from the axes bound to a parameter.
rate_products(rate)Return the products that need a volumetric rate: the expected number of recoveries over the survey.
Return the redshift out to which events are drawn at points of the space.
volume_time(x)Return the effective volume-time \(\mathcal V T\) of points of the space, in Mpc^3 yr.
Attributes
Whether
measure_overlay()is implemented, for the callers that decide whether to ask for one.The name the one transient goes by in the simulator.
The name the class is registered under, which a file records.
The axes that are parameters of the SED, which
parameters_at()uses to place a point.The quantities of a map of this sampler beyond the success fraction.
The arguments that rebuild this sampler, as plain types that an ECSV header can hold.
The axes of the sampler, with their default ranges.
What a figure of the map needs to label its axes, and what a comparison checks before it differences two.
The name of the
Scaleproduct that turns the success fraction into the quantity two maps are compared on (the volume-time, for a survey sampler: the recovered volume-time is its product with the fraction).What counts as a recovery and how a point is simulated, with the defaults applied.
The cuts that define a recovery, or None for the default (see
detect()).