fastreg [ parameter=value ... ] [ inputfile outputfile ] fastreg [ parameter=value ... ] [ inputfile ... directory ] fastreg2 [ parameter=value ... ] [ inputfile outputfile ] fastreg2 [ parameter=value ... ] [ inputfile ... directory ]
Parameters for fastreg are: master_file, include_vars, poly_size, max_memory, split_aspect.
Parameters for fastreg2 are: master_file, master_var, include_vars, brute_force, poly_size, interpolate, min_good, off_protect, whole_input, add_to_output, add_method, max_memory, split_aspect, sensor_resol.
fastreg and fastreg2 register variables from input datasets to a user-defined base map and projection (meaning a master dataset - see master). For each input dataset, a corresponding output dataset is created to hold the re-mapped variables.
Registration can be applied to any earth locatable 2- or 3-D variables with Y and X coordinate dimensions (e.g., line and sample). All output registered variables will have the same Y and X dimensions, i.e., the line and sample dimension from the master dataset, regardless of their input resolutions.
fastreg does not support any special features for encountering missing (bad) data or change in pixel resolution during registration. However, functions such as magnify or smear can be run prior to registration using fastreg. See magnify and smear.
fastreg2 supports similar magnification and shrinking strategies to those supported by magnify: nearest neighbor, nearest good neighbor, bilinear interpolation, and cubic convolution. Bilinear interpolation within a given rectangle requires at least 3 good corner values, or else the result is missing (bad). Cubic convolution is essentially a 3x3 boxcar average, though a minimum number of good values other than 9 can be specified.
Using fastreg2 with the nearest neighbor strategy is the same as running fastreg.
Registration is defined by the following process:
For each variable V in the output dataset (and corresponding variable V' in the input dataset) For each pixel V(Y,X) (Y = line, X = sample) Compute the corresponding latitude and longitude Compute the corresponding real coords (Y',X') of V' If the (Y',X') cannot be computed or is outside the dimensions of V' Set V(Y,X) = bad value of V' Else Set V(Y,X) = F(V',Y',X'), where F is either nearest neighbor, nearest good neighbor, bilinear interpolation or cubic convolution.
fastreg and fastreg2 speed up the registration process by using piecewise polynomial interpolation. The output dataset is divided up into nearly square regions of size poly_size (see diagram below), each of which is covered by its own pair of biquadratic polynomials:
Tl(output line, sample) = input line Ts(output line, sample) = input sample
where Tl and Ts represent biquadratic functions (bivariate polynomials of order 2 with 9 coefficients), which are based on the 9 line and sample pairs from the input and output datasets. Line and sample from the output dataset are always integers while input line and sample values are computed as real numbers.
| poly size | poly size | ---#--------#--------#--------#--------#-- | | | | | | poly | | | poly size # # # # # size | | | | | | | | | ---#--------#--------#--------#--------#-- | | | | | | | | | # # # # # | | | | | | | | | #--------#--------#--------#--------#
Diagram Description: A uniform output dataset is shown here. The borders of the four boxes of size poly_size are highlighted by lines and the 9 output dataset points used to compute the Tl and Ts polynomials are marked with symbols on each box.
The error induced by using piecewise polynomial interpolation was found to be less than .15 kilometers for AVHRR data when poly_size was set to 100 kilometers.
When the option brute_force=yes, fastreg2 does not use the above approach with polynomials. Instead, fastreg2 directly computes (latitude, longitude) and corresponding input (line, sample) for every output pixel. This can be extremely slow.
Normally, fastreg and fastreg2 attempt to use no more memory than is specified by the max_memory parameter. However, this is not the case with fastreg2 when either brute_force=yes or whole_input=yes. In these cases, entire input variables are read into memory during registration. See NOTES for instances when it may be advisable to use brute_force=yes or whole_input=yes.
fastreg2 has an option to register input variables into an existing output dataset. Normally, both fastreg and fastreg2 create a new output dataset for every input dataset. However, if exactly one input dataset and one output dataset is specified, and the output dataset exists and is not a directory, fastreg2 checks its add_to_output parameter.
Registering into an existing output dataset is similar to compositing two output datasets registered to the same master file using composite. See composite. The following compositing methods are supported by fastreg2: last, first, max, min, mean. Here, last refers to the newly registered values; first refers to the previously existing output values.
last - if last is good, use it, else use first first - if first is good, use it, else use last max - if only one is good, use it, else use max min - if only one is good, use it, else use min mean - if only one is good, use it, else use mean
Any output area not covered by the input is not affected.
Enter the name of the master dataset. Each input dataset is interpolated onto a geographical region defined by this dataset.
Valid responses are any TeraScan dataset containing an earth transform. The default is [Master].
The variables to register. If the list is preceded by a hyphen, then the variables in the list are excluded from the output dataset, and all other variables in the input files are included.
Valid responses are any variable names in the input files, properly delimited (space or comma). The default is to include all variables.
Specify the width of the square regions that the output dataset is divided into. The units of poly_size are kilometers.
Valid range is [10 to 200]. The default is 100.
This parameter determines the method of interpolation to be used by fastreg2. Choices are nn (nearest neighbor), ngn (nearest good neighbor, bl (bilinear interpolation), and cc ( (cubic convolution). The default is nn.
When interpolate=cc (cubic convolution), this parameter specifies the least number of good values needed to compute the boxcar average. The value must be between 1 and 9. The default value is 5.
Use off_protect=no if the image has no Earth edges inside the master dataset. This assumption allows to reduce the computational time required for registration. Use off_protect=yes if there are points in the master dataset that are off the Earth.
Valid answers are yes or no. The default answer is no.
Register the TeraScan dataset named big to the master_file named Master. If there is not enough memory to process each data channel in one pass, the dataset is processed in pieces as shown below.
[1] % fastreg big big.reg master_file : char(75) ? [Master] poly_size : real ? [100] big.reg: avhrr_ch1: [ 1, 1024] X [ 1, 512] big.reg: avhrr_ch1: [ 1, 1024] X [ 513, 1024] big.reg: avhrr_ch2: [ 1, 1024] X [ 1, 512] big.reg: avhrr_ch2: [ 1, 1024] X [ 513, 1024] big.reg: avhrr_ch3: [ 1, 1024] X [ 1, 512] big.reg: avhrr_ch3: [ 1, 1024] X [ 513, 1024] big.reg: avhrr_ch4: [ 1, 1024] X [ 1, 512] big.reg: avhrr_ch4: [ 1, 1024] X [ 513, 1024] big.reg: avhrr_ch5: [ 1, 1024] X [ 1, 512] big.reg: avhrr_ch5: [ 1, 1024] X [ 513, 1024]
master, magnify, smear, avhrr, datasets, etx.
To test the accuracy of using piecewise polynomials as opposed to direct calculations, one can run fastreg2 using brute_force=no, then run it again with brute_force=yes, and then compare the two output datasets using tsdiff. See tsdiff.
When rectangles of input data are highly non-convex in the master dataset coordinate system, fastreg and fastreg2 have been known to fail, leaving small slivers of missing data in the output. (For example, this may occur when registering a Mercator input image to an oblique stereographic master.) Often, this failure can be corrected by trying whole_input=yes, or brute_force=yes. There is a small performance degradation using whole_input=yes. There is a huge performance degradation using brute_force=yes.
Last Update: $Date: 1999/03/03 14:06:45 $