swirlspy.blending package

Blending data / nowcast.

class swirlspy.blending.Raw(data: xarray.core.dataarray.DataArray, sites: Optional[List[Tuple[float, float, float]]] = None, weight: float = 0.1)

Bases: tuple

Raw data and it’s required information for composite QPE


raw data

siteslist of (axis 1, axis 2, radius), Default is None

a list radar information, point of center (axis 1, axis 2) and effectivity area’s radius

weightfloat, Default is 0.1

weighting of data in the output data

property data

Alias for field number 0

property sites

Alias for field number 1

property weight

Alias for field number 2

swirlspy.blending.comp_qpe(grid_steps: Tuple[float, float], area: Tuple[float, float, float, float], datas: List[swirlspy.blending._comp_qpe.Raw], zero_value: float = 13, method: str = 'pdf', method_args: Optional[dict] = None, apply_smoothing: bool = False)xarray.core.dataarray.DataArray

Calculate composite QPE from multiple data sources. Assume all data is lay on same grid.

grid_steps: (axis 1’s step size, axis 2’s step size)

step size of grid on both axis, e.g. (y, x), (northing, easting)

area: (axis 1’s start, axis 1’s end, axis 2’s start, axis 2’s end)

boundary of output area

datas: list of (Raw)

Data sources with necessary data, see {Raw} for details.

composite_data {xarray.DataArray}

The composite data calculated from given data sources.

swirlspy.blending.nwp_bias_correction(radar: xarray.core.dataarray.DataArray, nwp: xarray.core.dataarray.DataArray, proj4_str: Optional[str] = None, quantiles: list = [100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0])xarray.core.dataarray.DataArray

Bias correction of numerical weather prediction data. The objective of bias correction is to match the nwp percentile to the radar percentile This is also known as frequency matching.

radar: (xarray.DataArray)

Radar data

nwp: (xarray.DataArray)

Numerical weather prediction

quantiles: list of (int)

Probability quantiles to caculate the percentiles of NWP and radar.

nwp_corrected {xarray.DataArray}

Corrected NWP data.

swirlspy.blending.rains(nwp: xarray.core.dataarray.DataArray, nowcast: xarray.core.dataarray.DataArray)xarray.core.dataarray.DataArray

Calculate blending numerical weather prediction and nowcast result with RaINS. Assume all data is lay on same time grid.

nwp: (xarray.DataArray)

Numerical weather prediction

nowcast: (xarray.DataArray)

Nowcast result data.

blended_data {xarray.DataArray}

The blended nowcast data.