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) – Lower and upper bounds for each target momentum axis, in Å⁻¹. Keys can be"kx","ky", or"kz"when that axis applies to the input. Any omitted bound is estimated from the measured angular range.resolution (
dict[str,float] |None, default:None) – Target grid spacing for each momentum axis, in Å⁻¹. This is interpolation sampling, not instrumental momentum resolution. The final spacing can differ slightly because the requested bounds contain an integer number of intervals. If omitted, the target spacing is estimated from the input. For in-plane momentum, the estimate uses the angular resolution and kinetic energy. Forkz, the smaller estimate from the photon-energy sampling and the photoelectron inelastic mean free path is used.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 – Explicit one-dimensional target coordinates, in Å⁻¹, supplied as
kx,ky, orkz. An explicit coordinate overridesboundsandresolutionfor that axis.
- Returns:
xarray.DataArray– A new array containing the intensity interpolated on the target momentum grid. Automatically generated momentum coordinates are regularly spaced; explicit coordinates supplied throughcoordsare used as given. Unaffected dimensions retain their names. For fixed-photon-energy cuts,alphais replaced by the momentum axis parallel to the analyzer slit. For angular maps,alphaandbetaare replaced bykxandky. For photon-energy-dependent cuts,alphaandhvare replaced by the slit-parallel momentum axis andkz. TheeVdimension is retained and uses binding energy. The data name and attributes are preserved, and the interpolated values use a floating dtype. Points outside the measured angular coverage contain missing values. The input is not modified.- Return type:
Notes
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)