292 |
|
main(int argc, char *argv[]) |
293 |
|
{ |
294 |
|
char buf[256]; |
295 |
+ |
double rotation = 0; /* site rotation (degrees) */ |
296 |
|
double elevation; /* site elevation (meters) */ |
297 |
|
int dir_is_horiz; /* direct is meas. on horizontal? */ |
298 |
|
float *mtx_data = NULL; /* our matrix data */ |
345 |
|
if (skycolor[1] <= 1e-4) |
346 |
|
skycolor[0] = skycolor[1] = skycolor[2] = 1; |
347 |
|
break; |
348 |
+ |
case 'r': /* rotate distribution */ |
349 |
+ |
if (argv[i][2] && argv[i][2] != 'z') |
350 |
+ |
goto userr; |
351 |
+ |
rotation = atof(argv[++i]); |
352 |
+ |
break; |
353 |
|
default: |
354 |
|
goto userr; |
355 |
|
} |
404 |
|
progname, s_latitude, s_longitude); |
405 |
|
fprintf(stderr, "%s: %d sky patches per time step\n", |
406 |
|
progname, nskypatch); |
407 |
+ |
if (rotation != 0) |
408 |
+ |
fprintf(stderr, "%s: rotating output %.0f degrees\n", |
409 |
+ |
progname, rotation); |
410 |
|
} |
411 |
|
/* convert quantities to radians */ |
412 |
|
s_latitude = DegToRad(s_latitude); |
430 |
|
sda = sdec(julian_date); |
431 |
|
sta = stadj(julian_date); |
432 |
|
altitude = salt(sda, hr+sta); |
433 |
< |
azimuth = sazi(sda, hr+sta) + PI; |
433 |
> |
azimuth = sazi(sda, hr+sta) + PI - DegToRad(rotation); |
434 |
|
/* convert measured values */ |
435 |
|
if (dir_is_horiz && altitude > 0.) |
436 |
|
dir /= sin(altitude); |
503 |
|
fprintf(stderr, "%s: done.\n", progname); |
504 |
|
exit(0); |
505 |
|
userr: |
506 |
< |
fprintf(stderr, "Usage: %s [-v][-d|-s][-m N][-g r g b][-c r g b][-o{f|d}] [tape.wea]\n", |
506 |
> |
fprintf(stderr, "Usage: %s [-v][-d|-s][-r deg][-m N][-g r g b][-c r g b][-o{f|d}] [tape.wea]\n", |
507 |
|
progname); |
508 |
|
exit(1); |
509 |
|
fmterr: |