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.
- bifacial_radiance/HPCScripts/BasicSimulations/addNewModule.py +15 -0
- bifacial_radiance/HPCScripts/BasicSimulations/dask_on_node.sh +11 -0
- bifacial_radiance/HPCScripts/BasicSimulations/run_sbatch.sbatch +51 -0
- bifacial_radiance/HPCScripts/BasicSimulations/simulate_fixedtilt_gencumsky.py +110 -0
- bifacial_radiance/HPCScripts/BasicSimulations/simulate_fixedtilt_gendaylit.py +102 -0
- bifacial_radiance/HPCScripts/BasicSimulations/simulate_tracking_gendaylit.py +126 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/PuertoRico.py +168 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/PuertoRico_2.py +166 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/PuertoRico_Original.py +195 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/basic_module_sampling.py +154 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_B.py +162 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_Cases.py +122 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_CasesMonth.py +142 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_PRNew.py +91 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_PRNewP2.py +95 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_TreeResults.py +108 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/compile_basic_module_sampling.py +103 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/simulate_JackHourly.py +160 -0
- bifacial_radiance/HPCScripts/Other Examples (unorganized)/simulate_improvedArray_Oct2127.py +623 -0
- bifacial_radiance/TEMP/.gitignore +4 -0
- bifacial_radiance/__init__.py +24 -0
- bifacial_radiance/data/CEC Modules.csv +16860 -0
- bifacial_radiance/data/default.ini +65 -0
- bifacial_radiance/data/falsecolor.exe +0 -0
- bifacial_radiance/data/gencumsky/License.txt +54 -0
- bifacial_radiance/data/gencumsky/Makefile +17 -0
- bifacial_radiance/data/gencumsky/README.txt +9 -0
- bifacial_radiance/data/gencumsky/Solar Irradiation Modelling.doc +0 -0
- bifacial_radiance/data/gencumsky/Sun.cpp +118 -0
- bifacial_radiance/data/gencumsky/Sun.h +45 -0
- bifacial_radiance/data/gencumsky/average_val.awk +3 -0
- bifacial_radiance/data/gencumsky/cPerezSkyModel.cpp +238 -0
- bifacial_radiance/data/gencumsky/cPerezSkyModel.h +57 -0
- bifacial_radiance/data/gencumsky/cSkyVault.cpp +536 -0
- bifacial_radiance/data/gencumsky/cSkyVault.h +86 -0
- bifacial_radiance/data/gencumsky/climateFile.cpp +312 -0
- bifacial_radiance/data/gencumsky/climateFile.h +37 -0
- bifacial_radiance/data/gencumsky/cumulative.cal +177 -0
- bifacial_radiance/data/gencumsky/cumulative.rad +14 -0
- bifacial_radiance/data/gencumsky/cumulativesky_rotated.rad +2 -0
- bifacial_radiance/data/gencumsky/gencumulativesky +0 -0
- bifacial_radiance/data/gencumsky/gencumulativesky.cpp +269 -0
- bifacial_radiance/data/gencumsky/make_gencumskyexe.py +107 -0
- bifacial_radiance/data/gencumsky/paths.h +62 -0
- bifacial_radiance/data/gencumulativesky +0 -0
- bifacial_radiance/data/gencumulativesky.exe +0 -0
- bifacial_radiance/data/ground.rad +83 -0
- bifacial_radiance/data/module.json +103 -0
- bifacial_radiance/gui.py +1696 -0
- bifacial_radiance/images/fig1_fixed_small.gif +0 -0
- bifacial_radiance/images/fig2_tracked_small.gif +0 -0
- bifacial_radiance/load.py +1156 -0
- bifacial_radiance/main.py +5673 -0
- bifacial_radiance/mismatch.py +461 -0
- bifacial_radiance/modelchain.py +299 -0
- bifacial_radiance/module.py +1427 -0
- bifacial_radiance/performance.py +466 -0
- bifacial_radiance/spectral_utils.py +555 -0
- bifacial_radiance-0.5.1.dist-info/METADATA +129 -0
- bifacial_radiance-0.5.1.dist-info/RECORD +63 -0
- bifacial_radiance-0.5.1.dist-info/WHEEL +6 -0
- bifacial_radiance-0.5.1.dist-info/licenses/LICENSE +30 -0
- bifacial_radiance-0.5.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
// GenCumulativeSky was conceived, developed and validated by Darren Robinson and Andrew Stone for efficient solar irradiation modelling using RADIANCE
|
|
2
|
+
// When using GenCumulativeSky they would be pleased if you would ackowledge their work by referring to the following article: "Robinson, D., Stone, A.,
|
|
3
|
+
// Irradiation modeling made simple the cumulative sky approach and its applications, Proc. PLEA 2004, Eindhoven 2004."
|
|
4
|
+
//
|
|
5
|
+
// GenCumulativeSky.cpp : Defines the entry point for the console application.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#include "cSkyVault.h"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
int main(int argc, char* argv[])
|
|
12
|
+
{
|
|
13
|
+
cSkyVault sky;
|
|
14
|
+
double (*patchData)[5] = new double[145][5];
|
|
15
|
+
int i,j, counter;
|
|
16
|
+
|
|
17
|
+
double *CumSky;
|
|
18
|
+
double dx,dy,dz;
|
|
19
|
+
double alt,az,deltaalt,deltaaz;
|
|
20
|
+
double ScalingFactor=1.0;
|
|
21
|
+
|
|
22
|
+
double rowdeltaaz[7]={12,12,15,15,20,30,60};
|
|
23
|
+
//double rowdeltaaz[14]={6,6,6,6,7.5,7.5,7.5,7.5,10,10,15,15,30,30};
|
|
24
|
+
int rowdeltaalt=12;
|
|
25
|
+
|
|
26
|
+
char *filename=argv[argc-1];
|
|
27
|
+
double hourshift=0;
|
|
28
|
+
|
|
29
|
+
bool DoIlluminance=false;
|
|
30
|
+
bool DoRadiance_179=false;
|
|
31
|
+
|
|
32
|
+
cSkyVault::eSunType SunType;
|
|
33
|
+
cClimateFile::eClimateFileFormat ClimateFileFormat;
|
|
34
|
+
|
|
35
|
+
bool DoDiffuse;
|
|
36
|
+
|
|
37
|
+
if (!(argc>1))
|
|
38
|
+
{
|
|
39
|
+
// User didn't give any command line arguments
|
|
40
|
+
fprintf(stderr,"GenCumulativeSky: Error - invalid input parameters\n");
|
|
41
|
+
goto USAGEERROR;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
counter=1;
|
|
45
|
+
sky.StartTime=0.0;
|
|
46
|
+
sky.EndTime=24.0;
|
|
47
|
+
sky.StartDay=1;
|
|
48
|
+
sky.EndDay=31;
|
|
49
|
+
sky.StartMonth=1;
|
|
50
|
+
sky.EndMonth=12;
|
|
51
|
+
|
|
52
|
+
// Set the default parameters
|
|
53
|
+
SunType=cSkyVault::NO_SUN;
|
|
54
|
+
DoDiffuse=true;
|
|
55
|
+
sky.SetLatitude(51.7*M_PI/180);
|
|
56
|
+
sky.SetLongitude(0*M_PI/180);
|
|
57
|
+
ClimateFileFormat=cClimateFile::GLOBAL_DIFFUSE;
|
|
58
|
+
|
|
59
|
+
while (counter<argc-1)
|
|
60
|
+
{
|
|
61
|
+
if (argv[counter][0]=='+' && argv[counter][1]=='s' && argv[counter][2]=='1')
|
|
62
|
+
{
|
|
63
|
+
SunType=cSkyVault::CUMULATIVE_SUN;
|
|
64
|
+
counter++;
|
|
65
|
+
}
|
|
66
|
+
else if (argv[counter][0]=='+' && argv[counter][1]=='s' && argv[counter][2]=='2')
|
|
67
|
+
{
|
|
68
|
+
SunType=cSkyVault::MANY_SUNS;
|
|
69
|
+
counter++;
|
|
70
|
+
}
|
|
71
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='d' && argv[counter][2]==' ' )
|
|
72
|
+
{
|
|
73
|
+
DoDiffuse=false;
|
|
74
|
+
counter++;
|
|
75
|
+
}
|
|
76
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='G' )
|
|
77
|
+
{
|
|
78
|
+
ClimateFileFormat=cClimateFile::GLOBAL_DIFFUSE;
|
|
79
|
+
counter++;
|
|
80
|
+
}
|
|
81
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='B' )
|
|
82
|
+
{
|
|
83
|
+
ClimateFileFormat=cClimateFile::DIRECTHORIZONTAL_DIFFUSE;
|
|
84
|
+
counter++;
|
|
85
|
+
}
|
|
86
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='E' )
|
|
87
|
+
{
|
|
88
|
+
ClimateFileFormat=cClimateFile::GLOBAL_DIFFUSE_EPW;
|
|
89
|
+
counter++;
|
|
90
|
+
}
|
|
91
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='l' )
|
|
92
|
+
{
|
|
93
|
+
DoIlluminance=true;
|
|
94
|
+
counter++;
|
|
95
|
+
}
|
|
96
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='r' )
|
|
97
|
+
{
|
|
98
|
+
ScalingFactor=1.0/179000;;
|
|
99
|
+
counter++;
|
|
100
|
+
}
|
|
101
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='p' )
|
|
102
|
+
{
|
|
103
|
+
ScalingFactor=1.0/1000;;
|
|
104
|
+
counter++;
|
|
105
|
+
}
|
|
106
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='a')
|
|
107
|
+
{
|
|
108
|
+
if ((argc-counter)>2)
|
|
109
|
+
{
|
|
110
|
+
sky.SetLatitude(atof(argv[counter+1])*M_PI/180.);
|
|
111
|
+
counter+=2;
|
|
112
|
+
}
|
|
113
|
+
else
|
|
114
|
+
{
|
|
115
|
+
goto USAGEERROR;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='h')
|
|
119
|
+
{
|
|
120
|
+
if ((argc-counter)>2)
|
|
121
|
+
{
|
|
122
|
+
// hourshift - used to alter the default time convention
|
|
123
|
+
hourshift=atof(argv[counter+1]);
|
|
124
|
+
counter+=2;
|
|
125
|
+
}
|
|
126
|
+
else
|
|
127
|
+
{
|
|
128
|
+
goto USAGEERROR;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='o' && (argc-counter)>2)
|
|
132
|
+
{
|
|
133
|
+
if ((argc-counter)>2)
|
|
134
|
+
{
|
|
135
|
+
sky.SetLongitude(atof(argv[counter+1])*M_PI/180.);
|
|
136
|
+
counter+=2;
|
|
137
|
+
}
|
|
138
|
+
else
|
|
139
|
+
{
|
|
140
|
+
goto USAGEERROR;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='m' && (argc-counter)>2)
|
|
144
|
+
{
|
|
145
|
+
if ((argc-counter)>2)
|
|
146
|
+
{
|
|
147
|
+
sky.SetMeridian(atof(argv[counter+1])*M_PI/180.);
|
|
148
|
+
counter+=2;
|
|
149
|
+
}
|
|
150
|
+
else
|
|
151
|
+
{
|
|
152
|
+
goto USAGEERROR;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='t' && argv[counter][2]=='i' && argv[counter][3]=='m' && argv[counter][4]=='e' )
|
|
156
|
+
{
|
|
157
|
+
if ((argc-counter)>3 )
|
|
158
|
+
{
|
|
159
|
+
sky.StartTime=atof(argv[counter+1]);
|
|
160
|
+
sky.EndTime=atof(argv[counter+2]);
|
|
161
|
+
counter+=3;
|
|
162
|
+
if(sky.StartTime<0 || sky.StartTime >24 || sky.EndTime<0 || sky.EndTime >24 || sky.EndTime <= sky.StartTime)
|
|
163
|
+
{
|
|
164
|
+
fprintf(stderr,"GenCumulativeSky: Error - invalid start time (%.3f) or end time (%.3f)\n",sky.StartTime,sky.EndTime );
|
|
165
|
+
goto USAGEERROR;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else
|
|
169
|
+
{
|
|
170
|
+
goto USAGEERROR;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
}
|
|
174
|
+
else if (argv[counter][0]=='-' && argv[counter][1]=='d' && argv[counter][2]=='a' && argv[counter][3]=='t' && argv[counter][4]=='e' )
|
|
175
|
+
{
|
|
176
|
+
if ((argc-counter)>5 )
|
|
177
|
+
{
|
|
178
|
+
sky.StartMonth=atoi(argv[counter+1]);
|
|
179
|
+
sky.StartDay=atoi(argv[counter+2]);
|
|
180
|
+
sky.EndMonth=atoi(argv[counter+3]);
|
|
181
|
+
sky.EndDay=atoi(argv[counter+4]);
|
|
182
|
+
counter+=5;
|
|
183
|
+
if(sky.StartDay<0 || sky.StartDay >31.0 ||sky.EndDay<0.0 || sky.EndDay >31.0 ||sky.StartMonth<0.0 || sky.StartMonth >12.0 ||sky.EndMonth<0.0 || sky.EndMonth >12.0)
|
|
184
|
+
{
|
|
185
|
+
fprintf(stderr,"GenCumulativeSky: Error - invalid start date (%2.0f//%2.0f) or end date (%2.0f//%2.0f)\n",(double)sky.StartMonth,(double)sky.StartDay,(double)sky.EndMonth,(double)sky.EndDay );
|
|
186
|
+
goto USAGEERROR;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
else
|
|
190
|
+
{
|
|
191
|
+
goto USAGEERROR;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
}
|
|
195
|
+
else
|
|
196
|
+
{
|
|
197
|
+
fprintf(stderr,"GenCumulativeSky: Error - invalid input parameter '%s'\n\n",argv[counter]);
|
|
198
|
+
goto USAGEERROR;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
if (!sky.LoadClimateFile(filename, ClimateFileFormat, sky.StartTime, sky.EndTime, sky.StartDay, sky.EndDay, sky.StartMonth, sky.EndMonth))
|
|
205
|
+
{
|
|
206
|
+
fprintf(stderr,"GenCumulativeSky: Error reading climate file %s\n\n",filename);
|
|
207
|
+
goto USAGEERROR;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
sky.CalculateSky(SunType, DoDiffuse, DoIlluminance, hourshift);
|
|
211
|
+
|
|
212
|
+
CumSky=sky.GetCumulativeSky();
|
|
213
|
+
sky.GetPatchDetails(patchData);
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
printf("{ This .cal file was generated automatically by GenCumulativeSky }\n");
|
|
218
|
+
printf("{ ");
|
|
219
|
+
for (j=0; j<argc; j++)
|
|
220
|
+
printf("%s ",argv[j]);
|
|
221
|
+
printf(" }\n\n");
|
|
222
|
+
printf("skybright=");
|
|
223
|
+
for (j=0; j<7; j++)
|
|
224
|
+
{
|
|
225
|
+
printf("row%d+",j);
|
|
226
|
+
}
|
|
227
|
+
printf("row7;\n\n");
|
|
228
|
+
|
|
229
|
+
counter=0;
|
|
230
|
+
for (j=0; j<7; j++)
|
|
231
|
+
{
|
|
232
|
+
// note first patch split into two parts - first part (> 0 deg) and last patch (<360)
|
|
233
|
+
printf("row%d=if(and(alt-%d, %d-alt),select(floor(0.5+az/%5.2f)+1,\n",j,j*rowdeltaalt,(j+1)*rowdeltaalt,rowdeltaaz[j]);
|
|
234
|
+
for (i=0+counter; i<counter+360/int(rowdeltaaz[j]); i++)
|
|
235
|
+
{
|
|
236
|
+
printf("\t%f,\n",CumSky[i]*ScalingFactor);
|
|
237
|
+
}
|
|
238
|
+
printf("\t%f),0);\n\n",CumSky[counter]*ScalingFactor);
|
|
239
|
+
counter+=(int)(360/rowdeltaaz[j]);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
printf("row7=if(alt-84,%f,0);\n\n",CumSky[144]*ScalingFactor);
|
|
243
|
+
|
|
244
|
+
printf("alt=asin(Dz)*180/PI;\n\n");
|
|
245
|
+
|
|
246
|
+
printf("az=if(azi,azi,azi+360);\n");
|
|
247
|
+
printf("azi=atan2(Dx,Dy)*180/PI;\n\n");
|
|
248
|
+
|
|
249
|
+
return 0;
|
|
250
|
+
|
|
251
|
+
USAGEERROR:
|
|
252
|
+
fprintf(stderr,"Usage: GenCumulativeSky [-d] [+s1|+s2] [-a latitude] [-o longitude] [-l] [-m standard meridian] [-h hourshift] [-G|-B|-E] <climate file>\n");
|
|
253
|
+
fprintf(stderr,"(Note: longitude +ve East of Greenwich)\n\n");
|
|
254
|
+
fprintf(stderr,"\t-d\tIgnore diffuse irradiance\n");
|
|
255
|
+
fprintf(stderr,"\t+s1\tUse \"smeared sun\" approach (default)\n");
|
|
256
|
+
fprintf(stderr,"\t+s2\tUse \"binned sun\" approach\n");
|
|
257
|
+
fprintf(stderr,"\t-l\tOutput luminance instead of radiance\n");
|
|
258
|
+
fprintf(stderr,"\t-r\tOutput radiance/179000 (ensures that units in the Radiance Image Viewer are in kWhm-2)\n");
|
|
259
|
+
fprintf(stderr,"\t-p\tOutput radiance/1000 (ensures that units in the Radiance RGB data file are in kWhm-2)\n");
|
|
260
|
+
fprintf(stderr,"\t-G\tFile format is col1=global irradiance (W/m2), col2=diffuse irradiance (W/m2)\n");
|
|
261
|
+
fprintf(stderr,"\t-B\tFile format is col1=direct horizontal irradiance (W/m2), col2=diffuse irradiance (W/m2)\n");
|
|
262
|
+
fprintf(stderr,"\t-E\tFile format is an energyplus weather file (*.epw) The gprogram uses the global irradiance (W/m2) and diffuse irradiance (W/m2) data columns.\n");
|
|
263
|
+
fprintf(stderr,"\t\tIn combination with \'-E' the considered time interval can be specified:\n");
|
|
264
|
+
fprintf(stderr,"\t\t-time <start time of day> <end time of day>\n");
|
|
265
|
+
fprintf(stderr,"\t\t-date mm_start dd_start mm_end dd_end (if start-date after end-date then the winter interval is considered)\n");
|
|
266
|
+
fprintf(stderr,"\n");
|
|
267
|
+
return -1;
|
|
268
|
+
}
|
|
269
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#! /usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
Multiplatform make gencumulativesky executable for Windows, Linux, & Mac OS X
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import logging
|
|
7
|
+
import os
|
|
8
|
+
import sys
|
|
9
|
+
try:
|
|
10
|
+
from setuptools import distutils
|
|
11
|
+
except ImportError:
|
|
12
|
+
sys.exit('setuptools was not detected - please install setuptools and pip')
|
|
13
|
+
|
|
14
|
+
# setup basic logging
|
|
15
|
+
logging.basicConfig()
|
|
16
|
+
LOGGER = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
# compiler options
|
|
19
|
+
CC = distutils.ccompiler.new_compiler() # initialize compiler object
|
|
20
|
+
LIBRARIES = ['m'] # use math library
|
|
21
|
+
# include extra definitions for functions in X/Open Portability Guide
|
|
22
|
+
# https://www.gnu.org/software/libc/manual/html_node/XPG.html
|
|
23
|
+
MACROS = [('_XOPEN_SOURCE', None)]
|
|
24
|
+
# full path to this file
|
|
25
|
+
GENCUMSKY_DIR = os.path.abspath(os.path.dirname(__file__))
|
|
26
|
+
EXE_FILE = 'gencumulativesky' # name of compiled executable file
|
|
27
|
+
# use g++ executables instead of gcc
|
|
28
|
+
LINKER_EXE = COMPILER = COMPILER_CXX = ['g++']
|
|
29
|
+
|
|
30
|
+
# platform specific constants
|
|
31
|
+
PLATFORM = sys.platform
|
|
32
|
+
if PLATFORM == 'win32':
|
|
33
|
+
# math library and XOPG macro are not used on Windows
|
|
34
|
+
LIBRARIES = None
|
|
35
|
+
MACROS = [('WIN32', None)]
|
|
36
|
+
elif PLATFORM == 'darwin':
|
|
37
|
+
pass
|
|
38
|
+
elif PLATFORM in ['linux', 'linux2']:
|
|
39
|
+
PLATFORM = 'linux' # consolidate linux names
|
|
40
|
+
else:
|
|
41
|
+
sys.exit('Platform "%s" is unknown or unsupported.' % PLATFORM)
|
|
42
|
+
# on linux and mac set the compiler and linker to use g++ instead of gcc
|
|
43
|
+
if PLATFORM in ['linux', 'darwin']:
|
|
44
|
+
CC.set_executables(
|
|
45
|
+
linker_exe=LINKER_EXE, compiler=COMPILER, compiler_cxx=COMPILER_CXX)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def compile_gencumsky(compiler=CC, output_dir=GENCUMSKY_DIR, macros=None,
|
|
49
|
+
output_progname=EXE_FILE, libraries=None, logger=LOGGER):
|
|
50
|
+
"""
|
|
51
|
+
Create platform specific gencumulativesky executable from download.
|
|
52
|
+
|
|
53
|
+
Parameters
|
|
54
|
+
----------
|
|
55
|
+
compiler : `distutils.ccompiler.CCompiler`
|
|
56
|
+
defaults has linker and cc set to g++ for linux and mac os x
|
|
57
|
+
output_dir : str
|
|
58
|
+
path to output folder, default is absolute path to this folder
|
|
59
|
+
macros : list of 2-item tuples
|
|
60
|
+
if ``None`` then defaults to ``[('WIN32', None)]`` on Windows, and
|
|
61
|
+
``[('_XOPEN_SOURCE', None)]`` for linux and mac os x
|
|
62
|
+
output_progname : str
|
|
63
|
+
default is ``'gencumulativesky'``, windows automatically adds ``.exe``
|
|
64
|
+
libraries : list
|
|
65
|
+
if ``None`` then defualts to ``['m']`` for linux and mac os x
|
|
66
|
+
logger : `logging.Logger`
|
|
67
|
+
default is only critical logging
|
|
68
|
+
|
|
69
|
+
Raises
|
|
70
|
+
------
|
|
71
|
+
`distutils.errors.UnknownFileError`, `distutils.errors.CompileError`,
|
|
72
|
+
`distutils.errors.LinkError`
|
|
73
|
+
"""
|
|
74
|
+
logger.debug('compiler: %r', compiler)
|
|
75
|
+
logger.debug('output directory: %s', output_dir)
|
|
76
|
+
logger.debug('output program name: %s', output_progname)
|
|
77
|
+
if macros is None:
|
|
78
|
+
macros = MACROS # use default macros
|
|
79
|
+
logger.debug('macros: %r', macros)
|
|
80
|
+
if libraries is None:
|
|
81
|
+
libraries = LIBRARIES # use default libraries
|
|
82
|
+
logger.debug('libraries: %r', libraries)
|
|
83
|
+
# a list of *.cpp source code to compile
|
|
84
|
+
src = [os.path.join(output_dir, f) for f in os.listdir(output_dir)
|
|
85
|
+
if f.endswith('.cpp')]
|
|
86
|
+
# log *.cpp source to compile
|
|
87
|
+
logger.debug('*.cpp source files:\n\t%s', '\n\t'.join(src))
|
|
88
|
+
# root of this file, used for compiler output directory
|
|
89
|
+
root, _ = os.path.splitdrive(output_dir)
|
|
90
|
+
root += os.sep # append platform specific path separator
|
|
91
|
+
logger.debug('root: %s', root)
|
|
92
|
+
# compile source to objects in build directory
|
|
93
|
+
objs = compiler.compile(src, output_dir=root, macros=macros)
|
|
94
|
+
# log objects to compile
|
|
95
|
+
logger.debug('compiled objects:\n\t%s', '\n\t'.join(objs))
|
|
96
|
+
# link objects to executable in build directory
|
|
97
|
+
compiler.link_executable(
|
|
98
|
+
objs, output_progname, output_dir=output_dir, libraries=libraries)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
if __name__ == '__main__':
|
|
102
|
+
LOGGER.setLevel(logging.DEBUG) # set logging level to debug
|
|
103
|
+
LOGGER.debug('compiling gencumsky ...\n')
|
|
104
|
+
compile_gencumsky(logger=LOGGER) # compile
|
|
105
|
+
LOGGER.debug(' ... %s successfully compiled!\n', EXE_FILE)
|
|
106
|
+
os.system(os.path.join(GENCUMSKY_DIR, EXE_FILE))
|
|
107
|
+
sys.exit(0) # successful exit!
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* Copyright (c) 1992 Regents of the University of California */
|
|
2
|
+
|
|
3
|
+
/* SCCSid "@(#)paths.h 2.7 7/21/93 LBL" */
|
|
4
|
+
/* ANSI-C apian@ise.fhg.de */
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Definitions for paths on different machines
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#ifdef MSDOS
|
|
11
|
+
|
|
12
|
+
#define DIRSEP '/'
|
|
13
|
+
#define ISDIRSEP(c) ((c)=='/' || (c)=='\\')
|
|
14
|
+
#define CASEDIRSEP case '/': case '\\'
|
|
15
|
+
#define PATHSEP ';'
|
|
16
|
+
#define MAXPATH 128
|
|
17
|
+
#define TEMPLATE "rtXXXXXX"
|
|
18
|
+
#define TEMPLEN 8
|
|
19
|
+
#define ULIBVAR "RAYPATH"
|
|
20
|
+
#ifndef DEFPATH
|
|
21
|
+
#define DEFPATH "c:\\Documents and Settings\\stonea\\My Documents"
|
|
22
|
+
//#define DEFPATH ";c:/ray/lib"
|
|
23
|
+
#endif
|
|
24
|
+
extern char *fixargv0();
|
|
25
|
+
|
|
26
|
+
#else
|
|
27
|
+
#ifdef AMIGA
|
|
28
|
+
|
|
29
|
+
#define DIRSEP '/'
|
|
30
|
+
#define PATHSEP ';'
|
|
31
|
+
#define MAXPATH 128
|
|
32
|
+
#define TEMPLATE "/tmp/rtXXXXXX"
|
|
33
|
+
#define TEMPLEN 13
|
|
34
|
+
#define ULIBVAR "RAYPATH"
|
|
35
|
+
#ifndef DEFPATH
|
|
36
|
+
#define DEFPATH ";/ray/lib"
|
|
37
|
+
#endif
|
|
38
|
+
#define fixargv0(a0) (a0)
|
|
39
|
+
|
|
40
|
+
#else
|
|
41
|
+
|
|
42
|
+
#define DIRSEP '/'
|
|
43
|
+
#define PATHSEP ':'
|
|
44
|
+
#define MAXPATH 256
|
|
45
|
+
#define TEMPLATE "/usr/tmp/rtXXXXXX"
|
|
46
|
+
#define TEMPLEN 17
|
|
47
|
+
#define ULIBVAR "RAYPATH"
|
|
48
|
+
#ifndef DEFPATH
|
|
49
|
+
#define DEFPATH "/usr/local/lib/ray"
|
|
50
|
+
#endif
|
|
51
|
+
#define fixargv0(a0) (a0)
|
|
52
|
+
|
|
53
|
+
#endif
|
|
54
|
+
#endif
|
|
55
|
+
|
|
56
|
+
#ifndef ISDIRSEP
|
|
57
|
+
#define ISDIRSEP(c) ((c)==DIRSEP)
|
|
58
|
+
#endif
|
|
59
|
+
#ifndef CASEDIRSEP
|
|
60
|
+
#define CASEDIRSEP case DIRSEP
|
|
61
|
+
#endif
|
|
62
|
+
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#ground materials for use in defining ground reflectance etc.
|
|
2
|
+
#experimental reflectance values taken at R(650nm) G(510nm) B(470nm)
|
|
3
|
+
#normalized reflectance: (0.265*R+0.670*G+0.065*B)
|
|
4
|
+
|
|
5
|
+
#no reflections 0%R
|
|
6
|
+
void plastic black
|
|
7
|
+
0
|
|
8
|
+
0
|
|
9
|
+
5 0.01 0.01 0.01 0 0
|
|
10
|
+
|
|
11
|
+
#G173 light soil .21R
|
|
12
|
+
void plastic litesoil
|
|
13
|
+
0
|
|
14
|
+
0
|
|
15
|
+
5 .29 .187 .163 0 0
|
|
16
|
+
|
|
17
|
+
#Concrete (from SMARTS) albedo 0.28
|
|
18
|
+
void plastic concrete
|
|
19
|
+
0
|
|
20
|
+
0
|
|
21
|
+
5 .364 .257 .2235 0 0
|
|
22
|
+
|
|
23
|
+
#White EPDM (measured) albedo .807
|
|
24
|
+
void plastic white_EPDM
|
|
25
|
+
0
|
|
26
|
+
0
|
|
27
|
+
5 .863 .791 .745 0 0
|
|
28
|
+
|
|
29
|
+
#CU Boulder Beige roof (clean) albedo 0.43
|
|
30
|
+
void plastic beigeroof
|
|
31
|
+
0
|
|
32
|
+
0
|
|
33
|
+
5 .547 .395 .339 0 0
|
|
34
|
+
|
|
35
|
+
#CU Boulder Beige roof (lite soil Case 3) albedo 0.30 case 2: 5 .43 .30 .258 0 0
|
|
36
|
+
void plastic beigeroof_lite
|
|
37
|
+
0
|
|
38
|
+
0
|
|
39
|
+
5 .388 .273 .234 0 0
|
|
40
|
+
|
|
41
|
+
#CU Boulder Beige roof (heavy soil Case 4) albedo 0.25
|
|
42
|
+
void plastic beigeroof_heavy
|
|
43
|
+
0
|
|
44
|
+
0
|
|
45
|
+
5 .321 .228 .197 0 0
|
|
46
|
+
|
|
47
|
+
#Asphalt albedo 0.1
|
|
48
|
+
void plastic asphalt
|
|
49
|
+
0
|
|
50
|
+
0
|
|
51
|
+
5 .1 .1 .1 0 .2
|
|
52
|
+
|
|
53
|
+
#Greyroof albedo 0.62 from SolarWorld calculator
|
|
54
|
+
void plastic greyroof
|
|
55
|
+
0
|
|
56
|
+
0
|
|
57
|
+
5 .62 .62 .62 0 0
|
|
58
|
+
|
|
59
|
+
void plastic Metal_Aluminum_Anodized
|
|
60
|
+
0
|
|
61
|
+
0
|
|
62
|
+
5 0.792157 0.819608 0.858824 0.2 0.1
|
|
63
|
+
#map_Kd MonoPanel/Metal_Aluminum_Anodized.jpg
|
|
64
|
+
|
|
65
|
+
void plastic Color_I11
|
|
66
|
+
0
|
|
67
|
+
0
|
|
68
|
+
5 0.000000 0.000000 0.600000 0.1 0.1
|
|
69
|
+
|
|
70
|
+
void plastic M_0010_Snow
|
|
71
|
+
0
|
|
72
|
+
0
|
|
73
|
+
5 1.000000 0.980392 0.980392 0.1 0.1
|
|
74
|
+
|
|
75
|
+
void plastic Metal_Grey
|
|
76
|
+
0
|
|
77
|
+
0
|
|
78
|
+
5 0.43 0.448 0.465 0.5 0.5
|
|
79
|
+
|
|
80
|
+
void glass stock_glass
|
|
81
|
+
0
|
|
82
|
+
0
|
|
83
|
+
3 0.96 0.96 0.96
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"PVmod": {
|
|
3
|
+
"bifi": 1,
|
|
4
|
+
"glass": false,
|
|
5
|
+
"modulefile": null,
|
|
6
|
+
"modulematerial": "black",
|
|
7
|
+
"numpanels": 1,
|
|
8
|
+
"offsetfromaxis": 0,
|
|
9
|
+
"scenex": 2.01,
|
|
10
|
+
"sceney": 1.0,
|
|
11
|
+
"scenez": 0.1,
|
|
12
|
+
"text": "! genbox black PVmod 2 1 0.02 | xform -t -1.0 -0.5 0 -a 1 -t 0 1.0 0",
|
|
13
|
+
"x": 2,
|
|
14
|
+
"xgap": 0.01,
|
|
15
|
+
"y": 1,
|
|
16
|
+
"ygap": 0.0,
|
|
17
|
+
"z": 0.02,
|
|
18
|
+
"zgap": 0.1
|
|
19
|
+
},
|
|
20
|
+
"PrismSolar-Bi60": {
|
|
21
|
+
"bifi": 1,
|
|
22
|
+
"cellModule": {
|
|
23
|
+
"centerJB": null,
|
|
24
|
+
"numcellsx": 6,
|
|
25
|
+
"numcellsy": 10,
|
|
26
|
+
"xcell": 0.152,
|
|
27
|
+
"xcellgap": 0.01,
|
|
28
|
+
"ycell": 0.152,
|
|
29
|
+
"ycellgap": 0.01
|
|
30
|
+
},
|
|
31
|
+
"glass": false,
|
|
32
|
+
"modulefile": null,
|
|
33
|
+
"modulematerial": "black",
|
|
34
|
+
"numpanels": 1,
|
|
35
|
+
"offsetfromaxis": 0,
|
|
36
|
+
"scenex": 0.972,
|
|
37
|
+
"sceney": 1.61,
|
|
38
|
+
"scenez": 0.1,
|
|
39
|
+
"text": "! genbox black cellPVmodule 0.152 0.152 0.02 | xform -t -0.40499999999999997 -0.805 0 -a 6 -t 0.162 0 0 -a 10 -t 0 0.162 0 -a 1 -t 0 1.61 0",
|
|
40
|
+
"x": 0.962,
|
|
41
|
+
"xgap": 0.01,
|
|
42
|
+
"y": 1.61,
|
|
43
|
+
"ygap": 0.0,
|
|
44
|
+
"z": 0.02,
|
|
45
|
+
"zgap": 0.1
|
|
46
|
+
},
|
|
47
|
+
"basic-module": {
|
|
48
|
+
"bifi": 1,
|
|
49
|
+
"glass": false,
|
|
50
|
+
"modulefile": null,
|
|
51
|
+
"modulematerial": "black",
|
|
52
|
+
"numpanels": 1,
|
|
53
|
+
"offsetfromaxis": 0,
|
|
54
|
+
"scenex": 2.01,
|
|
55
|
+
"sceney": 1.0,
|
|
56
|
+
"scenez": 0.1,
|
|
57
|
+
"text": "! genbox black basic-module 2.0 1.0 0.02 | xform -t -1.0 -0.5 0 -a 1 -t 0 1.0 0",
|
|
58
|
+
"x": 2.0,
|
|
59
|
+
"xgap": 0.01,
|
|
60
|
+
"y": 1.0,
|
|
61
|
+
"ygap": 0.0,
|
|
62
|
+
"z": 0.02,
|
|
63
|
+
"zgap": 0.1
|
|
64
|
+
},
|
|
65
|
+
"test": {
|
|
66
|
+
"bifi": 1,
|
|
67
|
+
"glass": false,
|
|
68
|
+
"glassEdge": 0.01,
|
|
69
|
+
"modulefile": null,
|
|
70
|
+
"modulematerial": "black",
|
|
71
|
+
"numpanels": 1,
|
|
72
|
+
"offsetfromaxis": 0,
|
|
73
|
+
"scenex": 1.6,
|
|
74
|
+
"sceney": 0.95,
|
|
75
|
+
"scenez": 0.1,
|
|
76
|
+
"text": "! genbox black test 1.59 0.95 0.02 | xform -t -0.795 -0.475 0 -a 1 -t 0 0.95 0",
|
|
77
|
+
"x": 1.59,
|
|
78
|
+
"xgap": 0.01,
|
|
79
|
+
"y": 0.95,
|
|
80
|
+
"ygap": 0.0,
|
|
81
|
+
"z": 0.02,
|
|
82
|
+
"zgap": 0.1
|
|
83
|
+
},
|
|
84
|
+
"test-module": {
|
|
85
|
+
"bifi": 1,
|
|
86
|
+
"glass": false,
|
|
87
|
+
"glassEdge": 0.01,
|
|
88
|
+
"modulefile": null,
|
|
89
|
+
"modulematerial": "black",
|
|
90
|
+
"numpanels": 1,
|
|
91
|
+
"offsetfromaxis": 0,
|
|
92
|
+
"scenex": 1.01,
|
|
93
|
+
"sceney": 2.0,
|
|
94
|
+
"scenez": 0.1,
|
|
95
|
+
"text": "! genbox black test-module 1 2 0.02 | xform -t -0.5 -1.0 0 -a 1 -t 0 2.0 0",
|
|
96
|
+
"x": 1,
|
|
97
|
+
"xgap": 0.01,
|
|
98
|
+
"y": 2,
|
|
99
|
+
"ygap": 0.0,
|
|
100
|
+
"z": 0.02,
|
|
101
|
+
"zgap": 0.1
|
|
102
|
+
}
|
|
103
|
+
}
|