oitg.results API
- oitg.results.load_hdf5_file(filename: str) Dict[str, Any] [source]
Load an ARTIQ results file.
- Returns:
A dictionary containing the logical contents of the HDF5 file, including:
"start_time"
: the Unix timestamp when the experiment was built"expid"
: experiment description, including submission arguments"datasets"
: dictionary containing all set datasets
- oitg.results.load_result(day: None | str | List[str] = None, hour: None | int | List[int] = None, rid: None | int | List[int] = None, class_name: None | str | List[str] = None, experiment: str | None = None, root_path: str | None = None, local_path: str | None = None) Dict[str, Any] [source]
Find and load an HDF5 results file from an ARTIQ master results directory.
The results file is described by a rid and a day (provided date string, defaults to today). See
find_results()
for a full description of the arguments.- Parameters:
local_path – If specified, searches first in this directory before falling back to
root_path
, and copying the files from there. This automatically creates a copy of the accessed files inlocal_path
. Iflocal_path
is on the local drive, using this will speed up future calls toload_result
as it circumvents the shared drive, which does not even have to be mounted then.- Returns:
A dictionary containing the contents of the file; see
load_hdf5_file()
.
- class oitg.results.Result(path, day, hour, cls)
- cls: str
Alias for field number 3
- day: str
Alias for field number 1
- hour: int
Alias for field number 2
- path: str
Alias for field number 0
- oitg.results.find_results(day: None | str | List[str] = None, hour: None | int | List[int] = None, rid: None | int | List[int] = None, class_name: None | str | List[str] = None, experiment: str | None = None, root_path: str | None = None) Dict[int, Result] [source]
Find all ARTIQ result files matching the given filters.
To implement this, the file system in the given
root_path
(or the standard root path for the given experiment as perartiq_results_path()
) is searched for HDF5 files matching the standard ARTIQ folder/file name structure.- Parameters:
day – Acquisition date of results to match, or list of dates, in ISO format (yyyy-mm-dd). If
None
, defaults to the current date (today); if"auto"
andrid
is given, the RID index is used to determine the location.hour – Hour or list of hours when the experiment was built. If
None
, includes all hours.rid – An experiment run id or list of run ids to match. If
None
, includes all rids.class_name – The class name of the experiment to match, or a list of names. If
None
, includes all classes.experiment – The experiment name, used for determining the results path if
root_path
is not given. Seeoitg.paths.artiq_results_path()
.root_path – The ARTIQ results directory to search. If not given, defaults to the
oitg.paths.artiq_results_path()
. An IOError is raised if the path does not exist.
- Returns:
A dictionary of results, indexed by rid. The values are named tuples
(path, day, hour, cls)
.