Wind Resource for Continental U.S. (API)#
By default, wind resource data is downloaded from the NREL Developer Network hosted Wind Integration National Dataset (WIND) Toolkit dataset Wind Toolkit Data - SAM format (srw).
Wind resource data for the continental U.S. can be downloaded from Wind Toolkit for wind resource years 2007 - 2014. Using this functionality requires an NREL API key.
Wind data for the continental U.S. for wind resource years 2015 - 2023 can be downloaded from the BC-HRRR dataset, see BC-HRRR Dataset Wind Resource (API).
- class hopp.simulation.technologies.resource.wind_resource.WindResource(lat, lon, year, wind_turbine_hub_ht, path_resource=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/hopp/envs/latest/lib/python3.11/site-packages/hopp/simulation/resource_files'), filepath='', source='WTK', use_api=False, resource_data=None, **kwargs)#
Bases:
ResourceClass to manage Wind Resource data from API calls or preloaded data.
- Parameters:
lat (float)
lon (float)
year (int)
wind_turbine_hub_ht (float)
path_resource (str | Path)
filepath (str | Path)
source (str)
use_api (bool)
resource_data (dict | None)
- allowed_hub_height_meters: List[int] = [10, 40, 60, 80, 100, 120, 140, 160, 200]#
- __init__(lat, lon, year, wind_turbine_hub_ht, path_resource=PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/hopp/envs/latest/lib/python3.11/site-packages/hopp/simulation/resource_files'), filepath='', source='WTK', use_api=False, resource_data=None, **kwargs)#
Resource class to download wind resource data using API call or set with preloaded dictionary
- Parameters:
lat (float) – latitude corresponding to location for wind resource data
lon (float) – longitude corresponding to location for wind resource data
year (int) – year for resource data. must be between 2007 and 2014
wind_turbine_hub_ht (float) – turbine hub height (m)
path_resource (Union[str, Path], optional) – filepath to resource_files directory. Defaults to ROOT_DIR/”simulation”/”resource_files”.
filepath (Union[str, Path], optional) – file path of resource file to load
source (str) – Which API to use. Options are TAP and WIND Toolkit (WTK).
use_api (bool, optional) – Make an API call even if there’s an existing file. Defaults to False.
resource_data (Optional[dict], optional) – dictionary of preloaded and formatted wind resource data. Defaults to None.
kwargs – extra kwargs
- hub_height_meters: float#
the hub-height for wind resource data (meters)
- file_resource_heights: dict#
dictionary of heights and filenames to download from Wind Toolkit
- filename#
filepath of resource data file, defaults to None
- calculate_heights_to_download()#
Given the system hub height, and the available hubheights from WindToolkit, determine which heights to download to bracket the hub height
- static call_api(url, filename)#
- Parameters:
url (str) – The API endpoint to return data from
filename (str) – The filename where data should be written
- Returns:
True if downloaded file successfully, False if encountered error in downloading
- update_height(hub_height_meters)#
- download_resource()#
Download resource for given lat/lon
- combine_wind_files()#
- Parameters:
file_resource_heights (dict) – Keys are height in meters, values are corresponding files example {40: path_to_file, 60: path_to_file2}
file_out (string) – File path to write combined srw file
- format_data()#
Format as ‘wind_resource_data’ dictionary for use in PySAM.
- property data#
Get data as dictionary formatted for SAM