Add sky-composition for generating different portions of rear irradiance#60
Open
mjprilliman wants to merge 32 commits into
Open
Add sky-composition for generating different portions of rear irradiance#60mjprilliman wants to merge 32 commits into
mjprilliman wants to merge 32 commits into
Conversation
divideAndAlignAlbedos function (translation/testing not finished)
Fix naming.
Contributor
|
Icymi: @uakkoseo |
irradiance for input to function, write results to csv and pkl
rear irradinace w/m2/nm calculations
user specified albedo, don't pull every wavelength from smarts each time
data for spectra reading
12 tasks
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a “sky composition” workflow to decompose rear (and front) irradiance into spectral components, intended for generating composite spectral irradiance outputs and validating against known results.
Changes:
- Added a new
skycomposition_methodAPI and exported it from the package. - Updated dependencies to use different
pvlibversions based on Python version. - Added example/driver invocation in
__main__to run sky-composition output generation.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
| requirements.txt | Splits pvlib pin by Python version to support newer pvlib on >3.8. |
| bifacialvf/bifacialvf.py | Introduces skycomposition_method and wires it into the module (including __main__). |
| bifacialvf/init.py | Exports skycomposition_method as part of the public package API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1029
to
+1037
| skycomposition_method(myTMY3, meta, writefiletitle=composition_file, | ||
| tilt=tilt, sazm=sazm, pitch=pitch, clearance_height=clearance_height, | ||
| rowType=rowType, transFactor=transFactor, sensorsy=sensorsy, | ||
| PVfrontSurface=PVfrontSurface, PVbackSurface=PVbackSurface, | ||
| albedo=albedo, tracking=tracking, backtrack=backtrack, | ||
| limit_angle=limit_angle, calculatePVMismatch=calculatePVMismatch, | ||
| cellsnum = cellsnum, bififactor=bififactor, | ||
| calculateBilInterpol=calculateBilInterpol, | ||
| portraitorlandscape=portraitorlandscape, deltastyle=deltastyle) |
Comment on lines
+668
to
+669
| composite_data['GTIFrontavg'] = composite_data[['No_1_RowFrontGTI', 'No_2_RowFrontGTI','No_3_RowFrontGTI','No_4_RowFrontGTI','No_5_RowFrontGTI','No_6_RowFrontGTI']].mean(axis=1) | ||
| composite_data['GTIBackavg'] =composite_data[['No_1_RowBackGTI', 'No_2_RowBackGTI','No_3_RowBackGTI','No_4_RowBackGTI','No_5_RowBackGTI','No_6_RowBackGTI']].mean(axis=1) |
Comment on lines
+688
to
+696
| for x in np.arange(1, sensorsy+1, 1): | ||
| for fb in front_back_list: | ||
| avg_string = "Avg_Row" + str(fb) + "GTI_DHIDirect" | ||
| composite_data[avg_string] = 0 | ||
| #data.loc[:, "No_"+str(x)+"_RowBackGTI"] = data.loc[:, "No_"+str(x)+"_RowBackGTI"] - composite_data.loc[:, "No_"+str(x)+"_RowBackGTI_DNI0"] | ||
| old_string = "No_"+str(x)+"_Row" + str(fb) + "GTI" | ||
| new_string = "No_"+str(x) + "_Row" + str(fb) + "GTI_DHIDirect" | ||
| composite_data[new_string] = data[old_string] | ||
| composite_data[avg_string] = composite_data[avg_string] + (composite_data[new_string]/sensorsy) |
Comment on lines
+871
to
+875
| elif('DayOfYear' in custom_albedo_dict[key] and 'isSnow' in custom_albedo_dict[key]): | ||
| start_date = int(custom_albedo_dict[key]['DayOfYear']) | ||
| isSnow = custom_albedo_dict[key]['isSnow'] | ||
| if isSnow: | ||
| weather_df.loc[weather_df.index.dayofyear >= start_date & weather_df['Alb'] > 0.6, 'Alb_type'] = key |
Comment on lines
+655
to
+658
| simulate(myTMY3=myTMY3, meta=meta, writefiletitle=write_file_baseline, tilt=tilt, sazm=sazm, | ||
| clearance_height=clearance_height, hub_height = hub_height, | ||
| pitch=pitch, rowType='interior', transFactor=transFactor, sensorsy=sensorsy, | ||
| PVfrontSurface='glass', PVbackSurface='glass', albedo=albedo, |
| myTMY3_DNIALB0.loc[:, "DNI"] = 0 | ||
| myTMY3_DNIALB0.loc[:, "Alb"] = 0 | ||
| write_file_DNIALB0 = writefiletitle[:-4] + "_DNIALB0.csv" | ||
| myTMY3_DNIALB0.to_csv('DNIALB0_weather.csv') |
| myTMY3_DHIALB0 = myTMY3.copy() | ||
| myTMY3_DHIALB0.loc[:, "DHI"] = 0 | ||
| myTMY3_DHIALB0.loc[:, "Alb"] = 0 | ||
| myTMY3_DHIALB0.to_csv('DHIALB0_weather.csv') |
| #C - DHI to 0 - DNI from ground + other sources, subtract other sources | ||
| myTMY3_DHI0 = myTMY3.copy() | ||
| myTMY3_DHI0.loc[:,'DHI'] = 0 | ||
| myTMY3_DHI0.to_csv('DHI0_weather.csv') |
| #B - DNI to 0, DHI from ground and other sources, subtract other sources | ||
| myTMY3_DNI0 = myTMY3.copy() | ||
| myTMY3_DNI0.loc[:, "DNI"] = 0 | ||
| myTMY3_DNI0.to_csv('DNI0_weather.csv') |
| #weather_df['ALB_' + file[-8:-4]] = custom_albedo_df['ALB_' + file[-8:-4]] | ||
|
|
||
|
|
||
| weather_df.to_csv('weather_df.csv') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-Add sky composition method
-Notebook using this: sky_composition_example.ipynb
-Need to finish validation against known results (bifacial_radiance results, etc.)
spectral_radiance_tutorial.zip