| 69 |
|
int nfield_assign = 0; |
| 70 |
|
#define FASEP ';' |
| 71 |
|
/* data file(s) & spectra */ |
| 72 |
< |
enum { DTtransForward, DTtransBackward, DTreflForward, DTreflBackward }; |
| 72 |
> |
enum { DTransFront, DTransBack, DTreflFront, DTreflBack }; |
| 73 |
|
|
| 74 |
+ |
static const char component_name[4][20] = { |
| 75 |
+ |
"Transmission Front", |
| 76 |
+ |
"Transmission Back", |
| 77 |
+ |
"Reflection Front", |
| 78 |
+ |
"Reflection Back" |
| 79 |
+ |
}; |
| 80 |
+ |
|
| 81 |
|
enum { DSsolar=-1, DSnir=-2, DSxbar31=-3, DSvisible=-4, DSzbar31=-5, |
| 82 |
|
DSuprime=-6, DSvprime=-7 }; |
| 83 |
|
|
| 139 |
|
if ((data_file[i].spectrum == data_file[ndataf].spectrum) & |
| 140 |
|
(data_file[i].type == data_file[ndataf].type)) { |
| 141 |
|
fprintf(stderr, |
| 142 |
< |
"%s: warning - ignoring duplicate component\n", |
| 143 |
< |
data_file[ndataf].fname); |
| 142 |
> |
"%s: warning - ignoring duplicate component %s\n", |
| 143 |
> |
data_file[ndataf].fname, |
| 144 |
> |
component_name[data_file[i].type]); |
| 145 |
|
return 0; |
| 146 |
|
} |
| 147 |
|
return 1; |
| 510 |
|
} |
| 511 |
|
puts("\t\t<WavelengthDataBlock>"); |
| 512 |
|
fputs("\t\t\t<WavelengthDataDirection>", stdout); |
| 513 |
< |
switch (df->type) { |
| 506 |
< |
case DTtransForward: |
| 507 |
< |
fputs("Transmission Front", stdout); |
| 508 |
< |
break; |
| 509 |
< |
case DTtransBackward: |
| 510 |
< |
fputs("Transmission Back", stdout); |
| 511 |
< |
break; |
| 512 |
< |
case DTreflForward: |
| 513 |
< |
fputs("Reflection Front", stdout); |
| 514 |
< |
break; |
| 515 |
< |
case DTreflBackward: |
| 516 |
< |
fputs("Reflection Back", stdout); |
| 517 |
< |
break; |
| 518 |
< |
default: |
| 519 |
< |
fprintf(stderr, "%s: internal - bad BSDF type (%d)\n", caller, df->type); |
| 520 |
< |
return 0; |
| 521 |
< |
} |
| 513 |
> |
fputs(component_name[df->type], stdout); |
| 514 |
|
puts("</WavelengthDataDirection>"); |
| 515 |
|
switch (angle_basis) { |
| 516 |
|
case ABklemsFull: |
| 833 |
|
return 1; |
| 834 |
|
} |
| 835 |
|
if (!strcmp(argv[i], "-tf")) |
| 836 |
< |
data_file[ndataf].type = DTtransForward; |
| 836 |
> |
data_file[ndataf].type = DTransFront; |
| 837 |
|
else if (!strcmp(argv[i], "-tb")) |
| 838 |
< |
data_file[ndataf].type = DTtransBackward; |
| 838 |
> |
data_file[ndataf].type = DTransBack; |
| 839 |
|
else |
| 840 |
|
UsageExit(argv[0]); |
| 841 |
|
if (!strcmp(argv[++i], "-")) { |
| 855 |
|
return 1; |
| 856 |
|
} |
| 857 |
|
if (!strcmp(argv[i], "-rf")) |
| 858 |
< |
data_file[ndataf].type = DTreflForward; |
| 858 |
> |
data_file[ndataf].type = DTreflFront; |
| 859 |
|
else if (!strcmp(argv[i], "-rb")) |
| 860 |
< |
data_file[ndataf].type = DTreflBackward; |
| 860 |
> |
data_file[ndataf].type = DTreflBack; |
| 861 |
|
else |
| 862 |
|
UsageExit(argv[0]); |
| 863 |
|
if (!strcmp(argv[++i], "-")) { |
| 866 |
|
} |
| 867 |
|
data_file[ndataf].fname = argv[i]; |
| 868 |
|
data_file[ndataf].spectrum = cur_spectrum; |
| 869 |
< |
ndataf++; |
| 869 |
> |
ndataf += check_new_data_file(); |
| 870 |
|
continue; |
| 871 |
|
case 's': /* spectrum name or input file */ |
| 872 |
|
if (++i >= argc) |