--- ray/src/util/rttree_reduce.c 2017/05/31 03:26:46 2.17 +++ ray/src/util/rttree_reduce.c 2020/06/30 17:18:22 2.20 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rttree_reduce.c,v 2.17 2017/05/31 03:26:46 greg Exp $"; +static const char RCSid[] = "$Id: rttree_reduce.c,v 2.20 2020/06/30 17:18:22 greg Exp $"; #endif /* * A utility called by genBSDF.pl to reduce tensor tree samples and output @@ -19,8 +19,8 @@ int log2g = 4; /* log2 of grid resolution */ int infmt = 'a'; /* input format ('a','f','d') */ double pctcull = 95.; /* target culling percentile */ -#define dval3(ix,ox,oy) datarr[((((ix)<vmax - (tp)->vmin) / \ +#define var_measure(tp) sqrt( ((tp)->vmax - (tp)->vmin) / \ (sqrt((tp)->vavg) + .03) ) #define above_threshold(tp) (var_measure(tp) > tthresh) @@ -402,10 +402,10 @@ main(int argc, char *argv[]) if (recipavg) do_reciprocity(); if (doheader) { - for (i = 0; i < argc; i++) { - fputs(argv[i], stdout); - fputc(i < argc-1 ? ' ' : '\n', stdout); - } + newheader("RADIANCE", stdout); + printargs(argc, argv, stdout); + fputnow(stdout); + fputformat("ascii", stdout); fputc('\n', stdout); } gtree.kid = NULL; /* create our tree */