def test_RadianceObj_1axis_gendaylit_end_to_end():
    # 1-axis tracking end-to-end test with torque tube and gap generation.
    # Takes 20 seconds for 2-sensor scan
    module_height = 1.95 * 2 + 0.1  # module portrait dimension in meters
    gcr = 0.35  # ground cover ratio,  = module_height / pitch
    albedo = 0.3  # ground albedo
    hub_height = 2  # tracker height at 0 tilt in meters (hub height)

    demo = RadianceObj()  # Create a RadianceObj 'object'
    demo.setGround(
        albedo
    )  # input albedo number or material name like 'concrete'.  To see options, run this without any input.
    metdata = demo.readEPW(
        MET_FILENAME)  # read in the EPW weather data from above
    #metdata = demo.readTMY(MET_FILENAME2) # select a TMY file using graphical picker
    # create metdata files for each condition. keys are timestamps for gendaylit workflow
    trackerdict = demo.set1axis(cumulativesky=False)
    # create the skyfiles needed for 1-axis tracking
    demo.gendaylit1axis(metdata=metdata, enddate='01/01')
    # test modules with gap and rear tube
    demo.makeModule(name='Longi_torquetube',
                    x=0.984,
                    y=1.95,
                    torquetube=True,
                    numpanels=2,
                    panelgap=0.1)
    #demo.makeModule(name='Longi_torquetube',x=0.984,y=1.95)
    # set module type to be used and passed into makeScene1axis
    module_type = 'Longi_torquetube'

    # Create the scene for the 1-axis tracking
    sceneDict = {
        'pitch': module_height / gcr,
        'height': hub_height,
        'orientation': 'portrait'
    }
    key = '01_01_11'
    demo.makeScene1axis(
        {key: trackerdict[key]},
        module_type,
        sceneDict,
        cumulativesky=False,
        nMods=10,
        nRows=3,
        modwanted=3,
        rowwanted=3,
        sensorsy=2
    )  #makeScene creates a .rad file with 20 modules per row, 7 rows.

    demo.makeOct1axis(trackerdict,
                      key)  # just run this for one timestep: Jan 1 11am
    demo.analysis1axis(trackerdict,
                       key)  # just run this for one timestep: Jan 1 11am

    assert (np.mean(demo.Wm2Front) == pytest.approx(214.0, 0.01))
    assert (np.mean(demo.Wm2Back) == pytest.approx(40.0, 0.1))
Esempio n. 2
0
demo.makeModule(name='Prism Solar Bi60', x=0.984, y=module_height, bifi=0.90)
# print available module types
demo.printModules()

# create a 1-axis scene using panels in portrait, 2m hub height, 0.33 GCR. NOTE: clearance needs to be calculated at each step. hub height is constant
sceneDict = {
    'pitch': module_height / gcr,
    'height': hub_height,
    'orientation': 'portrait'
}
module_type = 'Prism Solar Bi60'
trackerdict = demo.makeScene1axis(
    trackerdict, module_type, sceneDict, nMods=20,
    nRows=7)  #makeScene creates a .rad file with 20 modules per row, 7 rows.

trackerdict = demo.makeOct1axis(trackerdict)
# Now we need to run analysis and combine the results into an annual total.  This can be done by calling scene.frontscan and scene.backscan
trackerdict = demo.analysis1axis(trackerdict)

# the frontscan and backscan include a linescan along a chord of the module, both on the front and back.
# Return the minimum of the irradiance ratio, and the average of the irradiance ratio along a chord of the module.
print('Annual RADIANCE bifacial ratio for 1-axis tracking: %0.3f - %0.3f' %
      (min(demo.backRatio), np.mean(demo.backRatio)))
'''
Now run the analysis using bifacialVF !




'''