Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving indexing of solar weather file based on dt in input .yaml file #111

Merged
merged 17 commits into from
Aug 31, 2024

Conversation

brookeslawski
Copy link
Collaborator

This pull request improves the way that solar_pysam.py selects data from the input solar weather file. The input solar weather file contains timeseries weather data at a temporal resolution that may or may not be the same as dt in the input .yaml file. This pull request ensures that solar_pysam.py is selecting weather data at the correct timestamp. For example, if the input solar weather file contains data at every 0.5 second, but dt = 1.0 s in the .yaml file, the solar module will select data at every second after the timestamp of the first row of data.

If dt is not equal to or a multiple (>1) of the temporal resolution in the input solar weather file, a warning will print to the hercules log file.

This pull request does interpolate input data if dt is smaller than the temporal resolution in the input solar weather file. This interpolation should happen outside of hercules as part of pre-processing. An example of this pre-processing is included in example_case_folders/07_floris_standin_and_solar_pysam/read_solar_precursor_data.ipynb.

I have also improved the handling of timezones and added a warning that timezone must be included in the input solar weather file timestamps.

Also included are the input weather files from the ARM experiment and from the Flatirons campus, which were used for testing.

@brookeslawski
Copy link
Collaborator Author

All tests are passing locally.
image

@misi9170
Copy link
Collaborator

misi9170 commented Aug 6, 2024

All tests are passing locally.

Thanks @brookeslawski ! See this pull request for attempts (which were ultimately unsuccessful) to get these failing tests on github to clear. For the time being, we'll just ensure the tests pass locally.

@brookeslawski
Copy link
Collaborator Author

Per Misha's suggestion, added a verbose flag in the SolarPySAM module to toggle on and off the print statements used for debugging. Re-ran tests and they all pass locally.

@@ -238,7 +238,7 @@ def receive_amrwind_data(self):
# Assign Py_sim outputs
if self.main_dict["py_sims"]:
self.main_dict["py_sims"]["inputs"]["available_power"] = sum(turbine_power_array)
print("sim_time_s_amr_wind = ", sim_time_s_amr_wind)
# print("sim_time_s_amr_wind = ", sim_time_s_amr_wind)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaning up print statements that I had added long ago

Copy link
Collaborator

@genevievestarke genevievestarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good! I think down the line we'll want to put 'verbose' as a global variable, like dt, but I think this works for now!

@genevievestarke genevievestarke merged commit ec97c75 into NREL:develop Aug 31, 2024
6 of 9 checks passed
@misi9170 misi9170 mentioned this pull request Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants