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.gen_xarray(qpf_xarray, motion_u, motion_v, reflectivity, timelist, time_step_size, steps, end_time, y_name, x_name)

Generating xarrays for motion fields and forecast reflectivity.

Parameters:
  • qpf_xarray (xarray.DataArray.) – Original xarray input into rover.
  • motion_u (numpy.ndarray.) – N-D Array containing motion_u generated by rover.
  • motion_v (numpy.ndarray.) – N-D Array containing motion_v generated by rover.
  • reflectivity (numpy.ndarray) – N-D Array containing reflectivity values extrapolated by rover.
  • timelist (list of strings) – List of time-strings corresponding to the times for which reflectivity values are extrapolated by rover.
  • time_step_size (int) – Time in minutes of each timestep.
  • steps (int) – Number of steps to extrapolate.
  • end_time (str) – Time of the final radar timestep.
  • y_name (str) – Name of dimension corresponding to the north-south direction.
  • x_name (str) – Name of dimension corresponding to the east-west direction.
Returns:

  • motion_u (xarray.DataArray) – x-component of motion field.
  • motion_v (xarray.DataArray) – y_component of motion field.
  • reflectivity (xarray.DataArray) – reflectivity in dBZ.

swirlspy.qpf.rover.rover(qpf_xarray, valid_time, steps, time_step_size)

Perform qpf by calling ‘rover.so’ and using xarray.

Parameters:
  • qpf_xarray (xarray.DataArray) – Contains reflectivity data to be extrapolated by rover. First element of array corresponds to the geographic upper left corner.
  • valid_time (str) – Time in %y%m%d%H%M of the first timestep radar file.
  • steps (int) – Number of timesteps to extrapolate. Default is 6.
  • time_step_size (int) – Separation time between 2 input radar files in minutes.
  • path (str) – stores the path of the file calling the module.
Returns:

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

swirlspy.qpf.rover.time_update(initial, time_step_size)

Shift time by a certain amount.

Parameters:
  • initial (str) – Base time, in %y%m%d%H%M.
  • time_step_size (str) – Amount of time to shift, in minutes.
Returns:

end – Updated time, in %y%m%d%H%M.

Return type:

str