96 |
|
fputs(": unknown incident angle\n", stderr); |
97 |
|
return(0); |
98 |
|
} |
99 |
+ |
while (inpfile[i].phi < 0) /* normalize phi direction */ |
100 |
+ |
inpfile[i].phi += 360.; |
101 |
|
return(1); |
102 |
|
} |
103 |
|
|
114 |
|
fputs(": cannot open\n", stderr); |
115 |
|
return(0); |
116 |
|
} |
115 |
– |
#ifdef DEBUG |
116 |
– |
fprintf(stderr, "Loading measurements from '%s'...\n", inpfile[i].fname); |
117 |
– |
#endif |
117 |
|
/* prepare input grid */ |
118 |
|
if (!i || cmp_inang(&inpfile[i-1], &inpfile[i])) { |
119 |
|
if (i) /* need to process previous incidence */ |
124 |
|
#endif |
125 |
|
new_bsdf_data(inpfile[i].theta, inpfile[i].phi); |
126 |
|
} |
127 |
+ |
#ifdef DEBUG |
128 |
+ |
fprintf(stderr, "Loading measurements from '%s'...\n", inpfile[i].fname); |
129 |
+ |
#endif |
130 |
|
/* read scattering data */ |
131 |
|
while (fscanf(fp, "%lf %lf %lf\n", &theta_out, &phi_out, &val) == 3) |
132 |
|
add_bsdf_data(theta_out, phi_out, val, inpfile[i].isDSF); |