Skip to content

Add sky-composition for generating different portions of rear irradiance#60

Open
mjprilliman wants to merge 32 commits into
NatLabRockies:mainfrom
mjprilliman:sky-composition-method
Open

Add sky-composition for generating different portions of rear irradiance#60
mjprilliman wants to merge 32 commits into
NatLabRockies:mainfrom
mjprilliman:sky-composition-method

Conversation

@mjprilliman

Copy link
Copy Markdown
Collaborator

-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

@mjprilliman mjprilliman requested a review from shirubana December 9, 2024 16:16
@mjprilliman mjprilliman self-assigned this Dec 9, 2024
@mikofski

Copy link
Copy Markdown
Contributor

Icymi: @uakkoseo

@cdeline cdeline requested a review from Copilot June 18, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_method API and exported it from the package.
  • Updated dependencies to use different pvlib versions 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 thread bifacialvf/bifacialvf.py
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 thread bifacialvf/bifacialvf.py
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 thread bifacialvf/bifacialvf.py
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 thread bifacialvf/bifacialvf.py
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 thread bifacialvf/bifacialvf.py
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,
Comment thread bifacialvf/bifacialvf.py
myTMY3_DNIALB0.loc[:, "DNI"] = 0
myTMY3_DNIALB0.loc[:, "Alb"] = 0
write_file_DNIALB0 = writefiletitle[:-4] + "_DNIALB0.csv"
myTMY3_DNIALB0.to_csv('DNIALB0_weather.csv')
Comment thread bifacialvf/bifacialvf.py
myTMY3_DHIALB0 = myTMY3.copy()
myTMY3_DHIALB0.loc[:, "DHI"] = 0
myTMY3_DHIALB0.loc[:, "Alb"] = 0
myTMY3_DHIALB0.to_csv('DHIALB0_weather.csv')
Comment thread bifacialvf/bifacialvf.py
#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')
Comment thread bifacialvf/bifacialvf.py
#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')
Comment thread bifacialvf/bifacialvf.py
#weather_df['ALB_' + file[-8:-4]] = custom_albedo_df['ALB_' + file[-8:-4]]


weather_df.to_csv('weather_df.csv')
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.

5 participants