Roughness Rose plots

[3]:
pwio.plot.roughness_rose(rou_rose)
[4]:
pwio.plot.roughness_rose(rou_rose, gap=True)
[5]:
pwio.plot.roughness_rose(rou_rose, style="bar")
05k10k15k20k25k30k35k050100150200250300
0.00020.030.10.41.5z0 [m]Distance of roughness segment from modeling point [m]Wind direction binned into sectors (center value) [degree]
[6]:
pwio.plot.roughness_rose(rou_rose, style="bar", gap=True)
05k10k15k20k25k30k35k050100150200250300
0.00020.030.10.41.5z0 [m]Distance of roughness segment from modeling point [m]Wind direction binned into sectors (center value) [degree]

Wind rose plots

[7]:
pwio.plot.wind_rose(bwc_from_ts, "IEC_I")
/home/btol/miniforge3/envs/btol/lib/python3.11/site-packages/plotly/express/_core.py:2065: FutureWarning:

When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.

45°90°135°180°225°270°315°00.050.10.150.2
IEC I class. Wind speed range [m/s]0 - 44 - 66 - 99 - 1212 - 1616 - 20
[8]:
pwio.plot.wind_rose(bwc_from_wwc, [0, 5, 10, 15, 30], style = "radar")
/home/btol/miniforge3/envs/btol/lib/python3.11/site-packages/plotly/express/_core.py:2065: FutureWarning:

When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.

45°90°135°180°225°270°315°00.010.020.030.040.050.06
Wind speed range [m/s]0 - 55 - 1010 - 1515 - 30
[9]:
pwio.plot.wind_rose(bwc_from_wwc, "IEC_I", cmap="inferno", gap=True)
/home/btol/miniforge3/envs/btol/lib/python3.11/site-packages/plotly/express/_core.py:2065: FutureWarning:

When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.

45°90°135°180°225°270°315°00.020.040.060.080.10.120.14
IEC I class. Wind speed range [m/s]0 - 44 - 66 - 99 - 1212 - 1616 - 20
[10]:
pwio.plot.wind_rose(wwc_pt, "IEC_I", cmap="inferno", gap=True) #works for a wwc as input
/home/btol/miniforge3/envs/btol/lib/python3.11/site-packages/plotly/express/_core.py:2065: FutureWarning:

When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.

45°90°135°180°225°270°315°00.020.040.060.080.10.120.14
IEC I class. Wind speed range [m/s]0 - 44 - 66 - 99 - 1212 - 1616 - 20
[11]:
# bwc is missing some attributes so raises a validation error
try:
    pwio.plot.wind_rose(bwc)
except PlottingAttrsError as e:
    print(e)
The plot can't be displayed as the following attributes are not defined for 'sector' :
1. Missing attribute value: 'long_name'
2. Missing attribute value: 'units'
Please, define a value for the empty attributes.

Weibull distributions and histograms

[13]:
pwio.plot.histogram(bwc_from_ts, style="faceted", color = "green", weibull = True)
00.20.400.20.4010203000.20.4010203001020300102030
A = 4.51, k = 1.51A = 6.89, k = 2.16A = 7.67, k = 4.34A = 8.57, k = 3.27A = 11.93, k = 4.58A = 12.22, k = 6.43A = 11.51, k = 2.52A = 13.17, k = 4.44A = 13.97, k = 5.51A = 15.32, k = 5.55A = 13.11, k = 4.42A = 7.66, k = 1.610.0°30.0°60.0°90.0°120.0°150.0°180.0°210.0°240.0°270.0°300.0°330.0°Binned wind speed (center value of bin) [m s-1]Relative frequency per wind speed over time conditional on wind direction [`1`]
[14]:
pwio.plot.histogram(bwc_from_ts, style="faceted", color = "green", weibull = True, share_xaxes=False)
010203000.20.4010203001020300102030010203000.20.4010203001020300102030010203000.20.4010203001020300102030
A = 4.51, k = 1.51A = 6.89, k = 2.16A = 7.67, k = 4.34A = 8.57, k = 3.27A = 11.93, k = 4.58A = 12.22, k = 6.43A = 11.51, k = 2.52A = 13.17, k = 4.44A = 13.97, k = 5.51A = 15.32, k = 5.55A = 13.11, k = 4.42A = 7.66, k = 1.610.0°30.0°60.0°90.0°120.0°150.0°180.0°210.0°240.0°270.0°300.0°330.0°Binned wind speed (center value of bin) [m s-1]Relative frequency per wind speed over time conditional on wind direction [`1`]
[15]:
pwio.plot.histogram(bwc_from_ts, style="list", gap = True)[10]
05101520253000.020.040.060.080.10.120.14
A = 13.11, k = 4.42300.0°Binned wind speed (center value of bin) [m s-1]Relative frequency per wind speed over time conditional on wind direction [`1`]
[16]:
#weibull argument displays or not weib. distrib.
pwio.plot.histogram(bwc_from_wwc.isel(sector=[0,3]), style="list", weibull = False)[1]
05101520253000.020.040.060.080.1
90.0°Binned wind speed (center value of bin) [m s-1]Relative frequency per wind speed over time conditional on wind direction [`1`]
[17]:
# Emergent distribution
pwio.plot.histogram(bwc_from_ts, emergent_distribution=True)
05101520253000.020.040.060.080.10.12
All sectorsBinned wind speed (center value of bin) [m s-1]Emergent frequency per wind_speed [1]
[18]:
pwio.plot.histogram_lines(bwc_from_ts)
/home/btol/miniforge3/envs/btol/lib/python3.11/site-packages/plotly/express/_core.py:2065: FutureWarning:

When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.

51015202500.050.10.150.245°90°135°180°225°270°315°00.050.10.150.2
Sector center angle [°]0.030.060.090.0120.0150.0180.0210.0240.0270.0300.0330.0Binned wind speed (center value of bin) [m s-1]Relative frequency per wind speed over time conditional on wind direction [`1`]
[19]:
# bwc is missing attributes
try:
    pwio.plot.histogram_lines(bwc)
except PlottingAttrsError as e:
    print(e)
The plot can't be displayed as the following attributes are not defined for 'sector' :
1. Missing attribute value: 'long_name'
2. Missing attribute value: 'units'
Please, define a value for the empty attributes.
[20]:
# input must be valid bwc, wwc is not accepted
try:
    pwio.plot.histogram(wwc_pt, style = "faceted", weibull = None)
except pwio._errors.WindClimateValidationError as e:
    print(e)
validate found 2 errors
1. Missing variable: wsfreq
2. Missing dimension: wsbin

Operational curves

[22]:
pwio.plot.single_curve(wtg_test.power_output, style = "faceted", color = "dodgerblue", x_axis_range= [1,29.5])
51015202501M2M3M4M51015202551015202501M2M3M4M510152025
StandardLow NoiseEmergencyShutdownHorizontal wind speed [m/s]Electrical Power Output [W]
[23]:
pwio.plot.power_ct_curves(wtg_test, mark_rated = 0.5, x_axis_range= [3,28], title = True)
51015202501M2M3M4M00.5151015202501M2M3M4M00.5151015202501M2M3M4M00.5151015202501M2M3M4M00.51
Bonus 1 MWStandardLow NoiseEmergencyShutdownHorizontal wind speed [m/s]Electrical Power Output [W]Thrust coefficient
[24]:
pwio.plot.power_ct_curves(wtg_test.sel(mode = "Standard"), mark_rated = 0.95, share_yaxes =True, x_axis_range= [1,28], title = True)
51015202500.2M0.4M0.6M0.8M1M00.20.40.60.81
Bonus 1 MWHorizontal wind speed [m/s]Electrical Power Output [W]Thrust coefficient
[25]:
# Don't share the y-axis, which changes the view of the power curves for this artificial case
pwio.plot.power_ct_curves(wtg_test, mark_rated = True, share_yaxes =False, title = True)
05101520253000.5M1M00.5105101520253000.5M1M1.5M2M00.5105101520253001M2M3M00.5105101520253001M2M3M4M00.51
Bonus 1 MWStandardLow NoiseEmergencyShutdownHorizontal wind speed [m/s]Electrical Power Output [W]Thrust coefficient

Vertical profile

[29]:
vp = xr.open_dataset("data/plots/vertical_profile.nc")
vp["height"].attrs = {"long_name" : "Height above the ground", "units" : "m"}
[30]:
pwio.plot.vertical_profile(vp.isel(time=0).wind_speed, vp.isel(time=1).wind_speed)
121314151617181950100150200250300
MeasuredPredictedwind speed [m/s]Height above the ground [m]
[31]:
pwio.plot.vertical_profile(da_meas=vp.isel(time=1).wind_direction)
22522622722822923023123223350100150200250300
Measuredwind direction [degrees]Height above the ground [m]
[32]:
pwio.plot.vertical_profile(da_pred=vp.isel(time=1).wind_direction)
22522622722822923023123250100150200250300
Predictedwind direction [degrees]Height above the ground [m]

Map Plots

Raster map

[33]:
plot_dat = site_effects_squeezed["site_elev"]
pwio.plot.raster_plot(plot_dat);
_images/plotting_examples_nb_40_0.png
[34]:
pwio.plot.raster_plot(landcover)
_images/plotting_examples_nb_41_0.png
[34]:
<matplotlib.collections.QuadMesh at 0x7fd9e00c4e10>
[35]:
plot_dat = site_effects_squeezed["site_elev"]
pwio.plot.raster_plot(plot_dat, color_scale_limits=[0, 200]);
_images/plotting_examples_nb_42_0.png
[37]:
plot_dat = site_effects_squeezed["z0meso"].sel(sector=270)
raster_map = pwio.plot.raster_plot(
    plot_dat,
    pts=points.isel(point=slice(0,10,2))
)
_images/plotting_examples_nb_44_0.png
[ ]: