-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Implement dynamic faiman model and function to fit this to measurements #1878
Conversation
@pvlib/pvlib-maintainer This PR request is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This extension of faiman
smooths the inputs, and prilliman
smooths the output, both are intended to account for thermal inertia. Is that right?
My reaction is that we may want to build this into faiman
as a kwarg-activated option, along with the extension in faiman_rad
. Thoughts?
If general commentary is helpful, I support this premise of this additional because 1) transient (dynamic) temperature modeling is important for sub-hourly modeling and 2) I think tools to fit temperature models to observations are valuable for monitoring in ongoing plant operation (e.g., to make sure back of module temperature measurements don't drift over time due to sensor detachment). |
Fundamentally correct. The main difference is that my focus is on extracting model parameters, and being able to simulate better is a nice added benefit.
I see both Never-the-less, there may be some kwarg-activated option that fits the bill. |
Here is some more specific feedback:
edit: I added a boxplot and calcs to the gist. The fit version of |
Great to see it worked out of the box, @williamhobbs! Do the stats include night-time values? |
Edit to clarify my intention: It looks like @adriesse, I just remembered that the EPRI SSRC dataset* has downwelling longwave/IR irradiance, which could be useful for testing *Southeastern Solar Research Center, Birmingham, AL, operated ~2014-2020, down-sampled dataset here https://dashboards.epri.com/ssrc. You can get the EPRI SSRC data with something like: # Import SSRC data, based on https://github.com/pvcaptest/pvcaptest/issues/89#issue-1816276179
import pandas as pd
import requests
from io import BytesIO
# (takes about 2 minutes with my internet connection)
# Import EPRI SSRC data. Data descriptions are at:
# https://github.com/epri-dev/PV-Subhourly-Clipping/blob/main/Data%20Channel%20Descriptions.csv
try:
df_temp = pd.read_pickle('ssrc_all_df_temp.pkl')
except:
urls = ['https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC01.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC02.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC03.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC04.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC05.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC06.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC07.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC08.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC09.zip',
'https://github.com/epri-dev/PV-Subhourly-Clipping/raw/main/SSRC10.zip',]
dfs = [pd.read_csv(BytesIO(requests.get(url).content),compression='zip', header=0, sep=',', quotechar='"', index_col=0) for url in urls]
df_temp = dfs[0].join(dfs[1:])
# Convert timestamp to datetime (takes about 1 minute)
df_temp.index = pd.to_datetime(df_temp.index)
df_temp.to_pickle('ssrc_all_df_temp.pkl')
# keep relevant columns
# SAT_Temp_PV_Module_10 is known bad in 2014, see https://github.com/pvlib/pvanalytics/issues/143
df_ssrc = df_temp[[
'SAT_AC_Power',
'SAT_Irradiance_POA_South',
'SAT_Irradiance_POA_North',
'SAT_Temp_PV_Module_5',
'SAT_Temp_PV_Module_10',
'WS_Temp_Air_Outdoor_Amb',
'WS_Wind_Speed_Avg',
'WS_Irradiance_Global_Horiz',
'WS_Irradiance_NDLW_GR3Shaded']].copy()
df = df_ssrc[['SAT_Irradiance_POA_South',
'WS_Wind_Speed_Avg',
'WS_Temp_Air_Outdoor_Amb',
'SAT_Temp_PV_Module_5',
'SAT_Temp_PV_Module_10',
'WS_Irradiance_NDLW_GR3Shaded']].copy()
df.rename(columns={'SAT_Irradiance_POA_South': 'poa_global',
'WS_Wind_Speed_Avg': 'wind_speed',
'WS_Temp_Air_Outdoor_Amb': 'temp_air',
'SAT_Temp_PV_Module_5': 'temp_pv',
'SAT_Temp_PV_Module_10': 'temp_pv2',
'WS_Irradiance_NDLW_GR3Shaded': 'ir_down'},
inplace=True) |
Yes, I should have seen that in the code. From my more attentive re-reading of the code, it appears that 4-day averages (resampled, not rolling) are the basis of the statistics. That's perhaps a bit unusual and probably the reason for the relatively small deviations in all cases. |
I think there is an objective to avoid large data files within pvlib in order to keep it small. |
In my opinion, yes! I didn't see an easy way of getting it through the dashboard though. Maybe you could clean up and prepackage something into an hdf or netcdf file? |
I've asked @dfregosi and team at EPRI to assign a license (e.g., CC-BY-4.0) to their dataset (https://github.com/epri-dev/PV-Subhourly-Clipping) so that there are no issues with using, modifying, and redistributing the data. Would it be worthwhile to start a GitHub Discussion on what portion(s) of that dataset to include, ideal file format, etc.? |
In my opinion, yes. I vaguely recall previous discussions about data sets in pvlib. |
I just started that dataset discussion here #1889. On the dataset currently included in this PR, I think some sort of citation of the DuraMAT DataHub source may be needed. See the "publication and non-endorsement" section here https://datahub.duramat.org/terms. Maybe it's already included and I just missed it. |
This is a detail I'm not sure about given that I created the larger data set also (on behalf of and using data from Sandia). But I'm sure by the end of this code review it will be acknowledged as it should be! |
So now we can get the discussion back to the essence of this PR: |
This PR is currently blocked. See #1898. |
docs/sphinx/source/reference
for API changes.docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.