qblox_scheduler.backends.qblox.data#

Contains helper functions to reshape data.

Functions#

save_to_experiment(→ None)

Save a dataset or a snapshot to an experiment folder.

_convert_int_keys_to_strings(→ xarray.Dataset)

Convert all integer keys in an xarray Dataset to string keys.

reshape_for_analysis(→ xarray.Dataset)

Process a dataset returned by a gettable.get() or

Module Contents#

save_to_experiment(tuid: str, dataset: xarray.Dataset | None, save_snapshot: bool = True, save_dataset: bool = True) None[source]#

Save a dataset or a snapshot to an experiment folder.

Examples

dataset = instrument_coordinator.run()
save_to_experiment(dataset)
Parameters:
  • dataset – The dataset to save

  • save_snapshot – Whether to save a snapshot of the experiment

  • tuid – The time-based unique identifier (TUID) of the form YYYYmmDD-HHMMSS-sss-** for the dataset. Used also for the directory creation where the snapshot is saved

  • save_dataset – Whether to save the dataset of the experiment

_convert_int_keys_to_strings(dataset: xarray.Dataset) xarray.Dataset[source]#

Convert all integer keys in an xarray Dataset to string keys.

Parameters:

dataset – The dataset to convert

Returns:

The converted dataset

reshape_for_analysis(gettable_dataset: xarray.Dataset, x_label: str | list[str] = '', x_unit: str | list[str] = 'a.u.', x_values: collections.abc.Sequence[int | float | complex | numpy.number] | None = None, name: str = 'processed_measurement', batched: bool = True, real_imag: bool = True, tuid: quantify_core.data.types.TUID | str | None = None) xarray.Dataset[source]#

Process a dataset returned by a gettable.get() or instrument_coordinator.run() into a complete xarray Dataset similar to what would be returned by MeasurementControl.run(). The dataset is compatible with the analysis classes in qblox_scheduler.analysis.

Parameters:
  • gettable_dataset – A “raw” dataset returned by gettable.get() or instrument_coordinator.run()

  • x_label – Label for the x-axis

  • x_unit – Unit for the x-axis

  • x_values – Values for the x-axis

  • name – Name for the dataset

  • batched – Whether the data is batched (True) or iterative (False)

  • real_imag – If True, returns I/Q values. If False, returns magnitude/phase (degrees)

  • tuid – The TUID for the dataset. If None, a new TUID will be generated.

Examples

dataset = instrument_coordinator.run()
dataset = reshape_for_analysis(dataset, settable)
T1Analysis(dataset).run()
Returns:

A dataset formatted like a MeasurementControl.run() result