swirlspy.blending package
Module contents
Blending data / nowcast.
- class swirlspy.blending.Raw(data: DataArray, sites: List[Tuple[float, float, float]] | None = None, weight: float = 0.1)
Bases:
NamedTupleRaw data and it’s required information for composite QPE
Attributes:
- dataxarray.DataArray
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
- data: DataArray
Alias for field number 0
- sites: List[Tuple[float, float, float]]
Alias for field number 1
- weight: float
Alias for field number 2
- swirlspy.blending.comp_qpe(grid_steps: Tuple[float, float], area: Tuple[float, float, float, float], datas: List[Raw], zero_value: float = 13, method: str = 'pdf', method_args: dict | None = None, apply_smoothing: bool = False) DataArray
Calculate composite QPE from multiple data sources. Assume all data is lay on same grid.
Arguments:
- 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.
Returns:
- composite_data {xarray.DataArray}
The composite data calculated from given data sources.
- swirlspy.blending.nwp_bias_correction(radar: DataArray, nwp: DataArray, proj4_str: str | None = None, quantiles: list = [100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0]) 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.
Arguments:
- 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.
Returns:
- nwp_corrected {xarray.DataArray}
Corrected NWP data.
- swirlspy.blending.rains(nwp: DataArray, nowcast: DataArray) DataArray
Calculate blending numerical weather prediction and nowcast result with RaINS. Assume all data is lay on same time grid.
Arguments:
- nwp: (xarray.DataArray)
Numerical weather prediction
- nowcast: (xarray.DataArray)
Nowcast result data.
Returns:
- blended_data {xarray.DataArray}
The blended nowcast data.