erlab.io.igor

Backend for Igor Pro files.

Functions

load_experiment(filename[, folder, prefix, ...])

Load waves from an Igor experiment file(pxp and pxt).

load_igor_hdf5(filename)

Load a HDF5 file exported by Igor Pro into an xarray.Dataset.

load_wave(wave[, data_dir])

Load a wave from Igor binary format.

Classes

IgorBackendEntrypoint()

Backend for Igor Pro files.

class erlab.io.igor.IgorBackendEntrypoint[source]

Bases: BackendEntrypoint

Backend for Igor Pro files.

It can open “.pxt”, “.pxp”, and “.ibw” files using the igor2 library.

It also supports loading HDF5 files exported from Igor Pro.

For more information about the underlying library, visit: https://github.com/AFM-analysis/igor2

description: ClassVar[str] = 'Open Igor Pro files (.pxt, .pxp and .ibw) in Xarray'
url: ClassVar[str] = 'https://erlabpy.readthedocs.io/en/stable/generated/erlab.io.igor.html'
open_dataset(filename_or_obj, *, drop_variables=None, recursive=False)[source]
guess_can_open(filename_or_obj)[source]
open_datatree(filename_or_obj, *, recursive=True, **kwargs)[source]
open_groups_as_dict(filename_or_obj, *, recursive=True, **kwargs)[source]
erlab.io.igor.load_experiment(filename, folder=None, *, prefix=None, ignore=None, recursive=False, **kwargs)[source]

Load waves from an Igor experiment file(pxp and pxt).

Use xarray.load_dataset() with backend="erlab-igor" for consistency.

Parameters:
  • filename (str | PathLike) – The experiment file.

  • folder (str | None, default: None) – Target folder within the experiment, given as a slash-separated string. If None, defaults to the root.

  • prefix (str | None, default: None) – If given, only include waves with names that starts with the given string.

  • ignore (Iterable[str] | None, default: None) – List of wave names to ignore.

  • recursive (bool, default: False) – If True, includes waves in child directories.

  • **kwargs – Extra arguments to load_wave().

Returns:

xarray.Dataset – Dataset containing the waves.

Return type:

Dataset

erlab.io.igor.load_igor_hdf5(filename)[source]

Load a HDF5 file exported by Igor Pro into an xarray.Dataset.

Use xarray.load_dataset() with backend="erlab-igor" for consistency.

Parameters:

filename (str | PathLike) – The path to the file.

Returns:

xarray.Dataset – The loaded data.

Return type:

Dataset

erlab.io.igor.load_wave(wave, data_dir=None)[source]

Load a wave from Igor binary format.

Use xarray.load_dataarray() with backend="erlab-igor" for consistency.

Parameters:
  • wave (dict | WaveRecord | str | PathLike) – The wave to load. It can be provided as a dictionary, an instance of igor2.record.WaveRecord, or a string representing the path to the wave file.

  • data_dir (str | PathLike | None, default: None) – The directory where the wave file is located. This parameter is only used if wave is a string or PathLike object. If None, wave must be a valid path.

Returns:

xarray.DataArray – The loaded wave.

Raises:
  • ValueError – If the wave file cannot be found or loaded.

  • TypeError – If the wave argument is of an unsupported type.

Return type:

DataArray