Accessors (erlab.accessors)

Some xarray accessors for convenient data analysis and visualization.

erlab provides a collection of accessors for convenient data analysis and visualization. The source code is organized into several modules:

utils

Utility functions for creating accessors.

general

Defines miscellaneous accessors for general data manipulation and visualization.

kspace

Defines an accessor for momentum conversion related utilities.

fit

Defines accessors for curve fitting.

However, users should not import these modules directly. Instead, the accessors are registered with xarray and can be accessed like attributes of xarray.Dataset and xarray.DataArray objects.

All available accessor methods and attributes defined are documented below.

Dataset accessors

Methods

Dataset.qshow(*args, **kwargs)

Visualize the data interactively.

Dataset.qshow.fit(self[, plot_components, ...])

Interactive visualization of fit results.

Dataset.qshow.hvplot(*args, **kwargs)

hvplot-based interactive visualization.

Dataset.qshow.itool(*args, **kwargs)

Shortcut for erlab.interactive.imagetool.itool().

Dataset.qshow.params(self[, data_var])

Plot the coefficients and standard errors for each fitting parameter.

DataArray accessors

General

Methods

DataArray.qshow(*args, **kwargs)

Visualize the data interactively.

DataArray.qplot(*args, **kwargs)

Plot the data.

DataArray.qsel(self[, indexers, func])

Select and aggregate data along specified dimensions.

DataArray.qinfo.get_value(self, ...)

Get the value of the specified attribute or coordinate.

DataArray.qshow.hvplot(*args, **kwargs)

hvplot-based interactive visualization.

DataArray.qshow.itool(*args, **kwargs)

Shortcut for erlab.interactive.imagetool.itool().

DataArray.qsel.around(self, radius, *[, ...])

Average data within a specified radius of a specified point.

DataArray.qsel.average(self[, dim])

Alias for qsel.mean.

DataArray.qsel.max(self[, dim])

Return the maximum over dimensions while keeping their coordinates.

DataArray.qsel.mean(self[, dim])

Return the mean over dimensions while keeping their coordinates.

DataArray.qsel.min(self[, dim])

Return the minimum over dimensions while keeping their coordinates.

DataArray.qsel.sum(self[, dim])

Return the sum over dimensions while keeping their coordinates.

Momentum Space

Methods

DataArray.kspace.as_configuration(self, ...)

Return a new DataArray with modified experimental configuration.

DataArray.kspace.convert(self[, bounds, ...])

Convert to momentum space.

DataArray.kspace.convert_coords(self)

Convert coordinates to momentum space.

DataArray.kspace.estimate_bounds(self)

Estimate the bounds of the data in momentum space.

DataArray.kspace.estimate_resolution(self, axis)

Estimate resolution for a given momentum axis.

DataArray.kspace.hv_to_kz(self, hv)

Return \(k_z\) for a given photon energy.

DataArray.kspace.interactive(**kwargs)

Open the interactive momentum space conversion tool.

DataArray.kspace.set_normal(self, alpha, beta, *)

Set offsets from normal emission angles.

DataArray.kspace.set_normal_like(self, other)

Set offsets like another DataArray.

Attributes

DataArray.kspace.angle_params

Parameters passed to erlab.analysis.kspace.get_kconv_func().

DataArray.kspace.angle_resolution

Retrieve the angular resolution of the data in degrees.

DataArray.kspace.best_kp_resolution

Estimated minimum in-plane momentum resolution.

DataArray.kspace.best_kz_resolution

Estimated minimum out-of-plane momentum resolution.

DataArray.kspace.configuration

Experimental configuration.

DataArray.kspace.inner_potential

Inner potential of the sample in eV.

DataArray.kspace.momentum_axes

Momentum axes of the data after conversion.

DataArray.kspace.offsets

Angle offsets used in momentum conversion.

DataArray.kspace.other_axis

Momentum axis perpendicular to the analyzer slit.

DataArray.kspace.slit_axis

Momentum axis parallel to the analyzer slit.

DataArray.kspace.work_function

Work function of the system in eV.