uvex_transients.phase_space.stages#

The stages of a recovery map as operations on its directory.

A map is a directory of files (see files and PHASE_SPACE_FILES), and each stage reads some of them and writes others, so that a stage can be run, repeated or changed without the ones before it:

  1. run_experiment() makes points.ecsv (with products=False to stop

there), and then the products below. It is

the only expensive stage, and the header of the points records everything needed to rebuild the experiment.

  1. fit_map() makes map.ecsv (and overlay.ecsv, for a sampler that has

an overlay) from the points; write_map()

does the same for an experiment that is already in memory. They rebuild the sampler, so they need the survey schedule and scikit-learn.

  1. plot_files() makes map.png from the files alone, and so needs neither.

  2. compare_maps() differences the map.ecsv of two maps, again from the

files alone.

Up to four files are written to the directory of a map:

points.ecsv

Every measured point: its coordinates, k successes out of n tries, and what the sampler records of it. It is rewritten after every batch and read back by resume.

map.ecsv

The fitted map on a grid (see grid_table()): the success fraction with a 1 sigma interval (_lo, _hi), and the quantities of the sampler.

overlay.ecsv

For a sampler that has an overlay (the canonical one) and with overlay, the measured peak luminosity and half-decline time of draws from every shipped transient class, in the band of the map.

map.png

The figure of the map.

Every stage accepts both formats of points file, so the files of a published release can be fitted again and drawn. Running a map needs the optional phase_space extra.

Attributes

DIFFERENCE_FILES

The files compare_maps writes, by key.

Functions

compare_maps(baseline, comparison, out_dir, *)

Difference the map.ecsv of two maps, and write difference.ecsv and difference.png.

fit_map(directory, *[, grid_size, rate, ...])

Fit the map of the points in a directory, and write map.ecsv (and overlay.ecsv).

map_title(kind, settings, n_points, n_tries)

Return the title of the figure of a map.

plot_files(directory, *[, path, title, ...])

Draw the map of a directory from its map.ecsv and points.ecsv, and write map.png.

run_experiment(experiment, out_dir, *, ...)

Run an experiment of any sampler and write its data products and figure.

write_map(experiment, directory, *[, ...])

Write map.ecsv (and overlay.ecsv) of an experiment whose model is fitted to its points.