bvhist [ parameter=value ... ] [ inputfile outputfile ] bvhist [ parameter=value ... ] [ inputfile ... directory ]
Parameters are: hist_vars, bin_counts, estimate_range, range_pairs, count_outside, log_scale, unit_scale, lookup_table, bin_centers
bvhist computes univariate, bivariate and trivariate histograms. Bivariate histograms are grids that can be displayed as images. Trivariate histograms are cubes.
For a given input dataset, the corresponding output dataset will contain a histogram variable, plus one value variable for each dimension of the histogram. For example, if computing a bivariate histogram based on two input variables A and B, the output dataset will contain three variables, histogram, A, and B. The values of output value variables A and B will correspond to the bins used to compute the histogram.
The output histogram variable is either
Log scaling is useful when histogram counts vary by more than two or three orders of magnitude. If histogram is a long integer variable, it can optionally be scaled by 1/maximum bin count.
The following example computes a bivariate histogram between AVHRR channels 2 and 4, first with automatic scaling, then with user-specified scaling.
% bvhist n7.84191.2316 histog hist_vars : char( 95) ? avhrr_ch2 avhrr_ch4 bin_counts : int ( 2) ? [256 256] estimate_range : char( 3) ? [yes] count_outside : char( 3) ? [yes] log_scale : char( 3) ? [yes] /extra/jhf/new7: avhrr_ch2 range [ 1.22, 27.73 ] /extra/jhf/new7: avhrr_ch4 range [ 10.39, 49.17 ] % bvhist n7.84191.2316 histog hist_vars : char( 95) ? avhrr_ch2 avhrr_ch4 bin_counts : int ( 2) ? [256 256] 60 80 estimate_range : char( 3) ? [yes] no range_pairs : real( 4) ? 0 30 10 50 count_outside : char( 3) ? [yes] no log_scale : char( 3) ? [yes]
The following example shows how to generate a histogram equalized image from real data:
% bvhist realdata lut hist_vars : char( 95) ? x bin_counts : int ? [256] 255 estimate_range : char( 3) ? [yes] count_outside : char( 3) ? [yes] log_scale : char( 3) ? [yes] n unit_scale : char( 3) ? [yes] n lookup_table : char( 3) ? [no] y realdata: x range [ 0, 5.07918 ] % enhance realdata enh include_vars : char(255) ? [] lookup_file : char(255) ? [] lut value_var : char( 31) ? [value] x index_var : char( 31) ? [index] histogram image_colors : int ? [256] bad_index : int ? [255]
Variable values are assigned to bins using the following logic; bins are numbered starting at zero, ending at the number of bins -1:
bin_width = (max_value - min_value)/num_bins;
if (count_outside) {
if (value < min_value)
value = min_value;
else if (value > max_value)
value = max_value
}
if (value == max_value)
bin = num_bins -1;
else
bin = (int)((value - min_value)/bin_width);
If the input variable data is integer values, with a range of [0, 100], and there are 10 bins, then each bin J except the last covers 10 values [J*10, ... J*10 +9]. The last bin covers 11 values [90, ..., 100].
Last Update: $Date: 2001/05/19 00:16:52 $