erlab.io.igor¶
Backend for Igor Pro files.
Functions
|
Load waves from an Igor experiment file( |
|
Load a HDF5 file exported by Igor Pro into an |
|
Load an |
|
Load a wave from Igor binary format. |
|
Apply a scale to the specified dimension of the DataArray. |
Classes
Backend for Igor Pro files. |
- class erlab.io.igor.IgorBackendEntrypoint[source]¶
Bases:
BackendEntrypointBackend for Igor Pro files.
It can open “.pxt”, “.pxp”, and “.ibw” files using the
igor2library.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'¶
- erlab.io.igor.load_experiment(filename, folder=None, *, prefix=None, ignore=None, recursive=False, **kwargs)[source]¶
Load waves from an Igor experiment file(
pxpandpxt).Use
xarray.load_dataset()withbackend="erlab-igor"for consistency.- Parameters:
folder (
str|None, default:None) – Target folder within the experiment, given as a slash-separated string. IfNone, 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) – IfTrue, includes waves in child directories.**kwargs – Extra arguments to
load_wave().
- Returns:
xarray.Dataset– Dataset containing the waves.- Return type:
- erlab.io.igor.load_igor_hdf5(filename)[source]¶
Load a HDF5 file exported by Igor Pro into an
xarray.Dataset.Use
xarray.load_dataset()withbackend="erlab-igor"for consistency.- Parameters:
- Returns:
xarray.Dataset– The loaded data.- Return type:
- erlab.io.igor.load_text(filename, dtype=float, *, without_values=False)[source]¶
Load an
itxfile containing a single wave into axarray.DataArray.This function reads basic
itxfiles exported from Igor Pro. Currently, it only supports files with a single wave and does not handle complex structures like multiple waves or nested structures.- Parameters:
- Returns:
DataArray– The loaded data.- Return type:
- erlab.io.igor.load_wave(wave, data_dir=None)[source]¶
Load a wave from Igor binary format.
Use
xarray.load_dataarray()withbackend="erlab-igor"for consistency.- Parameters:
wave (
dict|WaveRecord|str|PathLike) – The wave to load. It can be provided as a dictionary, an instance ofigor2.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 ifwaveis a string orPathLikeobject. IfNone,wavemust 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:
- erlab.io.igor.set_scale(darr, method, dim, num1, num2, units_str=None, wave_name=None)[source]¶
Apply a scale to the specified dimension of the DataArray.
This is the python equivalent of Igor Pro’s
SetScalecommand.- Parameters:
darr (
DataArray) – The DataArray to which the scale will be applied.method (
'/I','/P', orNone) – The method of scaling. See the Igor Pro documentation for details.dim (
'd','t','x','y', or'z') – The dimension to which the scale will be applied. For ‘d’, nothing is done.num1 (
strorfloat) – The first number for the scale. If a string, it will be converted to float.num2 (
strorfloat) – The second number for the scale. If a string, it will be converted to float.units_str (
str, optional) – If provided, the dimension will be renamed to this string.wave_name (
str, optional) – Has no effect in this implementation, but can be used for consistency with Igor Pro.
- Returns:
DataArray– The DataArray with the scale applied to the specified dimension.- Return type: