lyse.Sequence

class lyse.Sequence(h5_path, run_paths, no_write=False)[source]

Bases: lyse.Run

__init__(h5_path, run_paths, no_write=False)[source]

Generic results storage that is not associated with a specific Run.

This is typically used to save results from a multi-shot analysis to an independent h5 file.

Parameters
  • h5_path (str) – Path to h5 file to save to. If file does not exist, will try to create it assuming no_write=False. If file exists, opens a handle to it.

  • run_paths (list or pandas.DataFrame) – List of runs to associate with the sequence. If a dataframe is supplied, will introspect the runs from the 'filepath' data.

  • no_write (bool, optional) – If True, opens file in read-only mode.

Raises

PermissionError – If trying to create a file in read-only mode.

Methods

__init__(h5_path, run_paths[, no_write])

Generic results storage that is not associated with a specific Run.

get_all_image_labels()

Return all existing images labels in the h5 file.

get_attrs(group)

Returns all attributes of the specified group as a dictionary.

get_globals([group])

Get globals from the shot.

get_globals_expansion()

Get the expansion type of each global.

get_globals_raw([group])

Get the raw global values from the shot.

get_image(*args)

Not implemented!

get_image_attributes(orientation)

Return the attributes of a saved orientation image group.

get_images(orientation, label, *images)

Get multiple saved images from orientation and label.

get_images_dict(orientation, label, *images)

Get multiple saved images from orientation and label.

get_result(group, name)

Retrieve result from prior calculation.

get_result_array(*args)

Get the specified result array from each run in the sequence.

get_result_arrays(*args)

Not implemented!

get_results(group, *names)

Return multiple results from the same group.

get_trace(*args)

Get the named trace from each run in the sequence.

get_traces(*args)

Not implemented!

get_units([group])

Get the units of globals.

get_wait(name)

Returns the wait paramteres: label, timeout, duration, and time out status.

get_waits()

Returns the parameters of all waits in the experiment.

globals_diff(other_run[, group])

Take a diff between this run and another run.

globals_groups()

Get names of all the globals groups.

open(mode)

Context manager to open the Run's h5 file for successive reads/writes.

save_result(name, value[, group, overwrite])

Save a result to the hdf5 file.

save_result_array(name, data[, group, ...])

Save an array of data to the hdf5 h5 file.

save_result_arrays(*args, **kwargs)

Save multiple result arrays.

save_results(*args, **kwargs)

Save multiple results to the hdf5 file.

save_results_dict(results_dict[, uncertainties])

Save results dictionary.

set_group(groupname)

Set the default hdf5 file group for saving results.

trace_names()

Return a list of all saved data traces in Run.

Attributes

group

The group in the hdf5 file in which results are saved by default.

h5_file

opened h5py file handle for the shot

h5_path

The value provided for h5_path during instantiation.

no_write

The value provided for no_write during instantiation.

get_image(*args)[source]

Not implemented!

Attention

Not implemented, but could be.

get_result_array(*args)[source]

Get the specified result array from each run in the sequence.

Parameters

*args (str) – Passed directly to get_result_array. Should be group and name to result to obtain.

Returns

Dictionary of path:result pairs for each run.

Return type

dict

get_result_arrays(*args)[source]

Not implemented!

Attention

Not implemented, but could be.

get_trace(*args)[source]

Get the named trace from each run in the sequence.

Parameters

*args (str) – Name of trace. Passed directly to get_trace.

Returns

Dictonary of path:trace pairs for each run.

Return type

dict

get_traces(*args)[source]

Not implemented!

Attention

Not implemented, but could be.