radarx.ml.reassemble#
- radarx.ml.reassemble(patches, index, shape=None, blend='cosine', *, name=None, attrs=None, n_threads=None, engine='auto')[source]#
Put patches (or model outputs on them) back together into sweeps.
Every gate is the weighted mean of the patch pixels covering it, with a separable blending window over each patch. NaN pixels are skipped; a gate no finite pixel covers is NaN. Unchanged patches give back the input.
- Parameters:
patches (
numpy.ndarray) –(n_patches, *lead, n_azimuth, n_range), in the order ofpolar_patches().leadmay differ from the input (a model with other output channels than input channels).index (
PatchIndex) – The index returned bypolar_patches().shape (
tupleofint, optional) –(n_rays, n_gates)of the output; defaults to the sweep shape inindex(single sweep only).blend (
{"cosine", "linear", "mean"}, default"cosine") – Blending window: squared sine (Hann), triangular, or uniform weights.name (
str, optional) – Name of the result when it is not the input’s fields (default"prediction").attrs (
dict, optional) – Attributes for the result variables (for exampleradarx.ml.Model.attrs).n_threads (
int, optional) – Threads of the compiled kernel (default: all cores).engine (
{"auto", "compiled", "numpy"}, default"auto") – Use the compiled kernel when available, or force one implementation.
- Returns:
numpy.ndarray,xarray.DataArray,xarray.Datasetorxarray.DataTree– The same kind of object as the input ofpolar_patches(), with its coordinates. A Dataset (DataTree) gets its fields back when the patches have one channel per field; otherwise the result is one variablenamewith achanneldimension.