xarray.DataArray.kspace.estimate_resolution

DataArray.kspace.estimate_resolution(self, axis, lims=None, from_numpoints=False)[source]

Estimate resolution for a given momentum axis.

Parameters:
  • axis (Literal['kx', 'ky', 'kz']) – Axis to estimate the resolution for.

  • lims (tuple[float, float] | None, default: None) – The limits of the axis used when from_numpoints is True. If not provided, reasonable limits will be calculated by estimate_bounds(), by default None

  • from_numpoints (bool, default: False) –

    If True, estimate the resolution from the number of points in the relevant axis. If False, estimate the resolution based on the data, by default False

    Changed in version 3.20.1: When from_numpoints=True, the estimated step now uses adjacent-point spacing over inclusive bounds: (max - min) / (N - 1). Datasets with fewer than 2 points on the relevant axis return np.inf.

Returns:

float – The estimated resolution.

Raises:

ValueError – If no photon energy axis is found in data for axis 'kz'.

Return type:

float