API reference#



Graphical user interface- just type bifacial_radiance.gui() to get started!


This is a collection of classes used by bifacial_radiance for users that prefer object-oriented programming.

MetObj(tmydata, metadata[, label])

Meteorological data from EPW file.

RadianceObj([name, path, hpc])

The RadianceObj top level class is used to work on radiance objects, keep track of filenames, sky values, PV module configuration, etc.

GroundObj([materialOrAlbedo, material_file, ...])

Class to set and return details for the ground surface materials and reflectance.

ModuleObj([name, x, y, z, bifi, modulefile, ...])

Module object to store module & torque tube details.

SceneObj([module, name])

Scene information including PV module type, bifaciality, array info pv module orientation defaults: Azimuth = 180 (south) pv module origin: z = 0 bottom of frame.

AnalysisObj([octfile, name, hpc])

Analysis class for performing raytrace to obtain irradiance measurements at the array, as well plotting and reporting results.


Functions and methods for dealing with weather, calculating solar position and generating the skies for the raytrace simulations.


RadianceObj.getEPW([lat, lon, GetAll])

Subroutine to download nearest epw files to latitude and longitude provided, into the directory EPWs based on github/aahoo.

RadianceObj.readWeatherFile([weatherFile, ...])

Read either a EPW or a TMY file, calls the functions readTMY or readEPW according to the weatherfile extention.

Sky Dome#

Functions and methods for establishing the sources or sky domes for the simulation

RadianceObj.genCumSky([gencumsky_metfile, ...])

Generate Skydome using gencumsky.


1-axis tracking implementation of gencumulativesky.

RadianceObj.gendaylit(timeindex[, metdata, ...])

Sets and returns sky information using gendaylit.

RadianceObj.gendaylit2manual(dni, dhi, ...)

Sets and returns sky information using gendaylit.

RadianceObj.gendaylit1axis([metdata, ...])

1-axis tracking implementation of gendaylit.



Functions and methods to generate modules

RadianceObj.makeModule([name, x, y, z, ...])

pass module generation details into ModuleObj().

ModuleObj.addTorquetube([diameter, ...])

For adding torque tubes to the module simulation.

ModuleObj.addCellModule(numcellsx, ...[, ...])

Create a cell-level module, with individually defined cells and gaps

ModuleObj.addFrame([frame_material, ...])

Add a metal frame geometry around the module.

ModuleObj.addOmega([omega_material, ...])

Add the racking structure element omega, which connects the frame to the torque tube.


Method to call objview and render the module object (visualize it).


Read in available modules in module.json.

ModuleObj.compileText([rewriteModulefile, json])

Generate the text for the module .rad file based on ModuleObj attributes.


Return files in the Materials directory with .rad extension appends materials files to the oconv file list


Functions and methods to generate the scene.

RadianceObj.setGround([material, material_file])

Use GroundObj constructor class and return a ground object

RadianceObj.set1axis([metdata, azimuth, ...])

Set up geometry for 1-axis tracking.

RadianceObj.makeScene([module, sceneDict, ...])

Create a SceneObj which contains details of the PV system configuration including tilt, row pitch, height, nMods per row, nRows in the system...

RadianceObj.makeScene1axis([trackerdict, ...])

Creates a SceneObj for each tracking angle which contains details of the PV system configuration including row pitch, hub_height, nMods per row, nRows in the system...

RadianceObj.makeOct([filelist, octname])

Combine everything together into a .oct file

RadianceObj.makeOct1axis([trackerdict, ...])

Combine files listed in trackerdict into multiple .oct files

Support methods for scene


Method to call objview on the scene included in self

RadianceObj.makeCustomObject([name, text])

Function for development and experimenting with extraneous objects in the scene.

RadianceObj.appendtoScene([radfile, ...])

Appends to the Scene radfile in folder objects the text command in Radiance lingo created by the user.


Methods for irradiance calculations#

AnalysisObj.moduleAnalysis(scene[, ...])

Handler function that decides how to handle different number of front and back sensors.

AnalysisObj.analysis(octfile, name, ...[, ...])

General analysis function, where linepts are passed in for calling the raytrace routine _irrPlot and saved into results with _saveResults.

RadianceObj.analysis1axis([trackerdict, ...])

Loop through trackerdict and runs linescans for each scene and scan in there.



Use this when sensorsy calculated with bifacial_radiance > cellsy


Input / Output#


Module providing routines for loading and cleaning results from bifacial_radiance.


Load the pickled radiance object for further use Usage (once you're in the correct local directory).

load.loadTrackerDict(trackerdict[, fileprefix])

Load a trackerdict by reading all files in the results directory.

RadianceObj.loadtrackerdict([trackerdict, ...])

Use bifacial_radiance.load._loadtrackerdict to browse the results directory and load back any results saved in there.


Loads in a bifacial_radiance results file .csv format, and return a DataFrame

load.cleanResult(resultsDF[, matchers])

Replace irradiance values with NaN's when the scan intersects ground, sky, or anything in matchers.

load.deepcleanResult(resultsDict, sensorsy, ...)

Cleans results file read by read1Result.

RadianceObj.exportTrackerDict([trackerdict, ...])

Use _exportTrackerDict() to save a TrackerDict output as a csv file.


Pickle the radiance object for further use.


Functions for visualizing irradiance results

AnalysisObj.makeFalseColor(viewfile[, ...])

Makes a false-color plot of octfile, viewfile

AnalysisObj.makeImage(viewfile[, octfile, name])

Makes a visible image (rendering) of octfile, viewfile


Method to call objview on the scene included in self

SceneObj.saveImage([filename, view])

Save an image of the scene to /images/.


Duplicate objview process to save an image of the module in /images/



Return concat of matfiles, radfiles and skyfiles


Helper function to calculate a tracker's angle for use with the fixed tilt routines of bifacial_radiance.


Return files in the root directory with .oct extension



Function to read configurationinput file for a bifacial_radiance simulation.

modelchain.runModelChain(...[, ...])

This calls config.py values, which are arranged into dictionaries, and runs all the respective processes based on the variables in the config.py.


Saves dictionaries from working memory into a Configuration File with extension format .ini.

Spectral Analysis#


spectral_utils.generate_spectra(idx, metdata)

generate spectral curve for particular material.