224 |
|
static int |
225 |
|
norm_check(FVECT nv1, FVECT nv2) |
226 |
|
{ |
227 |
< |
double max2 = nv1[2]*nv1[2]; |
227 |
> |
double max2 = nv1[2]*nv2[2]; |
228 |
|
int imax = 2; |
229 |
|
int i = 2; |
230 |
|
/* identify largest component */ |
231 |
|
while (i--) { |
232 |
< |
double tm2 = nv1[i]*nv1[i]; |
232 |
> |
double tm2 = nv1[i]*nv2[i]; |
233 |
|
if (tm2 > max2) { |
234 |
|
imax = i; |
235 |
|
max2 = tm2; |
317 |
|
static int |
318 |
|
setheadvar(char *val, void *p) |
319 |
|
{ |
320 |
+ |
char newval[128]; |
321 |
|
LUTAB *htp = (LUTAB *)p; |
322 |
|
LUENT *tep; |
323 |
|
char *key; |
360 |
|
return(-1); /* memory allocation error */ |
361 |
|
if (!tep->key) |
362 |
|
tep->key = strcpy(malloc(kln+1), key); |
363 |
< |
if (tep->data) |
363 |
> |
if (tep->data) { /* check for special cases */ |
364 |
> |
if (!strcmp(key, "EXPOSURE")) { |
365 |
> |
sprintf(newval, "%f", atof(tep->data)*atof(val)); |
366 |
> |
vln = strlen(val = newval); |
367 |
> |
} |
368 |
|
free(tep->data); |
369 |
+ |
} |
370 |
|
tep->data = strcpy(malloc(vln+1), val); |
371 |
|
return(1); |
372 |
|
} |
702 |
|
static char depthvar[] = DEPTHSTR; |
703 |
|
const char *drval; |
704 |
|
|
705 |
< |
depthvar[LDEPTHSTR] = '\0'; |
705 |
> |
depthvar[LDEPTHSTR-1] = '\0'; |
706 |
|
drval = (const char *)lu_find(htp, depthvar)->data; |
707 |
|
if (!drval) |
708 |
|
return(0); |
959 |
|
return(2); |
960 |
|
if (typ1 != typ2) { |
961 |
|
if (report != REP_QUIET) |
962 |
< |
printf("%s: '%s' is %s and '%s' is %s\n", |
962 |
> |
printf("%s: '%s' format is %s and '%s' is %s\n", |
963 |
|
progname, f1name, file_type[typ1], |
964 |
|
f2name, file_type[typ2]); |
965 |
|
return(1); |
975 |
|
printf("%s: warning - unrecognized format\n", |
976 |
|
progname); |
977 |
|
} |
978 |
< |
if (report >= REP_VERBOSE) |
979 |
< |
printf("%s: input file type is %s\n", |
980 |
< |
progname, file_type[typ1]); |
981 |
< |
|
978 |
> |
if (report >= REP_VERBOSE) { |
979 |
> |
printf("%s: data format is %s\n", progname, file_type[typ1]); |
980 |
> |
if ((typ1 == TYP_FLOAT) | (typ1 == TYP_DOUBLE)) { |
981 |
> |
if (f1swap) |
982 |
> |
printf("%s: input '%s' is byte-swapped\n", |
983 |
> |
progname, f1name); |
984 |
> |
if (f2swap) |
985 |
> |
printf("%s: input '%s' is byte-swapped\n", |
986 |
> |
progname, f2name); |
987 |
> |
} |
988 |
> |
} |
989 |
|
switch (typ1) { /* compare based on type */ |
990 |
|
case TYP_BINARY: |
991 |
|
case TYP_TMESH: |