bifacial_radiance.RadianceObj#
- class bifacial_radiance.RadianceObj(name=None, path=None, hpc=False)[source]#
The RadianceObj top level class is used to work on radiance objects, keep track of filenames, sky values, PV module configuration, etc.
- Parameters:
name (text to append to output files)
filelist (list of Radiance files to create oconv)
nowstr (current date/time string)
path (working directory with Radiance materials and objects)
- __init__ : initialize the object
- _setPath : change the working directory
- __init__(name=None, path=None, hpc=False)[source]#
initialize RadianceObj with path of Radiance materials and objects, as well as a basename to append to
- Parameters:
name (string, append temporary and output files with this value)
path (location of Radiance materials and objects)
hpc (Keeps track if User is running simulation on HPC so some file) – reading routines try reading a bit longer and some writing routines (makeModule) that overwrite themselves are inactivated.
- Returns:
none
Methods
__init__([name, path, hpc])initialize RadianceObj with path of Radiance materials and objects, as well as a basename to append to
addMaterial(material, Rrefl, Grefl, Brefl[, ...])Function to add a material in Radiance format.
analysis1axis([trackerdict, singleindex, ...])Loop through trackerdict and runs linescans for each scene and scan in there.
analysis1axisground([trackerdict, ...])uses
bifacial_radiance.AnalysisObj.groundAnalysis to run a single ground scan along the entire row-row pitch.appendtoScene([radfile, customObject, text])Appends to the Scene radfile in folder /objects the text command in Radiance lingo created by the user.
calculatePerformance1axis([trackerdict, ...])Loops through all results in trackerdict and calculates performance, considering electrical mismatch, using PVLib.
exportTrackerDict([trackerdict, savefile, ...])Use
_exportTrackerDict()to save a TrackerDict output as a csv file.genCumSky([gencumsky_metfile, savefile])Generate Skydome using gencumsky.
genCumSky1axis([trackerdict])1-axis tracking implementation of gencumulativesky.
gendaylit(timeindex[, metdata, debug])Sets and returns sky information using gendaylit.
gendaylit1axis([metdata, trackerdict, ...])1-axis tracking implementation of gendaylit.
gendaylit2manual(dni, dhi, sunalt, sunaz)Sets and returns sky information using gendaylit.
generate_spectra([metdata, simulation_path, ...])Generate spectral irradiance files for spectral simulations using pySMARTS Or Generate an hourly albedo weighted by pySMARTS spectral irradiances # :param metdata: DESC :type metdata: radianceObject.metdata, optional :param simulation_path: path of current simulation directory :type simulation_path: path object or string, optional :param ground_material: ground material string from pySMARTS glossary or compatible (R,G,B) tuple. :type ground_material: str or (R,G,B), optional :param scale_spectra: Apply a simple scaling to the generated spectra. Scales by integrated irradiance below specified upper wavelength bound :type scale_spectra: boolean, default=False :param scale_albedo: Apply a scaling factor to generated spectral albedo. Scales by mean value below specified upper wavelength bound :type scale_albedo: boolean, default=False :param scale_albedo_nonspectral_sim: You intend to run a non-spectral simulation. This will scale the albedo read from the weather file by a calculation on measured and generated spectra and the spectral responsivity of device (spectral responsivity currently not implemented) :type scale_albedo_nonspectral_sim: boolean, default=False :param scale_upper_bound: Sets an upper bound for the wavelength in all scaling calculations. Limits the bounds of integration for spectral DNI, DHI, and GHI. Limits the domain over which spectral albedo is averaged. :type scale_upper_bound: integer, optional.
generate_spectral_tmys(wavelengths, ...[, ...])Generate a series of TMY-like files with per-wavelength irradiance.
getEPW([lat, lon, GetAll])Subroutine to download nearest epw files to latitude and longitude provided, into the directory /EPWs/ based on github/aahoo.
getSingleTimestampTrackerAngle(timeindex[, ...])Helper function to calculate a tracker's angle for use with the fixed tilt routines of bifacial_radiance.
Return concat of matfiles, radfiles and skyfiles
integrated_spectrum(spectra_folder)Generate integrated sum of spectrum from SMARTS generated spectra for use in normalization equations
loadtrackerdict([trackerdict, fileprefix])Use
bifacial_radiance.load._loadtrackerdictto browse the results directory and load back any results saved in there.makeCustomObject([name, text])Function for development and experimenting with extraneous objects in the scene.
makeModule([name, x, y, z, modulefile, ...])pass module generation details into ModuleObj().
makeOct([filelist, octname])Combine everything together into a .oct file
makeOct1axis([trackerdict, singleindex, ...])Combine files listed in trackerdict into multiple .oct files
makeScene([module, sceneDict, radname, ...])Create a SceneObj which contains details of the PV system configuration including tilt, row pitch, height, nMods per row, nRows in the system.
makeScene1axis([trackerdict, module, ...])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...
printModules()readWeatherData(metadata, metdata[, ...])Intermediate function to read in metadata and metdata objects from
readWeatherFileand export aMetObjreadWeatherFile([weatherFile, starttime, ...])Read either a EPW or a TMY file, calls the functions
readTMYorreadEPWaccording to the weatherfile extention and returns aMetObj.returnMaterialFiles([material_path])Return files in the Materials directory with .rad extension appends materials files to the oconv file list
Return files in the root directory with .oct extension
save([savefile])Pickle the radiance object for further use.
sceneNames([scenes])set1axis([metdata, azimuth, limit_angle, ...])Set up geometry for 1-axis tracking.
setGround([material, material_file])Use GroundObj constructor class and return a ground object
Attributes
Wm2BackWm2FrontcolumnsmethodsIterate over trackerdict and return irradiance results following analysis1axis runs