pydda.retrieval.get_dd_wind_field¶
-
pydda.retrieval.
get_dd_wind_field
(Grids, u_init, v_init, w_init, points=None, vel_name=None, refl_field=None, u_back=None, v_back=None, z_back=None, frz=4500.0, Co=1.0, Cm=1500.0, Cx=0.0, Cy=0.0, Cz=0.0, Cb=0.0, Cv=0.0, Cmod=0.0, Cpoint=0.0, Ut=None, Vt=None, filt_iterations=2, mask_outside_opt=False, weights_obs=None, weights_model=None, weights_bg=None, max_iterations=200, mask_w_outside_opt=True, filter_window=9, filter_order=3, min_bca=30.0, max_bca=150.0, upper_bc=True, model_fields=None, output_cost_functions=True, roi=1000.0)[source]¶ This function takes in a list of Py-ART Grid objects and derives a wind field. Every Py-ART Grid in Grids must have the same grid specification.
In order for the model data constraint to be used, the model data must be added as a field to at least one of the grids in Grids. This involves interpolating the model data to the Grids’ coordinates. There are helper functions for this for WRF and HRRR data in
pydda.constraints()
:make_constraint_from_wrf()
add_hrrr_constraint_to_grid()
- Parameters
- Grids: list of Py-ART Grids
The list of Py-ART grids to take in corresponding to each radar. All grids must have the same shape, x coordinates, y coordinates and z coordinates.
- u_init: 3D ndarray
The intial guess for the zonal wind field, input as a 3D array with the same shape as the fields in Grids.
- v_init: 3D ndarray
The intial guess for the meridional wind field, input as a 3D array with the same shape as the fields in Grids.
- w_init: 3D ndarray
The intial guess for the vertical wind field, input as a 3D array with the same shape as the fields in Grids.
- points: None or list of dicts
Point observations as returned by
pydda.constraints.get_iem_obs()
. Set to None to disable.- vel_name: string
Name of radial velocity field. Setting to None will have PyDDA attempt to automatically detect the velocity field name.
- refl_field: string
Name of reflectivity field. Setting to None will have PyDDA attempt to automatically detect the reflectivity field name.
- u_back: 1D array
Background zonal wind field from a sounding as a function of height. This should be given in the sounding’s vertical coordinates.
- v_back: 1D array
Background meridional wind field from a sounding as a function of height. This should be given in the sounding’s vertical coordinates.
- z_back: 1D array
Heights corresponding to background wind field levels in meters. This is given in the sounding’s original coordinates.
- frz: float
Freezing level used for fall speed calculation in meters.
- Co: float
Weight for cost function related to observed radial velocities.
- Cm: float
Weight for cost function related to the mass continuity equation.
- Cx: float
Weight for cost function related to smoothness in x direction
- Cy: float
Weight for cost function related to smoothness in y direction
- Cz: float
Weight for cost function related to smoothness in z direction
- Cv: float
Weight for cost function related to vertical vorticity equation.
- Cmod: float
Weight for cost function related to custom constraints.
- Cpoint: float
Weight for cost function related to point observations.
- weights_obs: list of floating point arrays or None
List of weights for each point in grid from each radar in Grids. Set to None to let PyDDA determine this automatically.
- weights_model: list of floating point arrays or None
List of weights for each point in grid from each custom field in model_fields. Set to None to let PyDDA determine this automatically.
- weights_bg: list of floating point arrays or None
List of weights for each point in grid from the sounding. Set to None to let PyDDA determine this automatically.
- Ut: float
Prescribed storm motion in zonal direction. This is only needed if Cv is not zero.
- Vt: float
Prescribed storm motion in meridional direction. This is only needed if Cv is not zero.
- filt_iterations: int
If this is greater than 0, PyDDA will run a low pass filter on the retrieved wind field and then do the optimization step for filt_iterations iterations. Set to 0 to disable the low pass filter.
- mask_outside_opt: bool
If set to true, wind values outside the multiple doppler lobes will be masked, i.e. if less than 2 radars provide coverage for a given point.
- max_iterations: int
The maximum number of iterations to run the optimization loop for.
- mask_w_outside_opt: bool
If set to true, vertical winds outside the multiple doppler lobes will be masked, i.e. if less than 2 radars provide coverage for a given point.
- filter_window: int
Window size to use for the low pass filter. A larger window will increase the number of points factored into the polynomial fit for the filter, and hence will increase the smoothness.
- filter_order: int
The order of the polynomial to use for the low pass filter. Higher order polynomials allow for the retention of smaller scale features but may also not remove enough noise.
- min_bca: float
Minimum beam crossing angle in degrees between two radars. 30.0 is the typical value used in many publications.
- max_bca: float
Minimum beam crossing angle in degrees between two radars. 150.0 is the typical value used in many publications.
- upper_bc: bool
Set this to true to enforce w = 0 at the top of the atmosphere. This is commonly called the impermeability condition.
- model_fields: list of strings
The list of fields in the first grid in Grids that contain the custom data interpolated to the Grid’s grid specification. Helper functions to create such gridded fields for HRRR and NetCDF WRF data exist in ::pydda.constraints::. PyDDA will look for fields named U_(model field name), V_(model field name), and W_(model field name). For example, if you have U_hrrr, V_hrrr, and W_hrrr, then specify [“hrrr”] into model_fields.
- output_cost_functions: bool
Set to True to output the value of each cost function every 10 iterations.
- roi: float
Radius of influence for the point observations. The point observation will not hold any weight outside this radius.
- Returns
- new_grid_list: list
A list of Py-ART grids containing the derived wind fields. These fields are displayable by the visualization module.