xarray_sci

File Purpose: high-level xarray functions. May be especially useful for science.

E.g., gaussian filter, polynomial fit.

Functions

xarray_assign_polyfit_stddev(dataset, *[, ...])

assign polyfit stddev to dataset['polyfit_stddev'], treating dataset like a result of polyfit.

xarray_coarsened_polyfit(array, coord, ...)

returns result of coarsening array, then polyfitting along the fine dimension, in each window.

xarray_curve_eval(params, f, xdata, *[, stddev])

evaluate a curve fit result (params) for this function at these xdata.

xarray_curve_fit(array, f, dim, *[, stddev, ...])

scipy.optimize.curve_fit(f, xdata=array[dim], ydata=array).

xarray_curvigrad3D(array[, x, xyz])

return d(array)/dx, for curvilinear coordinates in 3D,

xarray_d_grid(array, coord)

return the gradient of array[coord], along dim=coord if possible, else along '{coord}_dim'.

xarray_gaussian_filter(array[, dim, sigma, ...])

returns array after applying scipy.ndimage.gaussian_filter to it.

xarray_interp_inverse(array[, interpto, ...])

interpolate a DataArray but using the array values as one of the interpolation variables;

xarray_isel_for_interp1D(array, values, *[, ...])

return minimal indices for array.isel(dim=...) that still allow interp to these values.

xarray_jacobian(array, coords, dims)

return the jacobian of array with respect to these coords and dims.

xarray_line_fit(array, dim, *[, pnames, pbounds])

returns result of xarray_curve_fit with f a line:

xarray_moments(array[, dim])

returns Dataset of the "normalized" moments of array along dim,

xarray_np_gradient(array, dim)

return the np.gradient of array along dim, without incorporating coordinates into the math.

xarray_polyfit(array, coord, degree, *[, ...])

returns array.polyfit(coord, degree, **kw_polyfit), after swapping coord to be a dimension, if needed.

xarray_polyfit_eval(dataset[, at, to_dataset])

evaluate the polyfit in dataset at these coordinates.

xarray_wrapped_interp1D(array, dim, values, ...)

return array interpolated to values, along dim, assuming wrap-around at wrap.

Classes

XarrayCurveFitter(array, dim, *[, ...])

class for helping with curve fitting.

XarrayLineFitter(array, dim, *[, ...])

XarrayCurveFitter with f a line: f(x, slope, intercept) = slope * x + intercept.