swirlspy.qpf package

Submodules

swirlspy.qpf.persistence module

swirlspy.qpf.persistence.persistence(xr2d, timesteps, timesteps_size)

Forecast by persistence, accepting an observation xarray and returning a forecast xarray. Persistence means that the forecast is exactly same as the observation. While it sounds trivial, this is usefulf for benchmarking the performance of another QPF algorithm.

Parameters:
  • xr2d (xarray.DataArray (2-dimensional, in 'x' 'y')) – The xarray containing data to be forecast
  • timesteps (int) – Number of timesteps to be forecast
  • timesteps_size (int) – Time interval between each steps, in minutes.
Returns:

persistence_xrnd – Data values in ‘xr2d’ being copied along the ‘end_time’ axis, coordinates of ‘end_time’ axis have a unique value for each timestep.

Return type:

xarray.DataArray

swirlspy.qpf.rover module

swirlspy.qpf.rover.rover(qpf_xarray, start_level=1, max_level=7, rho=9.0, alpha=2000.0, sigma=1.5, gray_scale=True, atan_dBZ_min=-1.482, atan_dBZ_max=1.412, ashift=33.0, afact=4.0)

Running rover to generate u and v motion fields for QPF.

Parameters:
  • qpf_xarray (xarray.DataArray) – Contains reflectivity data. First element of array corresponds to the geographic upper left corner.
  • start_level (int) – Starting level used as base in multigrid algorithm. Higher=coarser. Defaults to 1.
  • max_level (int) – Maximum level to be reached in multigrid algorithm. Higher=coarser. Defaults to 7.
  • rho (float) – Gaussian smoothing parameter. Defaults to 9.0.
  • alpha (float) – Regularisation parameter in the energy functional. Defaults to 2000.0.
  • sigma (float) – Gaussian smoothing parameter. Defaults to 1.5.
  • atan_dBZ_min (float) – Minimum arc tangent value. Defaults to -1.482.
  • atan_dBZ_max (float) – Maximum arc tangent value. Defaults to 1.412.
  • ashift (float) – Point of inflection. Defaults to 33 dBZ.
  • afact (float) – Sharpness of inflection. Defaults to 4.0 dBZ.
Returns:

  • motion_u (xarray.DataArray) – x component of motion field.
  • motion_v (xarray.DataArray) – y component of motion field.

Notes

Default values of start_level, max_level, rho, alpha and sigma are those of ROVER-A.

swirlspy.qpf.sla module

swirlspy.qpf.sla.sla(qpf_xarray, motion_u, motion_v, steps=6)

Calculates forecast reflectivity using Semi-Lagrangian Advection from horizontal and vertical motion fields.

Parameters:
  • qpf_xarray (xarray.DataArray) – Contains reflectivity data. First element of array corresponds to the geographic upper left corner.
  • motion_u (xarray.DataArray) – x component of motion field.
  • motion_v (xarray.DataArray) – y component of motion field.
Returns:

forecast – A xarray.DataArray populated with forecast reflectivity and metadata.

Return type:

xarray.DataArray