improver.nowcasting.pysteps_advection module#
Semi-Lagrangian backward advection plugin using pysteps
- class PystepsExtrapolate(interval, max_lead_time)[source]#
Bases:
BasePluginWrapper for the pysteps semi-Lagrangian extrapolation method
- Reference:
https://pysteps.readthedocs.io/en/latest/generated/ pysteps.extrapolation.semilagrangian.extrapolate.html
- _abc_impl = <_abc._abc_data object>#
- _generate_displacement_array(ucube, vcube)[source]#
Create displacement array of shape (2 x m x n) required by pysteps algorithm
- _generate_forecast_cubes(all_forecasts, attributes_dict)[source]#
Convert forecast arrays into IMPROVER output cubes with re-added orographic enhancement
- Parameters:
- Return type:
- Returns:
List of iris.cube.Cube instances containing forecasts at all required lead times, and conforming to the IMPROVER metadata standard.
- _get_advectable_precip_rate()[source]#
From the initial cube, generate a precipitation rate array in mm h-1 with orographic enhancement subtracted, as required for advection
- Return type:
- Returns:
2D precipitation rate array in mm h-1
- _reformat_analysis_cube(attribute_changes)[source]#
Add forecast reference time and forecast period coordinates (if they do not already exist) and nowcast attributes to analysis cube
- _set_up_output_cubes(all_forecasts)[source]#
Convert 3D numpy array into list of cubes with correct time metadata. All other metadata are inherited from self.analysis_cube.
- process(initial_cube, ucube, vcube, orographic_enhancement, attributes_dict=None)[source]#
Extrapolate the initial precipitation field using the velocities provided to the required forecast lead times
- Parameters:
initial_cube (
Cube) – Cube of precipitation at initial timeucube (
Cube) – x-advection velocitiesvcube (
Cube) – y-advection velocitiesorographic_enhancement (
Cube) – Cube containing orographic enhancement fields at all required lead timesattributes_dict (
Optional[Dict]) – Dictionary containing information for amending the attributes of the output cube.
- Return type:
- Returns:
List of extrapolated iris.cube.Cube instances at the required lead times (including T+0 / analysis time)