llcontr - Creates a contour metafile from random data

SYNOPSIS

llcontr  [ parameter=value ... ]  [ inputfile outputfile ]

Parameters are: master_file, grid_units, grid_spacing, search_radius, wt_power, z_variable, iso_values, sub_divs, num_arcs, text_height.

DESCRIPTION

llcontr generates contours from data with random (lat,lon) positions, relative to a given master_file. (lat,lon) positions are converted to master (line,sample) coordinates using the master's earth transform. See master and etx.

llcontr can contour any variable with corresponding, parallel latitude and longitude variables. llcontr can also treat any 2-D variable with an earth transform as random data. However, this type of data is usually contoured using llcontr2.

eggegu, mcmegu, and spriegu are functions that process DCS data and produce randomly positioned 1-D data suitable for use with llcontr. tovscdf also produces randomly positioned data, but at fixed multiple elevations. Variables output by tovscdf must be burst before they can be contoured using llcontr. See burst.

The metafile generated by llcontr can be overlaid on any image registered to the specified master_file.

PARAMETERS

master_file

This is the filename of the master dataset. The earth location transform of the master dataset is used to convert latitude and longitude coordinates to master (line,sample) coordinates during the metafile-generation process.

Valid responses are any TeraScan dataset that contains an earth transform. The default is Master.

grid_units

This specifies the units for the grid_spacing and search_radius parameters. Valid responses are [pixels, km]. The default is pixels (i.e., master dataset pixels).

grid_spacing

The first step in the contouring process is to interpolate the randomly positioned data onto an evenly spaced grid, relative to the master dataset. grid_spacing determines the number of lines and samples between each grid node of the rectangular grid. See NOTES.

The density of grid nodes should be consistent with the density of the random data and therefore should be chosen with care. A good rule of thumb is to choose grid_spacing to be num_lines/sqrt( the number of random data points ) or num_samples/sqrt( the number of random data points ), where num_lines and num_samples are described in the section on master. The number of random data points can be obtained by running contents on the input TeraScan dataset.

The valid range is [>= 0]. The default is 50. If zero is entered, then grid_spacing is automatically computed according to the above rule.

search_radius

The function searches out to a distance of search_radius looking for random values to include in the grid node estimation. This prevents distant points from influencing the grid node estimation. Depending on the grid_units parameter, this distance is specified in either in master dataset pixel units or in kilometers. Points farther away than search_radius will not be used in the grid node estimation. As a general rule, small values of search_radius will leave undefined regions in the contour drawing, if randomly positioned data are not near by. Large values will ensure that each grid node is estimated, but the estimate will be influenced by points far from the grid node.

The valid range is [>= 1]. The default is the value entered for grid_spacing, except when grid_spacing=0. In that case, where grid_spacing is automatically computed, then search_radius is automatically set to 2*grid_spacing.

wt_power

This is the exponent in a one-over-distance raised to a power weighting function. The weights are ((search_radius - distance_to_the_grid_node)/search_radius)**wt_power. A weighted average is formed by dividing the sum of the weighted points by the sum of all the weights.

If a negative power is entered, nearest neighbor within search radius will be used instead of weighted average.

Valid responses are [-1, 0, 1, 2, 3, 4]. The default is 2.

z_variable

Variable to be contoured. This must be either a variable with corresponding parallel latitude and longitude variables, or a 2-D variable with an earth transform. There is no default.

iso_values

This is the list of levels to contour. No more than 30 levels can be contoured at once. If a single non-zero value is entered, the value is assumed to be the contouring interval and the iso_values are computed. To contour a single level, enter the value twice. If 0 is entered for iso_values, llcontr estimates the contour levels. The function performs this task by first selecting a contour interval of 1, 2, or 5 times a power of ten. Given this contour interval, the contour levels are estimated. Note: Lists of computed iso_values will not exceed 30 values.

For example, assume data with values between 1 and 10. 1 2 3 generates contours for the values 1, 2, and 3. 2 2 generates contours for the value 2. 2 generates contours for the integer values 2, 4, 6, 8, and 10. 0 generates contours of 1, 2, 3, 4 ..., 10.

Valid responses are [ 0, a number, or a vector of numbers ]. The default is 0.

sub_divs

OPTIONAL. This is the number of contouring subdivisions per grid square. It must be a power of two. This parameter is used to prevent contours from overlapping.

Valid responses are [1, 2, 4, 8]. The default is 2.

num_arcs

OPTIONAL. This is the number of arcs in the contour segment that passes through a grid square. If num_arcs=1, straight lines are drawn through the grid squares. Larger values produce curved lines.

Valid responses are [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]. The default is 3.

text_height

OPTIONAL. This is the height of contour labels in units of master dataset pixels. Assuming that the master dataset is normally displayed at full resolution, a text height of 25 pixels results in ~1/4 inch text on a 16-inch graphics display. The valid range is [>= 1]. The default is 16.

EXAMPLES

Generate a TeraScan metafile datasets containing the contours of the 1 dimensional dataset described in import1d.

[1] % llcontr
in/out files   : char(255) ? input1d  llcontr.meta
master_file    : char(255) ? [Master]
grid_units     : char(  6) ? [pixels]
grid_spacing   : real      ? [50]
search_radius  : real      ? [50]
wt_power       : int       ? [2]
z_variable     : char( 31) ? temperature
iso_values     : real( 30) ? [0]

SEE ALSO

burst, llcontr, master, etx

NOTES

grid_spacing determines the number of lines and samples between each grid node of the rectangular grid as follows:

if grid_units=km then
  line_spacing = nint(grid_spacing/average_pixel_height)
  samp_spacing = nint(grid_spacing/average_pixel_width )
else
  line_spacing = nint(grid_spacing)
  samp_spacing = nint(grid_spacing)
endif

num_grid_rows = 1 + (num_master_lines -1)/line_spacing
num_grid_cols = 1 + (num_master_samps -1)/samp_spacing

real_line_spacing = (num_master_lines -1.)/(num_grid_rows -1.)
real_samp_spacing = (num_master_samps -1.)/(num_grid_cols -1.)

The first grid row coincides with the first master dataset line; the last grid row coincides with the last master dataset line. Similarly, the first grid column coincides with the first master dataset sample; the last grid column coincides with the last master dataset sample.

The grid is computed to fit the master area exactly, and typically, the real line and sample grid spacing is slightly less than what was specified.


Last Update: $Date: 1998/05/29 18:33:12 $