| 61 |
|
|
| 62 |
|
static int nabases = 3; /* current number of defined bases */ |
| 63 |
|
|
| 64 |
< |
#define FEQ(a,b) ((a)-(b) <= 1e-7 && (b)-(a) <= 1e-7) |
| 64 |
> |
#define FEQ(a,b) ((a)-(b) <= 1e-6 && (b)-(a) <= 1e-6) |
| 65 |
|
|
| 66 |
+ |
static int |
| 67 |
+ |
fequal(double a, double b) |
| 68 |
+ |
{ |
| 69 |
+ |
if (b != .0) |
| 70 |
+ |
a = a/b - 1.; |
| 71 |
+ |
return((a <= 1e-6) & (a >= -1e-6)); |
| 72 |
+ |
} |
| 73 |
+ |
|
| 74 |
|
// returns the name of the given tag |
| 75 |
|
#ifdef ezxml_name |
| 76 |
|
#undef ezxml_name |
| 235 |
|
if (!i) |
| 236 |
|
abase_list[nabases].lat[i].tmin = |
| 237 |
|
-abase_list[nabases].lat[i+1].tmin; |
| 238 |
< |
else if (!FEQ(atof(ezxml_txt(ezxml_child(ezxml_child(wbb, |
| 238 |
> |
else if (!fequal(atof(ezxml_txt(ezxml_child(ezxml_child(wbb, |
| 239 |
|
"ThetaBounds"), "LowerTheta"))), |
| 240 |
|
abase_list[nabases].lat[i].tmin)) |
| 241 |
|
error(WARNING, "theta values disagree in custom basis"); |
| 526 |
|
return(NULL); |
| 527 |
|
} |
| 528 |
|
wtl = ezxml_child(ezxml_child(fl, "Optical"), "Layer"); |
| 529 |
+ |
if (strcasecmp(ezxml_txt(ezxml_child(ezxml_child(wtl, |
| 530 |
+ |
"DataDefinition"), "IncidentDataStructure")), |
| 531 |
+ |
"Columns")) { |
| 532 |
+ |
sprintf(errmsg, |
| 533 |
+ |
"BSDF \"%s\": unsupported IncidentDataStructure", |
| 534 |
+ |
path); |
| 535 |
+ |
error(WARNING, errmsg); |
| 536 |
+ |
ezxml_free(fl); |
| 537 |
+ |
return(NULL); |
| 538 |
+ |
} |
| 539 |
|
load_angle_basis(ezxml_child(ezxml_child(wtl, |
| 540 |
|
"DataDefinition"), "AngleBasis")); |
| 541 |
|
dp = (struct BSDF_data *)calloc(1, sizeof(struct BSDF_data)); |