bifacial-radiance 0.5.1__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. bifacial_radiance/HPCScripts/BasicSimulations/addNewModule.py +15 -0
  2. bifacial_radiance/HPCScripts/BasicSimulations/dask_on_node.sh +11 -0
  3. bifacial_radiance/HPCScripts/BasicSimulations/run_sbatch.sbatch +51 -0
  4. bifacial_radiance/HPCScripts/BasicSimulations/simulate_fixedtilt_gencumsky.py +110 -0
  5. bifacial_radiance/HPCScripts/BasicSimulations/simulate_fixedtilt_gendaylit.py +102 -0
  6. bifacial_radiance/HPCScripts/BasicSimulations/simulate_tracking_gendaylit.py +126 -0
  7. bifacial_radiance/HPCScripts/Other Examples (unorganized)/PuertoRico.py +168 -0
  8. bifacial_radiance/HPCScripts/Other Examples (unorganized)/PuertoRico_2.py +166 -0
  9. bifacial_radiance/HPCScripts/Other Examples (unorganized)/PuertoRico_Original.py +195 -0
  10. bifacial_radiance/HPCScripts/Other Examples (unorganized)/basic_module_sampling.py +154 -0
  11. bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_B.py +162 -0
  12. bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_Cases.py +122 -0
  13. bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_CasesMonth.py +142 -0
  14. bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_PRNew.py +91 -0
  15. bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_PRNewP2.py +95 -0
  16. bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_TreeResults.py +108 -0
  17. bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_basic_module_sampling.py +103 -0
  18. bifacial_radiance/HPCScripts/Other Examples (unorganized)/simulate_JackHourly.py +160 -0
  19. bifacial_radiance/HPCScripts/Other Examples (unorganized)/simulate_improvedArray_Oct2127.py +623 -0
  20. bifacial_radiance/TEMP/.gitignore +4 -0
  21. bifacial_radiance/__init__.py +24 -0
  22. bifacial_radiance/data/CEC Modules.csv +16860 -0
  23. bifacial_radiance/data/default.ini +65 -0
  24. bifacial_radiance/data/falsecolor.exe +0 -0
  25. bifacial_radiance/data/gencumsky/License.txt +54 -0
  26. bifacial_radiance/data/gencumsky/Makefile +17 -0
  27. bifacial_radiance/data/gencumsky/README.txt +9 -0
  28. bifacial_radiance/data/gencumsky/Solar Irradiation Modelling.doc +0 -0
  29. bifacial_radiance/data/gencumsky/Sun.cpp +118 -0
  30. bifacial_radiance/data/gencumsky/Sun.h +45 -0
  31. bifacial_radiance/data/gencumsky/average_val.awk +3 -0
  32. bifacial_radiance/data/gencumsky/cPerezSkyModel.cpp +238 -0
  33. bifacial_radiance/data/gencumsky/cPerezSkyModel.h +57 -0
  34. bifacial_radiance/data/gencumsky/cSkyVault.cpp +536 -0
  35. bifacial_radiance/data/gencumsky/cSkyVault.h +86 -0
  36. bifacial_radiance/data/gencumsky/climateFile.cpp +312 -0
  37. bifacial_radiance/data/gencumsky/climateFile.h +37 -0
  38. bifacial_radiance/data/gencumsky/cumulative.cal +177 -0
  39. bifacial_radiance/data/gencumsky/cumulative.rad +14 -0
  40. bifacial_radiance/data/gencumsky/cumulativesky_rotated.rad +2 -0
  41. bifacial_radiance/data/gencumsky/gencumulativesky +0 -0
  42. bifacial_radiance/data/gencumsky/gencumulativesky.cpp +269 -0
  43. bifacial_radiance/data/gencumsky/make_gencumskyexe.py +107 -0
  44. bifacial_radiance/data/gencumsky/paths.h +62 -0
  45. bifacial_radiance/data/gencumulativesky +0 -0
  46. bifacial_radiance/data/gencumulativesky.exe +0 -0
  47. bifacial_radiance/data/ground.rad +83 -0
  48. bifacial_radiance/data/module.json +103 -0
  49. bifacial_radiance/gui.py +1696 -0
  50. bifacial_radiance/images/fig1_fixed_small.gif +0 -0
  51. bifacial_radiance/images/fig2_tracked_small.gif +0 -0
  52. bifacial_radiance/load.py +1156 -0
  53. bifacial_radiance/main.py +5673 -0
  54. bifacial_radiance/mismatch.py +461 -0
  55. bifacial_radiance/modelchain.py +299 -0
  56. bifacial_radiance/module.py +1427 -0
  57. bifacial_radiance/performance.py +466 -0
  58. bifacial_radiance/spectral_utils.py +555 -0
  59. bifacial_radiance-0.5.1.dist-info/METADATA +129 -0
  60. bifacial_radiance-0.5.1.dist-info/RECORD +63 -0
  61. bifacial_radiance-0.5.1.dist-info/WHEEL +6 -0
  62. bifacial_radiance-0.5.1.dist-info/licenses/LICENSE +30 -0
  63. bifacial_radiance-0.5.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,160 @@
1
+ import numpy as np
2
+ import os
3
+ import pandas as pd
4
+ import time
5
+ import math
6
+ from itertools import chain
7
+ import bifacial_radiance
8
+ from dask.distributed import Client
9
+ from math import sin, cos, radians
10
+
11
+
12
+ # Run simulation using the given timestamp
13
+ def simulate_single(idx=None, test_folder_fmt=None, weather_file=None):
14
+
15
+ # Verify test_folder exists before creating radiance obj
16
+ test_folder = test_folder_fmt.format(f'{idx}')
17
+ if not os.path.exists(test_folder):
18
+ os.makedirs(test_folder)
19
+
20
+
21
+ # Input Values
22
+ radiance_name = 'JackSolar'
23
+ lat = 40.1217 # Given for the project site at Colorado
24
+ lon = -105.1310 # Given for the project site at Colorado
25
+ moduletype='PrismSolar'
26
+ numpanels = 1 # This site have 1 module in Y-direction
27
+ x = 1
28
+ y = 2
29
+ zgap = 0.10 # no gap to torquetube.
30
+ sensorsy = 6 # this will give 6 sensors per module in y-direction
31
+ sensorsx = 3 # this will give 3 sensors per module in x-direction
32
+ torquetube = True
33
+ axisofrotationTorqueTube = True
34
+ diameter = 0.15 # 15 cm diameter for the torquetube
35
+ tubetype = 'square' # Put the right keyword upon reading the document
36
+ material = 'black' # Torque tube of this material (0% reflectivity)
37
+
38
+ # Scene variables
39
+ nMods = 20
40
+ nRows = 7
41
+ hub_height = 1.8 # meters
42
+ pitch = 5.1816 # meters # Pitch is the known parameter
43
+ albedo = 0.2 #'Grass' # ground albedo
44
+ gcr = y/pitch
45
+
46
+ cumulativesky = False
47
+ limit_angle = 60 # tracker rotation limit angle
48
+ angledelta = 0.01 # we will be doing hourly simulation, we want the angle to be as close to real tracking as possible.
49
+ backtrack = True
50
+
51
+ # START SIMULATION
52
+ rad_obj = bifacial_radiance.RadianceObj(radiance_name, str(test_folder))
53
+
54
+ # Set ground
55
+ rad_obj.readWeatherFile(weather_file, label = 'center')
56
+
57
+ # Query data from metadata for index of interest
58
+ foo=rad_obj.metdata.datetime[idx]
59
+ dni = rad_obj.metdata.dni[idx]
60
+ dhi = rad_obj.metdata.dhi[idx]
61
+ res_name = "irr_Jacksolar_"+str(foo.year)+"_"+str(foo.month)+"_"+str(foo.day)+"_"+str(foo.hour)+"_"+str(foo.minute)
62
+
63
+ rad_obj.setGround(albedo)
64
+
65
+ # Set sky
66
+ solpos = rad_obj.metdata.solpos.iloc[idx]
67
+ zen = float(solpos.zenith)
68
+ azm = float(solpos.azimuth) - 180
69
+
70
+ if zen > 90:
71
+ print("Nightime ")
72
+ return
73
+
74
+ rad_obj.gendaylit2manual(dni, dhi, 90 - zen, azm)
75
+
76
+ # Set tracker information
77
+ tilt = round(rad_obj.getSingleTimestampTrackerAngle(rad_obj.metdata, idx, gcr, limit_angle=65),1)
78
+
79
+ sceneDict = {'pitch': pitch, 'tilt': tilt, 'azimuth': 90, 'hub_height':hub_height, 'nMods':nMods, 'nRows': nRows}
80
+
81
+ scene = rad_obj.makeScene(moduletype=moduletype,sceneDict=sceneDict)
82
+ octfile = rad_obj.makeOct(octname=res_name)
83
+
84
+ sensorsx = 22
85
+ sensorsy = 105
86
+ module_scenex = x+0.01
87
+ extra_sampling_space_x = 0.10
88
+ spacingsensorsx = (module_scenex+extra_sampling_space_x)/(sensorsx-1)
89
+ startxsensors = (module_scenex+extra_sampling_space_x)/2
90
+ xinc = pitch/(sensorsy-1)
91
+
92
+ analysis = bifacial_radiance.AnalysisObj()
93
+
94
+ frontscan, backscan = analysis.moduleAnalysis(scene, sensorsy=sensorsy)
95
+
96
+ #LOCATION_APOGEES
97
+ for senx in range(0,sensorsx):
98
+ frontscan['zstart'] = 0
99
+ frontscan['xstart'] = 0
100
+ frontscan['orient'] = '0 0 -1'
101
+ frontscan['zinc'] = 0
102
+ frontscan['xinc'] = xinc
103
+ frontscan['ystart'] = startxsensors-spacingsensorsx*senx
104
+ frontdict, backdict = analysis.analysis(octfile = octfile, name = 'xloc_'+str(senx),
105
+ frontscan=frontscan, backscan=backscan)
106
+
107
+ results = 1
108
+
109
+ print("***** Finished simulation for "+ str(foo))
110
+
111
+ return results
112
+
113
+
114
+
115
+ def run_simulations_dask(indices, kwargs):
116
+ # Create client
117
+
118
+ scheduler_file = '/scratch/sayala/dask_testing/scheduler.json'
119
+ client = Client(scheduler_file=scheduler_file)
120
+
121
+ # Iterate over inputs
122
+ futures = []
123
+
124
+ for idx in indices:
125
+ futures.append(client.submit(simulate_single, idx=idx, **kwargs))
126
+
127
+ # Get results for all simulations
128
+ res = client.gather(futures)
129
+
130
+ # Close all dask workers and scheduler
131
+ try:
132
+ client.shutdown()
133
+ except:
134
+ pass
135
+
136
+ # Close client
137
+ client.close()
138
+
139
+ res = 'FINISHED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
140
+ return res
141
+
142
+ if __name__ == "__main__":
143
+ # Define locations within file system
144
+
145
+ weather_file = '/scratch/sayala/JORDAN/USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.epw'
146
+ test_folder_fmt = '/scratch/sayala/JORDAN/JackSolar_Hourly/Hour_{}'
147
+
148
+
149
+ # Define inputs
150
+ kwargs = {
151
+ 'weather_file': weather_file,
152
+ 'test_folder_fmt': test_folder_fmt
153
+ }
154
+
155
+ indices = [4020, 4021, 4022]
156
+ indices = np.array(list(range(0, 8760)))
157
+ # Specify method for running simulation
158
+ use_dask = True
159
+ if use_dask:
160
+ run_simulations_dask(indices, kwargs)