- Posts: 2
Sub-hourly generation data for wind in PySAM
- abadgett
- Topic Author
Less
More
15 Dec 2021 15:26 #10400
by abadgett
Sub-hourly generation data for wind in PySAM was created by abadgett
Hi all,
I am working on building models in PySAM that use sub-hourly resource data to estimate power output from a wind farm at various locations. My understanding of PySAM and sub-hourly input data is that the output generation data will be at the same interval as the weather input file. I get this behavior for the PVWatts model in PySAM but I cannot seem to get the wind output data at intervals less than hourly.
I am attaching a basic file that pulls 5 minute resolution data and runs PySAM for a wind plant. It seems that the length of the generation output from the simulation is always 8,760. Does the wind module in PySAM have the ability to output sub-hourly generation, or am I missing a command for accessing that data?
Thank you in advance for your help!
Alex
I am working on building models in PySAM that use sub-hourly resource data to estimate power output from a wind farm at various locations. My understanding of PySAM and sub-hourly input data is that the output generation data will be at the same interval as the weather input file. I get this behavior for the PVWatts model in PySAM but I cannot seem to get the wind output data at intervals less than hourly.
I am attaching a basic file that pulls 5 minute resolution data and runs PySAM for a wind plant. It seems that the length of the generation output from the simulation is always 8,760. Does the wind module in PySAM have the ability to output sub-hourly generation, or am I missing a command for accessing that data?
Thank you in advance for your help!
Alex
Attachments:
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
16 Dec 2021 11:05 - 16 Dec 2021 11:06 #10408
by pgilman
Replied by pgilman on topic Sub-hourly generation data for wind in PySAM
Hi Alex,
After some digging around, I found that the FetchResourceFiles() class has a function csv_to_srw that resamples the wind resource data to hourly data. That code starts here:
github.com/NREL/pysam/blob/1e786dbda5f3d870b787cb6e0f17a06dbfde2a78/files/ResourceTools.py#L402
I'm not sure why that is necessary given that the wind model should work with subhourly data.
One solution would be to modify FetchResourceFiles() to skip the resampling step.
You could also create an issue for this at:
github.com/NREL/pysam/issues
Best regards,
Paul.
After some digging around, I found that the FetchResourceFiles() class has a function csv_to_srw that resamples the wind resource data to hourly data. That code starts here:
github.com/NREL/pysam/blob/1e786dbda5f3d870b787cb6e0f17a06dbfde2a78/files/ResourceTools.py#L402
I'm not sure why that is necessary given that the wind model should work with subhourly data.
One solution would be to modify FetchResourceFiles() to skip the resampling step.
You could also create an issue for this at:
github.com/NREL/pysam/issues
Best regards,
Paul.
Last edit: 16 Dec 2021 11:06 by pgilman.
Please Log in or Create an account to join the conversation.
- abadgett
- Topic Author
Less
More
- Posts: 2
20 Dec 2021 08:46 #10419
by abadgett
Replied by abadgett on topic Sub-hourly generation data for wind in PySAM
Thanks so much for your help and response Paul! For anyone else who might run into this issue, I was able to get things working by making the following changes in the ResourceTools.py file:
Commented out line 406 which resampled the resource dataframe:
#df.df.resample('H').first()
Adjusted the dataframe shape command in line 425 to reflect the length of the dataframe passed
Original:
To:
Just want to note that I have not performed any detailed analysis into if this adjustment impacts any other calculations in the Wind PySAM module, but total energy generated and LCOE calculations seem to be consistent from hourly to 5min intervals.
Commented out line 406 which resampled the resource dataframe:
#df.df.resample('H').first()
Adjusted the dataframe shape command in line 425 to reflect the length of the dataframe passed
Original:
Code:
assert df.shape == (8760, 4)
Code:
assert df.shape == (len(df), 4)
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
20 Dec 2021 18:00 #10422
by pgilman
Replied by pgilman on topic Sub-hourly generation data for wind in PySAM
Hi Alex,
Thanks for sharing that.
I created an issue on the PySAM GitHub repository in case any one would like to tackle fixing this:
github.com/NREL/pysam/issues/105
Best regards,
Paul.
Thanks for sharing that.
I created an issue on the PySAM GitHub repository in case any one would like to tackle fixing this:
github.com/NREL/pysam/issues/105
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman