attpcdaq.daq.models.Experiment

class attpcdaq.daq.models.Experiment(*args, **kwargs)[source]

Represents an experiment and the settings relevant to one.

This model keeps track of run numbers and knows the name of the experiment. It is queried when rearranging data files at the end of a run, when the experiment name is used as the name of the directory in which to store the files.

Fields

name The name of the experiment.
is_active Is this the active experiment? Only one experiment may be active at a time.

Properties

is_running Whether a run is currently being recorded.
latest_run Get the most recent run in the experiment.
next_run_number Get the number that the next run should have.

Methods

start_run() Creates and saves a new RunMetadata object with the next run number for the experiment.
stop_run() Stops the current run.
save(*args, **kwargs) Override of save to enforce only one active experiment at a time.