Skip to content

Commit

Permalink
split long comments into multiple lines
Browse files Browse the repository at this point in the history
  • Loading branch information
elenya-grant committed Jan 20, 2025
1 parent 4740b1d commit f7c7f79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions hopp/simulation/technologies/resource/nsrdb_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ def download_resource(self):
self.nsrdb_latitude = f.meta['latitude'].iloc[site_gid]
self.nsrdb_longitude = f.meta['longitude'].iloc[site_gid]

# extract remaining datapoints: year, month, day, hour, minute, dn, df, gh, wspd,tdry, pres, tdew
# NOTE: datasets have readings at 0 and 30 minutes each hour, HOPP/SAM workflow requires only 30 minute reading values -> filter 0 minute readings with [1::2]
# NOTE: datasets are not auto shifted by timezone offset -> wrap extraction in SAMResource.roll_timeseries(input_array, timezone, #steps in an hour=1) to roll timezones
# NOTE: solar_resource.py code references solar_zenith_angle and RH = relative_humidity but I couldn't find them actually being utilized. Captured them below just in case.
# extract remaining datapoints:
# year, month, day, hour, minute, dn, df, gh, wspd,tdry, pres, tdew

# 1) NOTE: datasets have readings at 0 and 30 minutes each hour,
# HOPP/SAM workflow requires only 30 minute reading values -> filter 0 minute readings with [1::2]
# 2) NOTE: datasets are not auto shifted by timezone offset
# -> wrap extraction in SAMResource.roll_timeseries(input_array, timezone, #steps in an hour=1) to roll timezones
# 3) NOTE: solar_resource.py code references solar_zenith_angle and RH = relative_humidity but I couldn't find them
# actually being utilized. Captured them below just in case.
self.year_arr = f.time_index.year.values[1::2]
self.month_arr = f.time_index.month.values[1::2]
self.day_arr = f.time_index.day.values[1::2]
Expand Down
6 changes: 4 additions & 2 deletions hopp/simulation/technologies/resource/wind_toolkit_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def download_resource(self):
# instantiate temp dictionary to hold each attributes dataset
self.wind_dict = {}
# loop through hub heights to download, capture datasets
# NOTE: datasets are not auto shifted by timezone offset -> wrap extraction in SAMResource.roll_timeseries(input_array, timezone, #steps in an hour=1) to roll timezones
# NOTE: datasets are not auto shifted by timezone offset
# -> wrap extraction in SAMResource.roll_timeseries(input_array, timezone, #steps in an hour=1) to roll timezones
# NOTE: pressure datasets unit = Pa, convert to atm via division by 101325
for h in self.data_hub_heights:
self.wind_dict['temperature_{height}m_arr'.format(height=h)] = SAMResource.roll_timeseries((f['temperature_{height}m'.format(height=h), :, site_gid]), time_zone, 1)
Expand Down Expand Up @@ -164,7 +165,8 @@ def format_data(self):
self.wind_dict['winddirection_{h}m_arr'.format(h=self.data_hub_heights[1])])]

elif len(self.data_hub_heights) == 1:
# NOTE: Unsure if SAM/PySAM is sensitive to data types ie: floats with long precision vs to 2 or 3 decimals. If not sensitive, can remove following 4 lines of code to increase computational efficiency
# NOTE: Unsure if SAM/PySAM is sensitive to data types ie: floats with long precision vs to 2 or 3 decimals.
# If not sensitive, can remove following 4 lines of code to increase computational efficiency
self.wind_dict['temperature_{h}m_arr'.format(h=self.data_hub_heights[0])] = np.round((self.wind_dict['temperature_{h}m_arr'.format(h=self.data_hub_heights[0])]), decimals=1)
self.wind_dict['pressure_{h}m_arr'.format(h=self.data_hub_heights[0])] = np.round((self.wind_dict['pressure_{h}m_arr'.format(h=self.data_hub_heights[0])]), decimals=2)
self.wind_dict['windspeed_{h}m_arr'.format(h=self.data_hub_heights[0])] = np.round((self.wind_dict['windspeed_{h}m_arr'.format(h=self.data_hub_heights[0])]), decimals=3)
Expand Down

0 comments on commit f7c7f79

Please sign in to comment.