imscale [ parameter=value ...] [ inputfile outputfile ] imscale [ parameter=value ...] [ inputfile ... directory ]
Parameters are: include_vars, image_colors, bg_color, bad_color, over_color, under_color, max_width, max_height, fixed_size, zoom_factor, real_resample, est_range, min_value, max_value, invert_scale, north_up .
imscale performs many of the same functions as Image Display under xvu, except that imscale writes output to TeraScan datasets rather than to the display screen.
For each input dataset, imscale processes one or more 2-D variables, storing the results in the corresponding output dataset. The variables from a given input dataset are assumed to have the same dimensions. This simplification ensures that all output variables have the same dimensions, regardless of size-related parameter options.
Variable data is scaled so variable values in the range [min_value, max_value] are mapped to the output range [0, image_colors -1]. image_colors is user-specified. min_value and max_value can be user-specified or estimated by imscale. In the latter case, imscale will compute min_value and max_value for a variable if that variable's valid_min and valid_max attributes are undefined (i.e., are equal to the variable's bad_value).
When computing a variable's min_value and max_value, imscale subsamples the variable's data with a maximum delta of 5, but with a minimum subsampled width and height of 20 points; i.e. rules:
if vnx = variable width and vny = variable height deltax = (vnx > 100) ? 5 : (vnx > 20) ? vnx/20 : 1; deltay = (vny > 100) ? 5 : (vny > 20) ? vny/20 : 1;
Variable values greater than max_value or less than min_value are mapped to output values over_color and under_color, respectively. Missing variable values are mapped to the output value bad_color.
imscale allows the scale to be inverted. In this case, the variable's min_value is mapped to image_colors -1, and values less than min_value are mapped to over_color. Similarly, the variable's max_value is mapped to zero, and values greater than max_value are mapped to under_color.
imscale has a number of parameters that control the size of the output images: max_width, max_height, fixed_size, zoom_factor, and real_resample. These parameters are analogous to controls on the Image Set panel for xvu. max_width and max_height are the dimensions of the largest possible output image. fixed_size indicates that all output images will be exactly max_width wide and max_height tall.
If real_resample is not in effect, then either (1) the number of window pixels per image pixel or (2) the number of image pixels per window pixel is forced to be an integer. If real_resample is in effect, there is no such constraint. Consider the following cases in which
(1) variable to display is 256 pixels wide by 320 high (2) the maximum output image size is 800 pixels square
zoom fixed real ==> output output net factor size resamp width height zoom ------ ------ ------ ------ ------ ---- 1 - yes 256 320 1 1 yes yes 800 800 1 1 - - 256 320 1 1 yes - 800 800 1 2 - yes 512 640 2 2 yes yes 800 800 15/16 2 - - 512 640 2 2 yes - 800 800 1 4 - yes 640 800 5/2 4 yes yes 800 800 15/16 4 - - 512 640 2 4 yes - 800 800 1
When an input variable has earth location, imscale can flip and/or mirror the output image so north is up and east is to the right. This is controlled by the north_up parameter. This capability is useful when working with unregistered polar orbiter satellite data.
In the following example, unregistered AVHRR channel 4 temperature data is scaled down to a 216 color image. Automatic scaling is NOT used, and the user-specified input range of values is [10, 20] Celsius. Because the scale is inverted, 10 degrees Celsius is mapped to image color 215, and 20 degrees Celsius is mapped to image color 0. Note, too, that because the input is unregistered, the north_up option was selected to make sure that north is really up in the output image. (North is down for ascending NOAA satellite passes.)
loreto% imscale n7.84191.2316 image include_vars : char(255) ? [] *4 image_colors : int ? [216] max_width : int ? [1280] max_height : int ? [1024] fixed_size : char( 3) ? [no] zoom_factor : int ? [1] real_resample : char( 3) ? [yes] est_range : char( 3) ? [yes] n min_value : real ? 10 max_value : real ? 20 invert_scale : char( 3) ? [no] y north_up : char( 3) ? [no] y
Last Update: $Date: 1998/05/29 17:37:51 $