<jupyter_start><jupyter_text>Wind shear estimation* RESKit will vertically adjust wind speeds to accoutn for wind shear* Uses a logarithmic wind profile approach* Requires estimating roughness length, and having a "known" wind speed<jupyter_code>import reskit as rk

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Create a weather source, and load data
src = rk.weather.sources.MerraSource(rk._TEST_DATA_["weather_data"], bounds=[5,49,7,52], verbose=False)
src.loadWindSpeed()<jupyter_output><empty_output><jupyter_text>Get an adjusted time series for a specific location<jupyter_code># Extract raw wind speed and GHI data
location = (6.0,50.5)

windspeeds = src.get("windspeed", locations=location)
print(windspeeds.head())
# Estimate roughness length at the location from a land-cover dataset
#  - In this example, Corine Land Cover will be used
#  - in this case, roughness lengths are taken from the suggestions by Silva et al.
#    "Roughness Length Classification Of Corine Land Cover Classes". 2007

roughness = rk.weather.windutil.roughnessFromCLC(clcPath=rk._TEST_DATA_['clc-aachen_clipped.tif'],
                                                 loc=location)

print("Estimated roughness is {}m".format(roughness) )
# Apply log-law projection
projected_windspeed = rk.weather.windutil.projectByLogLaw(measuredWindspeed=windspeeds,
                                                          measuredHeight=50, # The MERRA dataset offers windspeeds at 50m
                                                          targetHeight=120,  # Assuming we want to project up to 120m
                                                          roughness=roughness)

print(projected_windspeed.head())<jupyter_output>2015-01-01 00:30:00.000013+00:00    6.595749
2015-01-01 01:30:00+00:00           6.434542
2015-01-01 02:30:00.000026+00:00    6.237052
2015-01-01 03:30:00.000013+00:00    6.085633
2015-01-01 04:30:00+00:00           6.350049
Name: (6.00000,50.50000), dtype: float32<jupyter_text>Get adjusted time series for multiple locations at once<jupyter_code># Extract raw wind speed and GHI data
locations = [(6.25,51.), (6.50,51.), (6.25,50.75)]

windspeeds = src.get("windspeed", locations=locations)
windspeeds.head()
roughness = rk.weather.windutil.roughnessFromCLC(clcPath=rk._TEST_DATA_['clc-aachen_clipped.tif'], 
                                                 loc=locations, )

print("Estimated roughnesses are:")
print("  At {}: {}m".format(str(locations[0]), roughness[0]) )
print("  At {}: {}m".format(str(locations[1]), roughness[1]) )
print("  At {}: {}m".format(str(locations[2]), roughness[2]) )

projected_windspeed = rk.weather.windutil.projectByLogLaw(measuredWindspeed=windspeeds,
                                                          measuredHeight=50, # The MERRA dataset offers windspeeds at 50m
                                                          targetHeight=120,  # Assuming we want to project up to 120m
                                                          roughness=np.array(roughness))

projected_windspeed.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10122107969151671, 'fraction_numerical': 0.06940874035989718, 'mean_word_length': 2.787104622871046, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '165992', 'license': 'MIT', 'n_tokens_mistral': 1069, 'n_tokens_neox': 892, 'n_words': 229, 'path': 'examples/1.03-Weather-Vertically_project_wind_speed.ipynb', 'repo_name': 'nlandwehrfzj/RESKit', 'size': '3112'}