xarray.DataArray.kspace.convert¶
- DataArray.kspace.convert(self, bounds=None, resolution=None, *, method='linear', silent=True, **coords)[source]¶
Convert to momentum space.
- Parameters:
bounds (
dict[str,tuple[float,float]] |None, default:None) – A dictionary specifying the bounds for each coordinate axis. The keys are the names of the axes, and the values are tuples representing the lower and upper bounds of the axis. If not provided, the bounds will be estimated based on the data.resolution (
dict[str,float] |None, default:None) – A dictionary specifying the resolution for each momentum axis. The keys are the names of the axes, and the values are floats representing the desired resolution of the axis. If not provided, the resolution will be estimated based on the data. For in-plane momentum, the resolution is estimated from the angle resolution and kinetic energy. For out-of-plane momentum, two values are calculated. One is based on the number of photon energy points, and the other is estimated as the inverse of the photoelectron inelastic mean free path given by the universal curve. The resolution is estimated as the smaller of the two values.method (
str, default:'linear') – The interpolation method to use, passed toerlab.analysis.interpolate.interpn(). Using methods other than'linear'will result in slower performance.silent (
bool, default:True) – IfFalse, print progress messages during the conversion.**coords – Array-like keyword arguments that specifies the coordinate array for each momentum axis. If provided, the bounds and resolution will be ignored.
- Returns:
xarray.DataArray– The converted data.- Return type:
Note
This method converts the data to a new coordinate system specified by the provided bounds and resolution. It uses interpolation to map the data from the original coordinate system to the new one.
The converted data is returned as a DataArray object with updated coordinates and dimensions.
For non-
hvscans, if theeVaxis is all-positive, it is interpreted as kinetic energy and converted to binding energy. Forhv-dependent scans, theeVaxis must already be in binding energy.Examples
Set parameters and convert with automatic bounds and resolution:
data.kspace.offsets = {"delta": 0.1, "xi": 0.0, "beta": 0.3} data.kspace.work_function = 4.3 data.kspace.inner_potential = 12.0 converted_data = data.kspace.convert()
Convert with specified bounds and resolution:
bounds = {"kx": (0.0, 1.0), "ky": (-1.0, 1.0)} resolution = {"kx": 0.01, "ky": 0.01} converted_data = data.kspace.convert(bounds, resolution)