- Posts: 1
Request for new wind toolkit dataset option
- Nina Vincent
- Topic Author
Less
More
24 Jun 2025 14:30 #14135
by Nina Vincent
Request for new wind toolkit dataset option was created by Nina Vincent
I'm tryomg to model wind using 2023 resource data. I was able to pull this using tools.FetchResourceFiles by changing line 577 (data_query_url) in ResourceTools.py function _windtk_worker from:
to
Could something like this be added as an option to PySAM? An if statement where if the resource year requested is after 2014, it be pulled from the new wind toolkit or something? The other caveat is I had to rename the columns in the second row of the csv file to match the other dataset or PySAM didn't know how to handle the slightly different names.
"
# overwrites wind weather data file with new column names
def rename_wind_cols(wtk_fp):
ht = wind_ht
print(wtk_fp)
df = pd.read_csv(wtk_fp, header=1, encoding='unicode_escape')
print(df)
if df.columns[8] == 'Surface Air Pressure (Pa)':
df.rename(columns={ df.columns[5]: "wind speed at "+str(ht)+"m (m/s)",
df.columns[6]: "wind direction at "+str(ht)+"m (deg)",
df.columns[7]: "air tempurature at "+str(ht)+"m (C)",
df.columns[8]: "air pressure at 0m (Pa)"},
inplace = True)
col_names = df.columns.copy()
#df.set_axis(list(range(0,9)), axis=1, inplace=True)
df.columns = list(range(0,9))
# --- grab header data ---
#for_header = copy.deepcopy(raw_csv)
header = pd.read_csv(wtk_fp, nrows=2, header=None, encoding='unicode_escape') #.values
header.iloc[1, :] = list(col_names) + [None]
# write out combined
out = pd.concat([header, df]) #, axis='rows'
out.reset_index(drop=True, inplace=True)
out.to_csv(wtk_fp, index=False, header=False)
"
The new wind toolkit dataset: "NREL processed NOAA's HRRR data to overcome limitations for wind energy use, such as missing timesteps, low resolution, and bias versus the WIND Toolkit. The resulting BC-HRRR dataset (2015-2023) ensures consistency through bias correction, enabling seamless use in grid integration studies alongside the WIND Toolkit and future scalability."
Code:
data_query_url = "wtk-download.csv?api_key={}&wkt=POINT({}+{})&attributes=windspeed_{}m,winddirection_{}m,temperature_{}m,pressure_{}m&names={}&utc=false&interval={}&email={}".format(self.nrel_api_key, lon, lat, self.resource_height, self.resource_height, self.resource_height, 100, self.resource_year, self.resource_interval_min, self.nrel_api_email)
to
Code:
data_query_url = "wtk-bchrrr-v1-0-0-download.csv?api_key={}&wkt=POINT({}+{})&attributes=windspeed_{}m,winddirection_{}m,temperature_{}m,pressure_{}m&names={}&utc=false&interval={}&email={}".format(self.nrel_api_key, lon, lat, self.resource_height, self.resource_height, self.resource_height, 0,self.resource_year, self.resource_interval_min, self.nrel_api_email)
Could something like this be added as an option to PySAM? An if statement where if the resource year requested is after 2014, it be pulled from the new wind toolkit or something? The other caveat is I had to rename the columns in the second row of the csv file to match the other dataset or PySAM didn't know how to handle the slightly different names.
"
# overwrites wind weather data file with new column names
def rename_wind_cols(wtk_fp):
ht = wind_ht
print(wtk_fp)
df = pd.read_csv(wtk_fp, header=1, encoding='unicode_escape')
print(df)
if df.columns[8] == 'Surface Air Pressure (Pa)':
df.rename(columns={ df.columns[5]: "wind speed at "+str(ht)+"m (m/s)",
df.columns[6]: "wind direction at "+str(ht)+"m (deg)",
df.columns[7]: "air tempurature at "+str(ht)+"m (C)",
df.columns[8]: "air pressure at 0m (Pa)"},
inplace = True)
col_names = df.columns.copy()
#df.set_axis(list(range(0,9)), axis=1, inplace=True)
df.columns = list(range(0,9))
# --- grab header data ---
#for_header = copy.deepcopy(raw_csv)
header = pd.read_csv(wtk_fp, nrows=2, header=None, encoding='unicode_escape') #.values
header.iloc[1, :] = list(col_names) + [None]
# write out combined
out = pd.concat([header, df]) #, axis='rows'
out.reset_index(drop=True, inplace=True)
out.to_csv(wtk_fp, index=False, header=False)
"
The new wind toolkit dataset: "NREL processed NOAA's HRRR data to overcome limitations for wind energy use, such as missing timesteps, low resolution, and bias versus the WIND Toolkit. The resulting BC-HRRR dataset (2015-2023) ensures consistency through bias correction, enabling seamless use in grid integration studies alongside the WIND Toolkit and future scalability."
Please Log in or Create an account to join the conversation.
- Paul Gilman
Less
More
- Posts: 5584
26 Jun 2025 07:11 #14136
by Paul Gilman
Replied by Paul Gilman on topic Request for new wind toolkit dataset option
Hi Nina,
Thank you for sharing these modifications to the PySAM Resource Tools Helper Functions to work with the latest WIND Toolkit APIs and for your request to update the wind resource file download tools. The source code is on GitHub if you would like to make a code contribution for these modifications: github.com/NREL/pysam/blob/main/files/ResourceTools.py .
One note about files from the BCHRRR V1.0.0 dataset is that those files contain atmospheric pressure data at the surface (height = 0 m), but SAM's Wind Power (PySAM Windpower module) model requires pressure data for at least one height above the ground.
Best regards,
Paul.
Thank you for sharing these modifications to the PySAM Resource Tools Helper Functions to work with the latest WIND Toolkit APIs and for your request to update the wind resource file download tools. The source code is on GitHub if you would like to make a code contribution for these modifications: github.com/NREL/pysam/blob/main/files/ResourceTools.py .
One note about files from the BCHRRR V1.0.0 dataset is that those files contain atmospheric pressure data at the surface (height = 0 m), but SAM's Wind Power (PySAM Windpower module) model requires pressure data for at least one height above the ground.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: Paul Gilman