17 |
|
|
18 |
|
#include <math.h> |
19 |
|
|
20 |
+ |
#include "color.h" |
21 |
|
|
22 |
|
extern char *strcpy(), *strcat(), *malloc(); |
23 |
|
extern double stadj(), sdec(), sazi(), salt(); |
54 |
|
int argc; |
55 |
|
char *argv[]; |
56 |
|
{ |
57 |
< |
extern double atof(); |
57 |
> |
extern double atof(), fabs(); |
58 |
|
int i; |
59 |
|
|
60 |
|
progname = argv[0]; |
103 |
|
else |
104 |
|
userror("bad option"); |
105 |
|
|
106 |
+ |
if (fabs(s_meridian-s_longitude) > 30*PI/180) |
107 |
+ |
fprintf(stderr, |
108 |
+ |
"%s: warning: %.1f hours btwn. standard meridian and longitude\n", |
109 |
+ |
progname, (s_longitude-s_meridian)*12/PI); |
110 |
+ |
|
111 |
|
printhead(argc, argv); |
112 |
|
|
113 |
|
computesky(); |
134 |
|
if (zenithbr <= 0.0) |
135 |
|
if (cloudy) { |
136 |
|
zenithbr = 8.6*sundir[2] + .123; |
137 |
< |
zenithbr *= 1000.0/683.0; |
137 |
> |
zenithbr *= 1000.0/SKYEFFICACY; |
138 |
|
} else { |
139 |
|
zenithbr = (1.376*turbidity-1.81)*tan(altitude)+0.38; |
140 |
< |
zenithbr *= 1000.0/683.0; |
140 |
> |
zenithbr *= 1000.0/SKYEFFICACY; |
141 |
|
} |
142 |
|
if (zenithbr < 0.0) |
143 |
|
zenithbr = 0.0; |
152 |
|
printf("# Ground ambient level: %f\n", groundbr); |
153 |
|
if (sundir[2] > 0.0) { |
154 |
|
if (sundir[2] > .16) |
155 |
< |
solarbr = 2.47e6 - 3.15e5/sundir[2]; |
155 |
> |
solarbr = (1.5e9/SUNEFFICACY) * |
156 |
> |
(1.147 - .147/sundir[2]); |
157 |
|
else |
158 |
< |
solarbr = 5e5; |
158 |
> |
solarbr = 1.5e9/SUNEFFICACY*(1.147-.147/.16); |
159 |
|
groundbr += solarbr*6e-5*sundir[2]/PI; |
160 |
|
} else |
161 |
|
dosun = 0; |
169 |
|
if (dosun) { |
170 |
|
printf("\nvoid light solar\n"); |
171 |
|
printf("0\n0\n"); |
172 |
< |
printf("3 %f %f %f\n", solarbr, solarbr, solarbr); |
172 |
> |
printf("3 %.2e %.2e %.2e\n", solarbr, solarbr, solarbr); |
173 |
|
printf("\nsolar source sun\n"); |
174 |
|
printf("0\n0\n"); |
175 |
|
printf("4 %f %f %f 0.5\n", sundir[0], sundir[1], sundir[2]); |
179 |
|
printf("2 skybright skybright.cal\n"); |
180 |
|
printf("0\n"); |
181 |
|
if (cloudy) |
182 |
< |
printf("3 1 %f %f\n", zenithbr, groundbr); |
182 |
> |
printf("3 1 %.2e %.2e\n", zenithbr, groundbr); |
183 |
|
else |
184 |
< |
printf("7 -1 %f %f %f %f %f %f\n", zenithbr, groundbr, F2, |
185 |
< |
sundir[0], sundir[1], sundir[2]); |
184 |
> |
printf("7 -1 %.2e %.2e %.2e %f %f %f\n", zenithbr, groundbr, |
185 |
> |
F2, sundir[0], sundir[1], sundir[2]); |
186 |
|
} |
187 |
|
|
188 |
|
|