pywasp.wasp.stability_histogram

pywasp.wasp.stability_histogram(ds, hist=None, finalize=True, revert_to_original=True, ws_bin_width=1, nwsbins=40, nsecs=12, percentile=0.5, wv_count=None, landmask=None)[source]

Add timeseries to existing histogram

Uses the stability parameters “temp_scale” and “ustar_over_pblh”. See the paper “Using observed and modelled heat fluxes for improved extrapolation of wind distributions” for the definitions of these variables. The temp_scale variable is defined as $T_*$ in that paper, whereas the “ustar_over_pblh” should be defined as $u_*/pblh$ as input for this function. This is done to give priority to the smallest pblh that are most important for the wind profile. The output is reversed ($**-1$) to give the input format as required by WAsP ($pblh/u_*$). The time dimension is copied so that one can see what was the period that was used to generate the histogram.

Warning

This function is experimental and its signature may change.

Parameters:
  • ds (xarray.Dataset) – Dataset containing variables [‘wind_speed’, ‘wind_direction’, ‘temp_scale’, ‘ustar_over_pblh’] Can have any pywasp spatial structure

  • hist (xarray.Dataset) – Histogram with dimensions point, wsbin, sector

  • finalize (bool) – Convert the stabilility histogram into a mean and standard deviation?

  • revert_to_original (bool) – Return the histogram input in original format from the input ds? If false, keeps the data in stacked point format which is more efficient when doing large calculations for numerical wind atlases.

  • ws_bin_width (float) – width of wind speed bins

  • nwsbins (int) – Number of wind speed bins

  • nsecs (int) – Number of sectors (wind direction bins)

  • kwargs – Other keyword arguments passed on to _finalize_meso

Returns:

hist (xarray.Dataset) – Histogram with dimensions point, wsbin, sector with the values from ds-timeseries added.