[11]:
# This information helps with debugging and getting support :)
import sys, platform
import pandas as pd
import bifacial_radiance as br
import pprint
print("Working on a ", platform.system(), platform.release())
print("Python version ", sys.version)
print("Pandas version ", pd.__version__)
print("bifacial_radiance version ", br.__version__)
Working on a Windows 10
Python version 3.11.8 | packaged by conda-forge | (main, Feb 16 2024, 20:40:50) [MSC v.1937 64 bit (AMD64)]
Pandas version 2.2.3
bifacial_radiance version 0.5.0b2.dev4+gedb973d.d20250924
6 - Exploring Trackerdict Structure#
Tutorial 6 gives a good, detailed introduction to the trackerdict structure step by step. Here is a condensed summary of functions you can use to explore the tracker dictionary.
Steps:
Create a short Simulation + tracker dictionary beginning to end for 1 day
Explore the tracker dictionary
Explore Save Options
1. Create a short Simulation + tracker dictionary beginning to end for 1 day#
[2]:
import bifacial_radiance
from pathlib import Path
import os
testfolder = str(Path().resolve().parent.parent / 'bifacial_radiance' / 'TEMP' / 'Tutorial_06')
if not os.path.exists(testfolder):
os.makedirs(testfolder)
simulationName = 'tutorial_6'
moduletype = 'test-module'
albedo = "litesoil" # this is one of the options on ground.rad
lat = 37.5
lon = -77.6
# Scene variables
nMods = 3
nRows = 1
hub_height = 2.3 # meters
pitch = 10 # meters # We will be using pitch instead of GCR for this example.
# Traking parameters
cumulativesky = False
limit_angle = 45 # tracker rotation limit angle
angledelta = 0.01 # we will be doing hourly simulation, we want the angle to be as close to real tracking as possible.
backtrack = True
#makeModule parameters
# x and y will be defined by the cell-level module parameters
xgap = 0.01
ygap = 0.10
zgap = 0.05
numpanels = 2
torquetube = True
axisofrotationTorqueTube = False
diameter = 0.1
tubetype = 'Oct' # This will make an octagonal torque tube.
material = 'black' # Torque tube will be made of this material (0% reflectivity)
tubeParams = {'diameter':diameter,
'tubetype':tubetype,
'material':material,
'axisofrotation':axisofrotationTorqueTube,
'visible':torquetube}
# Simulation range between two hours
startdate = '11_06_11' # Options: mm_dd, mm_dd_HH, mm_dd_HHMM, YYYY-mm-dd_HHMM
enddate = '11_06_14'
# Cell Parameters
numcellsx = 6
numcellsy = 12
xcell = 0.156
ycell = 0.156
xcellgap = 0.02
ycellgap = 0.02
demo = bifacial_radiance.RadianceObj(simulationName, path=testfolder)
demo.setGround(albedo)
epwfile = demo.getEPW(lat,lon)
metdata = demo.readWeatherFile(epwfile, starttime=startdate, endtime=enddate)
cellLevelModuleParams = {'numcellsx': numcellsx, 'numcellsy':numcellsy,
'xcell': xcell, 'ycell': ycell, 'xcellgap': xcellgap, 'ycellgap': ycellgap}
mymodule = demo.makeModule(name=moduletype, xgap=xgap, ygap=ygap, zgap=zgap,
numpanels=numpanels, cellModule=cellLevelModuleParams, tubeParams=tubeParams)
sceneDict = {'pitch':pitch,'hub_height':hub_height, 'nMods': nMods, 'nRows': nRows}
demo.set1axis(limit_angle=limit_angle, backtrack=backtrack, gcr=mymodule.sceney / pitch, cumulativesky=cumulativesky)
demo.gendaylit1axis()
demo.makeScene1axis(module=mymodule, sceneDict=sceneDict)
demo.makeOct1axis()
demo.analysis1axis()
path = C:\Users\cdeline\Documents\Python Scripts\Bifacial_Radiance\bifacial_radiance\TEMP\Tutorial_06
Making path: images
Making path: objects
Making path: results
Making path: skies
Making path: EPWs
Making path: materials
Loading albedo, 1 value(s), 0.213 avg
1 nonzero albedo values.
Getting weather file: USA_VA_Richmond.724010_TMY2.epw
... OK!
8760 line in WeatherFile. Assuming this is a standard hourly WeatherFile for the year for purposes of saving Gencumulativesky temporary weather files in EPW folder.
Coercing year to 2021
Filtering dates
Saving file EPWs\metdata_temp.csv, # points: 8760
Calculating Sun position for Metdata that is right-labeled with a delta of -30 mins. i.e. 12 is 11:30 sunpos
Module Name: test-module
Module was shifted by 0.078 in X to avoid sensors on air
This is a Cell-Level detailed module with Packaging Factor of 0.81
Module test-module updated in module.json
Creating ~4 skyfiles.
Created 4 skyfiles in /skies/
Making ~4 .rad files for gendaylit 1-axis workflow (this takes a minute..)
4 Radfiles created in /objects/
Making 4 octfiles in root directory.
Created 1axis_2021-11-06_1100.oct
Created 1axis_2021-11-06_1200.oct
Created 1axis_2021-11-06_1300.oct
Created 1axis_2021-11-06_1400.oct
Linescan in process: 1axis_2021-11-06_1100_Scene0_Row1_Module2_Front
Linescan in process: 1axis_2021-11-06_1100_Scene0_Row1_Module2_Back
Saved: results\irr_1axis_2021-11-06_1100_Scene0_Row1_Module2.csv
Index: 2021-11-06_1100. Wm2Front: 329.3102185185185. Wm2Back: 59.174216666666666
Linescan in process: 1axis_2021-11-06_1200_Scene0_Row1_Module2_Front
Linescan in process: 1axis_2021-11-06_1200_Scene0_Row1_Module2_Back
Saved: results\irr_1axis_2021-11-06_1200_Scene0_Row1_Module2.csv
Index: 2021-11-06_1200. Wm2Front: 196.77327037037037. Wm2Back: 38.48871777777778
Linescan in process: 1axis_2021-11-06_1300_Scene0_Row1_Module2_Front
Linescan in process: 1axis_2021-11-06_1300_Scene0_Row1_Module2_Back
Saved: results\irr_1axis_2021-11-06_1300_Scene0_Row1_Module2.csv
Index: 2021-11-06_1300. Wm2Front: 245.56651481481478. Wm2Back: 49.09279555555556
Linescan in process: 1axis_2021-11-06_1400_Scene0_Row1_Module2_Front
Linescan in process: 1axis_2021-11-06_1400_Scene0_Row1_Module2_Back
Saved: results\irr_1axis_2021-11-06_1400_Scene0_Row1_Module2.csv
Index: 2021-11-06_1400. Wm2Front: 123.32471111111113. Wm2Back: 32.11295481481481
[2]:
{'2021-11-06_1100': {'surf_azm': 90.0,
'surf_tilt': 32.06,
'theta': -32.06,
'dni': np.int64(203),
'ghi': np.int64(303),
'dhi': np.int64(191),
'temp_air': np.float64(19.4),
'wind_speed': np.float64(7.2),
'skyfile': 'skies\\sky2_37.5_-77.33_2021-11-06_1100.rad',
'scenes': [<class 'bifacial_radiance.main.SceneObj'> : {'gcr': np.float64(0.4284), 'hpc': False, 'module': <class 'bifacial_radiance.module.ModuleObj'> : {'x': np.float64(1.036), 'y': np.float64(2.092), 'z': 0.02, 'modulematerial': 'black', 'scenex': np.float64(1.046), 'sceney': np.float64(4.284), 'scenez': np.float64(0.1), 'numpanels': 2, 'bifi': 1, 'text': '! genbox black cellPVmodule 0.156 0.156 0.02 | xform -t -0.44 -2.142 0 -a 6 -t 0.176 0 0 -a 12 -t 0 0.176 0 -a 2 -t 0 2.192 0\r\n! genbox black octtube1a 1.046 0.04142135623730951 0.1 | xform -t -0.523 -0.020711 -0.15000000000000002\r\n! genbox black octtube1b 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020711 -0.05 -rx 45 -t 0 0 -0.1\r\n! genbox black octtube1c 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 90 -t 0 0 -0.1\r\n! genbox black octtube1d 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 135 -t 0 0 -0.1 ', 'modulefile': 'objects\\test-module.rad', 'glass': False, 'glassEdge': 0.01, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.1, 'zgap': 0.05}, 'modulefile': 'objects\\test-module.rad', 'name': 'Scene0', 'radfiles': 'objects\\1axis2021-11-06_1100__C_1.16_rtr_10.00_tilt_32_3modsx1rows_origin0,0.rad', 'sceneDict': {'pitch': 10, 'nMods': 3, 'nRows': 1, 'tilt': 32.06, 'azimuth': 90.0, 'modulez': 0.02, 'axis_tilt': 0, 'originx': 0, 'originy': 0, 'hub_height': np.float64(2.3)}, 'text': '!xform -rx 32.06 -t 0 0 2.3 -a 3 -t 1.046 0 0 -a 1 -t 0 10 0 -i 1 -t -1.046 -0.0 0 -rz 90.0 -t 0 0 0 "objects\\test-module.rad"'}],
'octfile': '1axis_2021-11-06_1100.oct',
'AnalysisObj': [<class 'bifacial_radiance.main.AnalysisObj'> : {'Back/FrontRatio': [0.18, 0.179, 0.178, 0.17, 0.154, 0.182, 0.188, 0.19, 0.193], 'Wm2Back': [60.327, 60.171, 59.696, 57.051, 41.987, 61.09, 63.204, 64.002, 65.04], 'Wm2Front': [335.442, 335.781, 336.234, 336.514, 273.072, 336.56, 336.807, 337.054, 336.329], 'backRatio': [0.18, 0.179, 0.178, 0.17, 0.154, 0.182, 0.188, 0.19, 0.193], 'hpc': False, 'mattype': array(['a1.0.a2.2.0.cellPVmodule.6457', 'a1.0.a2.4.0.cellPVmodule.6457',
'a1.0.a2.7.0.cellPVmodule.6457', 'a1.0.a2.9.0.cellPVmodule.6457',
'a1.0.octtube1a.6457', 'a1.0.a2.2.1.cellPVmodule.6457',
'a1.0.a2.4.1.cellPVmodule.6457', 'a1.0.a2.7.1.cellPVmodule.6457',
'a1.0.a2.9.1.cellPVmodule.6457'], dtype=object), 'modWanted': 2, 'name': '1axis_2021-11-06_1100_Scene0', 'octfile': '1axis_2021-11-06_1100.oct', 'power_data': None, 'rearMat': array(['a1.0.a2.2.0.cellPVmodule.2310', 'a1.0.a2.4.0.cellPVmodule.2310',
'a1.0.a2.7.0.cellPVmodule.2310', 'a1.0.a2.9.0.cellPVmodule.2310',
'sky', 'a1.0.a2.2.1.cellPVmodule.2310',
'a1.0.a2.4.1.cellPVmodule.2310', 'a1.0.a2.7.1.cellPVmodule.2310',
'a1.0.a2.9.1.cellPVmodule.2310'], dtype=object), 'rearX': [1.449, 1.086, 0.723, 0.36, -0.003, -0.366, -0.728, -1.092, -1.455], 'rearY': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'rearZ': [1.386, 1.613, 1.841, 2.068, 2.295, 2.523, 2.75, 2.977, 3.205], 'rowWanted': 1, 'sceneNum': 0, 'x': [1.466, 1.103, 0.74, 0.377, 0.014, -0.35, -0.712, -1.075, -1.438], 'y': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'z': [1.411, 1.639, 1.866, 2.094, 2.32, 2.547, 2.775, 3.004, 3.23]}]},
'2021-11-06_1200': {'surf_azm': 90.0,
'surf_tilt': 9.27,
'theta': -9.27,
'dni': np.int64(5),
'ghi': np.int64(200),
'dhi': np.int64(197),
'temp_air': np.float64(20.0),
'wind_speed': np.float64(5.2),
'skyfile': 'skies\\sky2_37.5_-77.33_2021-11-06_1200.rad',
'scenes': [<class 'bifacial_radiance.main.SceneObj'> : {'gcr': np.float64(0.4284), 'hpc': False, 'module': <class 'bifacial_radiance.module.ModuleObj'> : {'x': np.float64(1.036), 'y': np.float64(2.092), 'z': 0.02, 'modulematerial': 'black', 'scenex': np.float64(1.046), 'sceney': np.float64(4.284), 'scenez': np.float64(0.1), 'numpanels': 2, 'bifi': 1, 'text': '! genbox black cellPVmodule 0.156 0.156 0.02 | xform -t -0.44 -2.142 0 -a 6 -t 0.176 0 0 -a 12 -t 0 0.176 0 -a 2 -t 0 2.192 0\r\n! genbox black octtube1a 1.046 0.04142135623730951 0.1 | xform -t -0.523 -0.020711 -0.15000000000000002\r\n! genbox black octtube1b 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020711 -0.05 -rx 45 -t 0 0 -0.1\r\n! genbox black octtube1c 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 90 -t 0 0 -0.1\r\n! genbox black octtube1d 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 135 -t 0 0 -0.1 ', 'modulefile': 'objects\\test-module.rad', 'glass': False, 'glassEdge': 0.01, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.1, 'zgap': 0.05}, 'modulefile': 'objects\\test-module.rad', 'name': 'Scene0', 'radfiles': 'objects\\1axis2021-11-06_1200__C_1.95_rtr_10.00_tilt_9_3modsx1rows_origin0,0.rad', 'sceneDict': {'pitch': 10, 'nMods': 3, 'nRows': 1, 'tilt': 9.27, 'azimuth': 90.0, 'modulez': 0.02, 'axis_tilt': 0, 'originx': 0, 'originy': 0, 'hub_height': np.float64(2.3)}, 'text': '!xform -rx 9.27 -t 0 0 2.3 -a 3 -t 1.046 0 0 -a 1 -t 0 10 0 -i 1 -t -1.046 -0.0 0 -rz 90.0 -t 0 0 0 "objects\\test-module.rad"'}],
'octfile': '1axis_2021-11-06_1200.oct',
'AnalysisObj': [<class 'bifacial_radiance.main.AnalysisObj'> : {'Back/FrontRatio': [0.177, 0.174, 0.172, 0.167, 0.349, 0.173, 0.18, 0.183, 0.186], 'Wm2Back': [34.819, 34.251, 33.808, 32.866, 68.729, 33.948, 35.339, 36.043, 36.596], 'Wm2Front': [196.751, 196.756, 196.762, 196.767, 196.772, 196.778, 196.783, 196.789, 196.802], 'backRatio': [0.177, 0.174, 0.172, 0.167, 0.349, 0.173, 0.18, 0.183, 0.186], 'hpc': False, 'mattype': array(['a1.0.a2.2.0.cellPVmodule.6457', 'a1.0.a2.4.0.cellPVmodule.6457',
'a1.0.a2.7.0.cellPVmodule.6457', 'a1.0.a2.9.0.cellPVmodule.6457',
'a1.0.octtube1a.6457', 'a1.0.a2.2.1.cellPVmodule.6457',
'a1.0.a2.4.1.cellPVmodule.6457', 'a1.0.a2.7.1.cellPVmodule.6457',
'a1.0.a2.9.1.cellPVmodule.6457'], dtype=object), 'modWanted': 2, 'name': '1axis_2021-11-06_1200_Scene0', 'octfile': '1axis_2021-11-06_1200.oct', 'power_data': None, 'rearMat': array(['a1.0.a2.2.0.cellPVmodule.2310', 'a1.0.a2.4.0.cellPVmodule.2310',
'a1.0.a2.7.0.cellPVmodule.2310', 'a1.0.a2.9.0.cellPVmodule.2310',
'sky', 'a1.0.a2.2.1.cellPVmodule.2310',
'a1.0.a2.4.1.cellPVmodule.2310', 'a1.0.a2.7.1.cellPVmodule.2310',
'a1.0.a2.9.1.cellPVmodule.2310'], dtype=object), 'rearX': [1.69, 1.268, 0.845, 0.422, -0.001, -0.423, -0.847, -1.27, -1.692], 'rearY': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'rearZ': [2.02, 2.088, 2.158, 2.227, 2.295, 2.365, 2.434, 2.502, 2.572], 'rowWanted': 1, 'sceneNum': 0, 'x': [1.695, 1.272, 0.85, 0.427, 0.004, -0.418, -0.842, -1.266, -1.688], 'y': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'z': [2.049, 2.117, 2.188, 2.256, 2.324, 2.395, 2.463, 2.531, 2.602]}]},
'2021-11-06_1300': {'surf_azm': 90.0,
'surf_tilt': -14.87,
'theta': 14.87,
'dni': np.int64(3),
'ghi': np.int64(250),
'dhi': np.int64(249),
'temp_air': np.float64(20.0),
'wind_speed': np.float64(7.2),
'skyfile': 'skies\\sky2_37.5_-77.33_2021-11-06_1300.rad',
'scenes': [<class 'bifacial_radiance.main.SceneObj'> : {'gcr': np.float64(0.4284), 'hpc': False, 'module': <class 'bifacial_radiance.module.ModuleObj'> : {'x': np.float64(1.036), 'y': np.float64(2.092), 'z': 0.02, 'modulematerial': 'black', 'scenex': np.float64(1.046), 'sceney': np.float64(4.284), 'scenez': np.float64(0.1), 'numpanels': 2, 'bifi': 1, 'text': '! genbox black cellPVmodule 0.156 0.156 0.02 | xform -t -0.44 -2.142 0 -a 6 -t 0.176 0 0 -a 12 -t 0 0.176 0 -a 2 -t 0 2.192 0\r\n! genbox black octtube1a 1.046 0.04142135623730951 0.1 | xform -t -0.523 -0.020711 -0.15000000000000002\r\n! genbox black octtube1b 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020711 -0.05 -rx 45 -t 0 0 -0.1\r\n! genbox black octtube1c 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 90 -t 0 0 -0.1\r\n! genbox black octtube1d 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 135 -t 0 0 -0.1 ', 'modulefile': 'objects\\test-module.rad', 'glass': False, 'glassEdge': 0.01, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.1, 'zgap': 0.05}, 'modulefile': 'objects\\test-module.rad', 'name': 'Scene0', 'radfiles': 'objects\\1axis2021-11-06_1300__C_1.75_rtr_10.00_tilt_-15_3modsx1rows_origin0,0.rad', 'sceneDict': {'pitch': 10, 'nMods': 3, 'nRows': 1, 'tilt': -14.87, 'azimuth': 90.0, 'modulez': 0.02, 'axis_tilt': 0, 'originx': 0, 'originy': 0, 'hub_height': np.float64(2.3)}, 'text': '!xform -rx -14.87 -t 0 0 2.3 -a 3 -t 1.046 0 0 -a 1 -t 0 10 0 -i 1 -t -1.046 -0.0 0 -rz 90.0 -t 0 0 0 "objects\\test-module.rad"'}],
'octfile': '1axis_2021-11-06_1300.oct',
'AnalysisObj': [<class 'bifacial_radiance.main.AnalysisObj'> : {'Back/FrontRatio': [0.194, 0.19, 0.186, 0.182, 0.349, 0.168, 0.175, 0.177, 0.179], 'Wm2Back': [47.659, 46.663, 45.62, 44.597, 85.648, 41.271, 42.886, 43.441, 44.05], 'Wm2Front': [245.611, 245.601, 245.591, 245.581, 245.571, 245.561, 245.551, 245.522, 245.509], 'backRatio': [0.194, 0.19, 0.186, 0.182, 0.349, 0.168, 0.175, 0.177, 0.179], 'hpc': False, 'mattype': array(['a1.0.a2.2.0.cellPVmodule.6457', 'a1.0.a2.4.0.cellPVmodule.6457',
'a1.0.a2.7.0.cellPVmodule.6457', 'a1.0.a2.9.0.cellPVmodule.6457',
'a1.0.octtube1a.6457', 'a1.0.a2.2.1.cellPVmodule.6457',
'a1.0.a2.4.1.cellPVmodule.6457', 'a1.0.a2.7.1.cellPVmodule.6457',
'a1.0.a2.9.1.cellPVmodule.6457'], dtype=object), 'modWanted': 2, 'name': '1axis_2021-11-06_1300_Scene0', 'octfile': '1axis_2021-11-06_1300.oct', 'power_data': None, 'rearMat': array(['a1.0.a2.2.0.cellPVmodule.2310', 'a1.0.a2.4.0.cellPVmodule.2310',
'a1.0.a2.7.0.cellPVmodule.2310', 'a1.0.a2.9.0.cellPVmodule.2310',
'sky', 'a1.0.a2.2.1.cellPVmodule.2310',
'a1.0.a2.4.1.cellPVmodule.2310', 'a1.0.a2.7.1.cellPVmodule.2310',
'a1.0.a2.9.1.cellPVmodule.2310'], dtype=object), 'rearX': [1.657, 1.243, 0.829, 0.415, 0.001, -0.413, -0.827, -1.241, -1.655], 'rearY': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'rearZ': [2.734, 2.625, 2.514, 2.404, 2.295, 2.184, 2.074, 1.965, 1.855], 'rowWanted': 1, 'sceneNum': 0, 'x': [1.649, 1.235, 0.821, 0.407, -0.007, -0.421, -0.835, -1.249, -1.663], 'y': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'z': [2.764, 2.654, 2.543, 2.434, 2.324, 2.215, 2.104, 1.994, 1.885]}]},
'2021-11-06_1400': {'surf_azm': 90.0,
'surf_tilt': -36.95,
'theta': 36.95,
'dni': np.int64(2),
'ghi': np.int64(136),
'dhi': np.int64(135),
'temp_air': np.float64(17.2),
'wind_speed': np.float64(6.7),
'skyfile': 'skies\\sky2_37.5_-77.33_2021-11-06_1400.rad',
'scenes': [<class 'bifacial_radiance.main.SceneObj'> : {'gcr': np.float64(0.4284), 'hpc': False, 'module': <class 'bifacial_radiance.module.ModuleObj'> : {'x': np.float64(1.036), 'y': np.float64(2.092), 'z': 0.02, 'modulematerial': 'black', 'scenex': np.float64(1.046), 'sceney': np.float64(4.284), 'scenez': np.float64(0.1), 'numpanels': 2, 'bifi': 1, 'text': '! genbox black cellPVmodule 0.156 0.156 0.02 | xform -t -0.44 -2.142 0 -a 6 -t 0.176 0 0 -a 12 -t 0 0.176 0 -a 2 -t 0 2.192 0\r\n! genbox black octtube1a 1.046 0.04142135623730951 0.1 | xform -t -0.523 -0.020711 -0.15000000000000002\r\n! genbox black octtube1b 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020711 -0.05 -rx 45 -t 0 0 -0.1\r\n! genbox black octtube1c 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 90 -t 0 0 -0.1\r\n! genbox black octtube1d 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 135 -t 0 0 -0.1 ', 'modulefile': 'objects\\test-module.rad', 'glass': False, 'glassEdge': 0.01, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.1, 'zgap': 0.05}, 'modulefile': 'objects\\test-module.rad', 'name': 'Scene0', 'radfiles': 'objects\\1axis2021-11-06_1400__C_1.01_rtr_10.00_tilt_-37_3modsx1rows_origin0,0.rad', 'sceneDict': {'pitch': 10, 'nMods': 3, 'nRows': 1, 'tilt': -36.95, 'azimuth': 90.0, 'modulez': 0.02, 'axis_tilt': 0, 'originx': 0, 'originy': 0, 'hub_height': np.float64(2.3)}, 'text': '!xform -rx -36.95 -t 0 0 2.3 -a 3 -t 1.046 0 0 -a 1 -t 0 10 0 -i 1 -t -1.046 -0.0 0 -rz 90.0 -t 0 0 0 "objects\\test-module.rad"'}],
'octfile': '1axis_2021-11-06_1400.oct',
'AnalysisObj': [<class 'bifacial_radiance.main.AnalysisObj'> : {'Back/FrontRatio': [0.268, 0.264, 0.26, 0.251, 0.376, 0.223, 0.235, 0.233, 0.232], 'Wm2Back': [33.11, 32.596, 32.041, 31.031, 46.393, 27.452, 29.017, 28.752, 28.626], 'Wm2Front': [123.516, 123.404, 123.29, 123.488, 123.341, 123.193, 123.34, 123.145, 123.205], 'backRatio': [0.268, 0.264, 0.26, 0.251, 0.376, 0.223, 0.235, 0.233, 0.232], 'hpc': False, 'mattype': array(['a1.0.a2.2.0.cellPVmodule.6457', 'a1.0.a2.4.0.cellPVmodule.6457',
'a1.0.a2.7.0.cellPVmodule.6457', 'a1.0.a2.9.0.cellPVmodule.6457',
'a1.0.octtube1a.6457', 'a1.0.a2.2.1.cellPVmodule.6457',
'a1.0.a2.4.1.cellPVmodule.6457', 'a1.0.a2.7.1.cellPVmodule.6457',
'a1.0.a2.9.1.cellPVmodule.6457'], dtype=object), 'modWanted': 2, 'name': '1axis_2021-11-06_1400_Scene0', 'octfile': '1axis_2021-11-06_1400.oct', 'power_data': None, 'rearMat': array(['a1.0.a2.2.0.cellPVmodule.2310', 'a1.0.a2.4.0.cellPVmodule.2310',
'a1.0.a2.7.0.cellPVmodule.2310', 'a1.0.a2.9.0.cellPVmodule.2310',
'sky', 'a1.0.a2.2.1.cellPVmodule.2310',
'a1.0.a2.4.1.cellPVmodule.2310', 'a1.0.a2.7.1.cellPVmodule.2310',
'a1.0.a2.9.1.cellPVmodule.2310'], dtype=object), 'rearX': [1.372, 1.029, 0.688, 0.345, 0.003, -0.339, -0.683, -1.024, -1.366], 'rearY': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'rearZ': [3.326, 3.068, 2.81, 2.555, 2.297, 2.04, 1.781, 1.523, 1.266], 'rowWanted': 1, 'sceneNum': 0, 'x': [1.354, 1.012, 0.67, 0.327, -0.015, -0.356, -0.7, -1.042, -1.384], 'y': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'z': [3.35, 3.092, 2.834, 2.578, 2.32, 2.062, 1.805, 1.547, 1.289]}]}}
2. Explore the RadianceObj#
[8]:
print(f'Methods: {demo.methods}') # Shows all methods for top-level RadianceObj
print(f'\nColumns: {demo.columns}') # shows all data columns or attributes of RadianceObj, some of which are deprecated
Methods: ['addMaterial', 'analysis1axis', 'analysis1axisground', 'appendtoScene', 'calculatePerformance1axis', 'exportTrackerDict', 'genCumSky', 'genCumSky1axis', 'gendaylit', 'gendaylit1axis', 'gendaylit2manual', 'generate_spectra', 'generate_spectral_tmys', 'getEPW', 'getSingleTimestampTrackerAngle', 'getfilelist', 'loadtrackerdict', 'makeCustomObject', 'makeModule', 'makeOct', 'makeOct1axis', 'makeScene', 'makeScene1axis', 'printModules', 'readWeatherData', 'readWeatherFile', 'returnMaterialFiles', 'returnOctFiles', 'save', 'sceneNames', 'set1axis', 'setGround']
Columns: ['Wm2Back', 'Wm2Front', 'basename', 'compiledResults', 'cumulativesky', 'data', 'epwfile', 'gencumsky_metfile', 'ground', 'hpc', 'hub_height', 'materialfiles', 'metdata', 'module', 'name', 'nowstr', 'octfile', 'path', 'results', 'scenes', 'skyfiles', 'trackerdict']
3. Explore the tracker dictionary#
You can use any of the below options to explore the tracking dictionary. Copy it into an empty cell to see their contents.
[18]:
trackerkeys = sorted(demo.trackerdict.keys()) # get the trackerdict keys to see a specific hour.
print(f'trackerdict element {trackerkeys[0]}: {demo.trackerdict[trackerkeys[0]]}') # This prints all trackerdict content
trackerdict element 2021-11-06_1100: {'surf_azm': 90.0, 'surf_tilt': 32.06, 'theta': -32.06, 'dni': np.int64(203), 'ghi': np.int64(303), 'dhi': np.int64(191), 'temp_air': np.float64(19.4), 'wind_speed': np.float64(7.2), 'skyfile': 'skies\\sky2_37.5_-77.33_2021-11-06_1100.rad', 'scenes': [<class 'bifacial_radiance.main.SceneObj'> : {'gcr': np.float64(0.4284), 'hpc': False, 'module': <class 'bifacial_radiance.module.ModuleObj'> : {'x': np.float64(1.036), 'y': np.float64(2.092), 'z': 0.02, 'modulematerial': 'black', 'scenex': np.float64(1.046), 'sceney': np.float64(4.284), 'scenez': np.float64(0.1), 'numpanels': 2, 'bifi': 1, 'text': '! genbox black cellPVmodule 0.156 0.156 0.02 | xform -t -0.44 -2.142 0 -a 6 -t 0.176 0 0 -a 12 -t 0 0.176 0 -a 2 -t 0 2.192 0\r\n! genbox black octtube1a 1.046 0.04142135623730951 0.1 | xform -t -0.523 -0.020711 -0.15000000000000002\r\n! genbox black octtube1b 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020711 -0.05 -rx 45 -t 0 0 -0.1\r\n! genbox black octtube1c 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 90 -t 0 0 -0.1\r\n! genbox black octtube1d 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 135 -t 0 0 -0.1 ', 'modulefile': 'objects\\test-module.rad', 'glass': False, 'glassEdge': 0.01, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.1, 'zgap': 0.05}, 'modulefile': 'objects\\test-module.rad', 'name': 'Scene0', 'radfiles': 'objects\\1axis2021-11-06_1100__C_1.16_rtr_10.00_tilt_32_3modsx1rows_origin0,0.rad', 'sceneDict': {'pitch': 10, 'nMods': 3, 'nRows': 1, 'tilt': 32.06, 'azimuth': 90.0, 'modulez': 0.02, 'axis_tilt': 0, 'originx': 0, 'originy': 0, 'hub_height': np.float64(2.3)}, 'text': '!xform -rx 32.06 -t 0 0 2.3 -a 3 -t 1.046 0 0 -a 1 -t 0 10 0 -i 1 -t -1.046 -0.0 0 -rz 90.0 -t 0 0 0 "objects\\test-module.rad"'}], 'octfile': '1axis_2021-11-06_1100.oct', 'AnalysisObj': [<class 'bifacial_radiance.main.AnalysisObj'> : {'Back/FrontRatio': [0.18, 0.179, 0.178, 0.17, 0.154, 0.182, 0.188, 0.19, 0.193], 'Wm2Back': [60.327, 60.171, 59.696, 57.051, 41.987, 61.09, 63.204, 64.002, 65.04], 'Wm2Front': [335.442, 335.781, 336.234, 336.514, 273.072, 336.56, 336.807, 337.054, 336.329], 'backRatio': [0.18, 0.179, 0.178, 0.17, 0.154, 0.182, 0.188, 0.19, 0.193], 'hpc': False, 'mattype': array(['a1.0.a2.2.0.cellPVmodule.6457', 'a1.0.a2.4.0.cellPVmodule.6457',
'a1.0.a2.7.0.cellPVmodule.6457', 'a1.0.a2.9.0.cellPVmodule.6457',
'a1.0.octtube1a.6457', 'a1.0.a2.2.1.cellPVmodule.6457',
'a1.0.a2.4.1.cellPVmodule.6457', 'a1.0.a2.7.1.cellPVmodule.6457',
'a1.0.a2.9.1.cellPVmodule.6457'], dtype=object), 'modWanted': 2, 'name': '1axis_2021-11-06_1100_Scene0', 'octfile': '1axis_2021-11-06_1100.oct', 'power_data': None, 'rearMat': array(['a1.0.a2.2.0.cellPVmodule.2310', 'a1.0.a2.4.0.cellPVmodule.2310',
'a1.0.a2.7.0.cellPVmodule.2310', 'a1.0.a2.9.0.cellPVmodule.2310',
'sky', 'a1.0.a2.2.1.cellPVmodule.2310',
'a1.0.a2.4.1.cellPVmodule.2310', 'a1.0.a2.7.1.cellPVmodule.2310',
'a1.0.a2.9.1.cellPVmodule.2310'], dtype=object), 'rearX': [1.449, 1.086, 0.723, 0.36, -0.003, -0.366, -0.728, -1.092, -1.455], 'rearY': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'rearZ': [1.386, 1.613, 1.841, 2.068, 2.295, 2.523, 2.75, 2.977, 3.205], 'rowWanted': 1, 'sceneNum': 0, 'x': [1.466, 1.103, 0.74, 0.377, 0.014, -0.35, -0.712, -1.075, -1.438], 'y': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'z': [1.411, 1.639, 1.866, 2.094, 2.32, 2.547, 2.775, 3.004, 3.23]}]}
[20]:
demo.trackerdict[trackerkeys[0]]['scene'] # This shows an array of Scene Object contents, one for each scene made in makeScene
[20]:
[<class 'bifacial_radiance.main.SceneObj'> : {'gcr': np.float64(0.4284), 'hpc': False, 'module': <class 'bifacial_radiance.module.ModuleObj'> : {'x': np.float64(1.036), 'y': np.float64(2.092), 'z': 0.02, 'modulematerial': 'black', 'scenex': np.float64(1.046), 'sceney': np.float64(4.284), 'scenez': np.float64(0.1), 'numpanels': 2, 'bifi': 1, 'text': '! genbox black cellPVmodule 0.156 0.156 0.02 | xform -t -0.44 -2.142 0 -a 6 -t 0.176 0 0 -a 12 -t 0 0.176 0 -a 2 -t 0 2.192 0\r\n! genbox black octtube1a 1.046 0.04142135623730951 0.1 | xform -t -0.523 -0.020711 -0.15000000000000002\r\n! genbox black octtube1b 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020711 -0.05 -rx 45 -t 0 0 -0.1\r\n! genbox black octtube1c 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 90 -t 0 0 -0.1\r\n! genbox black octtube1d 1.046 0.04142135623730951 0.1 | xform -t -0.445 -0.020710678118654756 -0.05 -rx 135 -t 0 0 -0.1 ', 'modulefile': 'objects\\test-module.rad', 'glass': False, 'glassEdge': 0.01, 'offsetfromaxis': 0, 'xgap': 0.01, 'ygap': 0.1, 'zgap': 0.05}, 'modulefile': 'objects\\test-module.rad', 'name': 'Scene0', 'radfiles': 'objects\\1axis2021-11-06_1100__C_1.16_rtr_10.00_tilt_32_3modsx1rows_origin0,0.rad', 'sceneDict': {'pitch': 10, 'nMods': 3, 'nRows': 1, 'tilt': 32.06, 'azimuth': 90.0, 'modulez': 0.02, 'axis_tilt': 0, 'originx': 0, 'originy': 0, 'hub_height': np.float64(2.3)}, 'text': '!xform -rx 32.06 -t 0 0 2.3 -a 3 -t 1.046 0 0 -a 1 -t 0 10 0 -i 1 -t -1.046 -0.0 0 -rz 90.0 -t 0 0 0 "objects\\test-module.rad"'}]
[24]:
print(f"scenex: {demo.trackerdict[trackerkeys[0]]['scene'][0].module.scenex}") # This shows the Module Object in the Scene's contents
print(f"sceneDict: {demo.trackerdict[trackerkeys[0]]['scene'][0].sceneDict}") # Printing the scene dictionary saved in the Scene Object
scenex: 1.046
sceneDict: {'pitch': 10, 'nMods': 3, 'nRows': 1, 'tilt': 32.06, 'azimuth': 90.0, 'modulez': 0.02, 'axis_tilt': 0, 'originx': 0, 'originy': 0, 'hub_height': np.float64(2.3)}
[28]:
# Looking at the AnalysisObj results indivudally
print(demo.trackerdict[trackerkeys[0]]['AnalysisObj'] ) # This shows an array of Analysis Object contents
print(f"\nmattype: {demo.trackerdict[trackerkeys[0]]['AnalysisObj'][0].mattype}" )# Addressing one of the variables in the Analysis Object
[<class 'bifacial_radiance.main.AnalysisObj'> : {'Back/FrontRatio': [0.18, 0.179, 0.178, 0.17, 0.154, 0.182, 0.188, 0.19, 0.193], 'Wm2Back': [60.327, 60.171, 59.696, 57.051, 41.987, 61.09, 63.204, 64.002, 65.04], 'Wm2Front': [335.442, 335.781, 336.234, 336.514, 273.072, 336.56, 336.807, 337.054, 336.329], 'backRatio': [0.18, 0.179, 0.178, 0.17, 0.154, 0.182, 0.188, 0.19, 0.193], 'hpc': False, 'mattype': array(['a1.0.a2.2.0.cellPVmodule.6457', 'a1.0.a2.4.0.cellPVmodule.6457',
'a1.0.a2.7.0.cellPVmodule.6457', 'a1.0.a2.9.0.cellPVmodule.6457',
'a1.0.octtube1a.6457', 'a1.0.a2.2.1.cellPVmodule.6457',
'a1.0.a2.4.1.cellPVmodule.6457', 'a1.0.a2.7.1.cellPVmodule.6457',
'a1.0.a2.9.1.cellPVmodule.6457'], dtype=object), 'modWanted': 2, 'name': '1axis_2021-11-06_1100_Scene0', 'octfile': '1axis_2021-11-06_1100.oct', 'power_data': None, 'rearMat': array(['a1.0.a2.2.0.cellPVmodule.2310', 'a1.0.a2.4.0.cellPVmodule.2310',
'a1.0.a2.7.0.cellPVmodule.2310', 'a1.0.a2.9.0.cellPVmodule.2310',
'sky', 'a1.0.a2.2.1.cellPVmodule.2310',
'a1.0.a2.4.1.cellPVmodule.2310', 'a1.0.a2.7.1.cellPVmodule.2310',
'a1.0.a2.9.1.cellPVmodule.2310'], dtype=object), 'rearX': [1.449, 1.086, 0.723, 0.36, -0.003, -0.366, -0.728, -1.092, -1.455], 'rearY': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'rearZ': [1.386, 1.613, 1.841, 2.068, 2.295, 2.523, 2.75, 2.977, 3.205], 'rowWanted': 1, 'sceneNum': 0, 'x': [1.466, 1.103, 0.74, 0.377, 0.014, -0.35, -0.712, -1.075, -1.438], 'y': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'z': [1.411, 1.639, 1.866, 2.094, 2.32, 2.547, 2.775, 3.004, 3.23]}]
mattype: ['a1.0.a2.2.0.cellPVmodule.6457' 'a1.0.a2.4.0.cellPVmodule.6457'
'a1.0.a2.7.0.cellPVmodule.6457' 'a1.0.a2.9.0.cellPVmodule.6457'
'a1.0.octtube1a.6457' 'a1.0.a2.2.1.cellPVmodule.6457'
'a1.0.a2.4.1.cellPVmodule.6457' 'a1.0.a2.7.1.cellPVmodule.6457'
'a1.0.a2.9.1.cellPVmodule.6457']
[33]:
# Looking at the Analysis results Accumulated for the day:
demo.results
[33]:
| timestamp | name | modNum | rowNum | sceneNum | x | y | z | rearZ | mattype | rearMat | Wm2Front | Wm2Back | backRatio | rearX | rearY | surf_azm | surf_tilt | theta | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2021-11-06_1100 | 1axis_2021-11-06_1100_Scene0 | 2 | 1 | 0 | [1.466, 1.103, 0.7397, 0.377, 0.01367, -0.3496... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | [1.411, 1.639, 1.866, 2.094, 2.32, 2.547, 2.77... | [1.386, 1.613, 1.841, 2.068, 2.295, 2.523, 2.7... | [a1.0.a2.2.0.cellPVmodule.6457, a1.0.a2.4.0.ce... | [a1.0.a2.2.0.cellPVmodule.2310, a1.0.a2.4.0.ce... | [335.4420333333333, 335.78093333333334, 336.23... | [60.32731333333333, 60.17080666666667, 59.6963... | [0.17984369129343472, 0.17919608142506777, 0.1... | [1.449, 1.086, 0.723, 0.3604, -0.00293, -0.366... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | 90.0 | 32.06 | -32.06 |
| 1 | 2021-11-06_1200 | 1axis_2021-11-06_1200_Scene0 | 2 | 1 | 0 | [1.695, 1.272, 0.8496, 0.4268, 0.003906, -0.41... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | [2.049, 2.117, 2.188, 2.256, 2.324, 2.395, 2.4... | [2.02, 2.088, 2.158, 2.227, 2.295, 2.365, 2.43... | [a1.0.a2.2.0.cellPVmodule.6457, a1.0.a2.4.0.ce... | [a1.0.a2.2.0.cellPVmodule.2310, a1.0.a2.4.0.ce... | [196.7508, 196.75609999999998, 196.76156666666... | [34.81922333333333, 34.25118666666666, 33.8081... | [0.17697029116548532, 0.17407852965238188, 0.1... | [1.69, 1.268, 0.8447, 0.4219, -0.000977, -0.42... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | 90.0 | 9.27 | -9.27 |
| 2 | 2021-11-06_1300 | 1axis_2021-11-06_1300_Scene0 | 2 | 1 | 0 | [1.649, 1.235, 0.8213, 0.4072, -0.006836, -0.4... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | [2.764, 2.654, 2.543, 2.434, 2.324, 2.215, 2.1... | [2.734, 2.625, 2.514, 2.404, 2.295, 2.184, 2.0... | [a1.0.a2.2.0.cellPVmodule.6457, a1.0.a2.4.0.ce... | [a1.0.a2.2.0.cellPVmodule.2310, a1.0.a2.4.0.ce... | [245.61113333333333, 245.6013, 245.59126666666... | [47.659349999999996, 46.66338, 45.619546666666... | [0.19404314173404028, 0.18999569629437507, 0.1... | [1.657, 1.243, 0.829, 0.415, 0.000977, -0.413,... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | 90.0 | -14.87 | 14.87 |
| 3 | 2021-11-06_1400 | 1axis_2021-11-06_1400_Scene0 | 2 | 1 | 0 | [1.3545, 1.012, 0.67, 0.3271, -0.01465, -0.356... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | [3.35, 3.092, 2.834, 2.578, 2.32, 2.062, 1.805... | [3.326, 3.068, 2.81, 2.555, 2.297, 2.04, 1.781... | [a1.0.a2.2.0.cellPVmodule.6457, a1.0.a2.4.0.ce... | [a1.0.a2.2.0.cellPVmodule.2310, a1.0.a2.4.0.ce... | [123.51633333333332, 123.40366666666667, 123.2... | [33.10988, 32.59641333333334, 32.04081, 31.030... | [0.2680585720762538, 0.2641424689503909, 0.259... | [1.372, 1.029, 0.6875, 0.3447, 0.00293, -0.338... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | 90.0 | -36.95 | 36.95 |
[34]:
demo.results.Wm2Back # this value is a series of arrays of every individual irradiance result for each hour simulated.
[34]:
0 [60.32731333333333, 60.17080666666667, 59.6963...
1 [34.81922333333333, 34.25118666666666, 33.8081...
2 [47.659349999999996, 46.66338, 45.619546666666...
3 [33.10988, 32.59641333333334, 32.04081, 31.030...
Name: Wm2Back, dtype: object
[37]:
# DataFrame of all results for one AnalysisObj. These are compiled in demo.results
demo.trackerdict[trackerkeys[0]]['AnalysisObj'][0].results
[37]:
| name | modNum | rowNum | sceneNum | x | y | z | rearZ | mattype | rearMat | Wm2Front | Wm2Back | backRatio | rearX | rearY | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1axis_2021-11-06_1100_Scene0 | 2 | 1 | 0 | [1.466, 1.103, 0.7397, 0.377, 0.01367, -0.3496... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] | [1.411, 1.639, 1.866, 2.094, 2.32, 2.547, 2.77... | [1.386, 1.613, 1.841, 2.068, 2.295, 2.523, 2.7... | [a1.0.a2.2.0.cellPVmodule.6457, a1.0.a2.4.0.ce... | [a1.0.a2.2.0.cellPVmodule.2310, a1.0.a2.4.0.ce... | [335.4420333333333, 335.78093333333334, 336.23... | [60.32731333333333, 60.17080666666667, 59.6963... | [0.17984369129343472, 0.17919608142506777, 0.1... | [1.449, 1.086, 0.723, 0.3604, -0.00293, -0.366... | [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] |
3. Explore Save Options#
The following lines offer ways to save your trackerdict or your demo object.
[38]:
demo.exportTrackerDict(trackerdict = demo.trackerdict, savefile = 'results\\test_reindexTrue.csv', reindex = False)
demo.save(savefile = 'results\\demopickle.pickle')
Exporting TrackerDict
2
Saved to file results\demopickle.pickle