wrf.cloudfrac

wrf.cloudfrac(vert, relh, vert_inc_w_height, low_thresh, mid_thresh, high_thresh, missing=<MagicMock name='mock().item()' id='140675643013392'>, meta=True)

Return the cloud fraction.

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

  • return_val[0,…] will contain LOW level cloud fraction
  • return_val[1,…] will contain MID level cloud fraction
  • return_val[2,…] will contain HIGH level cloud fraction

The low_thresh, mid_thresh, and high_threshold paramters specify the low, mid, and high cloud levels in the same units as vert.

In mountainous regions, there is a possibility that the lowest WRF level will be higher than the low_cloud or mid_cloud threshold. When this happens, a fill value will be used in the output at that location.

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:
  • vert (xarray.DataArray or numpy.ndarray) –

    The vertical coordinate variable (usually pressure or height) with the rightmost dimensions as bottom_top x south_north x west_east

    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.

  • relh (xarray.DataArray or numpy.ndarray) – Relative humidity with the same dimensionality as vert
  • vert_inc_w_height (int) – Set to 1 if the vertical coordinate values increase with height (height values). Set to 0 if the vertical coordinate values decrease with height (pressure values).
  • low_thresh (float) – The bottom vertical threshold for what is considered a low cloud.
  • mid_thresh (float) – The bottom vertical threshold for what is considered a mid level cloud.
  • high_thresh (float) – The bottom vertical threshold for what is considered a high cloud.
  • missing (float:, optional) – The fill value to use for areas where the surface is higher than the cloud threshold level (e.g. mountains). Default is wrf.default_fill(numpy.float64).
  • meta (bool) – Set to False to disable metadata and return numpy.ndarray instead of xarray.DataArray. Default is True.

Warning

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

Returns:The cloud fraction array whose leftmost dimension is 3 (LOW=0, MID=1, HIGH=2). 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