diff --git a/hopp/simulation/technologies/resource/nsrdb_data.py b/hopp/simulation/technologies/resource/nsrdb_data.py index 084187d15..0b4b1180e 100644 --- a/hopp/simulation/technologies/resource/nsrdb_data.py +++ b/hopp/simulation/technologies/resource/nsrdb_data.py @@ -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] diff --git a/hopp/simulation/technologies/resource/wind_toolkit_data.py b/hopp/simulation/technologies/resource/wind_toolkit_data.py index 42fa38e9a..5a4da7f40 100644 --- a/hopp/simulation/technologies/resource/wind_toolkit_data.py +++ b/hopp/simulation/technologies/resource/wind_toolkit_data.py @@ -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) @@ -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)