wrf.uvmet

wrf.uvmet(u, v, lat, lon, cen_long, cone, meta=True, units='m s-1')

Return the u,v components of the wind rotated to earth coordinates.

The leftmost dimension of the returned array represents two different quantities:

  • return_val[0,…] will contain U
  • return_val[1,…] will contain V

This is the raw computational algorithm and does not extract any variables from WRF output files. Use wrf.getvar() to both extract and compute diagnostic variables.

Parameters:
  • u (xarray.DataArray or numpy.ndarray) –

    The u component of the wind [m s-1]. This variable can be staggered or unstaggered, but must be at least two dimensions. If staggered, the rightmost dimensions are south_north x west east.

    If staggered, the rightmost dimensions are south_north x west_east_stag.

    Note

    This variable must be supplied as a xarray.DataArray in order to copy the dimension names to the output. Otherwise, default names will be used.

  • v (xarray.DataArray or numpy.ndarray) –

    The v component of the wind [m s-1]. This variable can be staggered or unstaggered, but must be at least two dimensions. If staggered, the rightmost dimensions are south_north x west east.

    If staggered, the rightmost dimensions are south_north_stag x west_east.

  • lat (xarray.DataArray or numpy.ndarray) –

    The latitude array.

    This array can either be:

    • two-dimensional of size south_north x west_east.
    • multi-dimensional with the same number of dimensions as u and v, but with rightmost dimensions south_north x west_east and the same leftmost dimensions as u and v
    • multi-dimensional with one fewer dimensions as u and v, with rightmost dimensions south_north x west_east and the same leftmost dimensions as u and v, minus the third-from-the-right dimension of u and v.

    Note

    This variable must also be supplied as a xarray.DataArray in order to copy the dimension names to the output. Otherwise, default names will be used.

  • lon (xarray.DataArray or numpy.ndarray) –

    The longitude array.

    This array can either be:

    • two-dimensional of size south_north x west_east.
    • multi-dimensional with the same number of dimensions as u and v, but with rightmost dimensions south_north x west_east and the same leftmost dimensions as u and v
    • multi-dimensional with one fewer dimensions as u and v, with rightmost dimensions south_north x west_east and the same leftmost dimensions as u and v, minus the third-from-the-right dimension of u and v.
  • cen_long (float) – The standard longitude for the map projection.
  • cone (float) –

    The cone factor used for the map project. If the projection is not a conic projection, the cone is simply 1.0. For conic projections, the cone factor is given by:

    if((fabs(true_lat1 - true_lat2) > 0.1) and
    (fabs(true_lat2 - 90.) > 0.1)):
        cone = (log(cos(true_lat1*radians_per_degree))
        - log(cos(true_lat2*radians_per_degree)))
    
        cone = (cone /
        (log(tan((45.-fabs(true_lat1/2.))*radians_per_degree))
        - log(tan((45.-fabs(true_lat2/2.))*radians_per_degree))))
    else:
        cone = sin(fabs(true_lat1)*radians_per_degree)
    
  • meta (bool) – Set to False to disable metadata and return numpy.ndarray instead of xarray.DataArray. Default is True.
  • units (str) – The desired units. Refer to the getvar() product table for a list of available units for ‘uvmet’. Default is ‘m s-1’.

Warning

The input arrays must not contain any missing/fill values or numpy.nan values.

Returns:The u,v components of the wind rotated to earth coordinates. The leftmost dimension size is 2, for u and v. If xarray is enabled and the meta parameter is True, then the result will be an xarray.DataArray object. Otherwise, the result will be a numpy.ndarray object with no metadata.
Return type:xarray.DataArray or numpy.ndarray

See also

wrf.getvar()