DATAMANIP commands


PROGRAM NAME

kpad - Pad Data with a Constant Value

DESCRIPTION

Pad Object (kpad) performs the padding of a data object using the pad values defined by the Real and Imaginary padding value options.

Size The output data object will be the size specified by the final padded size parameters, Padded Width, Padded Height, etc (wsize, hsize, dsize, tsize, esize).

Offset Values The offset parameters (woff, hoff, doff, toff, eoff) define where the origin of the source object will lie with respect to the output object. Specifying an offset greater than zero can be used to generate a border around the original data. Negative offset values will result in truncation of data lying in the region (0-woff, 0-hoff, 0-doff, 0-toff, 0-eoff). For example, if an offset of (-1,-1,0,0,0) is specified, the object will effectively be shifted by -1 in the width and height dimensions, and that data truncated in the destination object. If the offset plus the original data size is greater than the specified destination size, truncation of the source data will occur. If the input object is larger than the final padded size specified, the output data object will be truncated to the specified size.

Pad Values The Real Pad Value (real) specifies the pad value that will be assigned to the real component of a complex pair, and the Imaginary Pad Value (imag) specifies the imaginary component of the pair. If the input data object type is not complex, the imaginary pad value will be ignored. For input data objects that are not of type double, the specified pad values are cast to the same type as the input data object.

Wrapping The regions outside the original data bounds can be filled also by wrapping data from the opposite side of the dataset by specifying the Wrap flag. This will override the Pad Value functionality.

Mask Data & Validity Option The validity mask corresponding to padded data will be zero if the user specifies that padded data added by this program be marked as invalid (valid FALSE). Likewise, if the user specifies that padded data is valid (valid TRUE), the mask corresponding to padded data will be non-zero. In the first case (invalid), if no mask exists in the source object, on will be created. In the valid case, no mask will be created. Validity mask data corresponding to the original source object data is transferred to the destination unaltered.

Location & Time Data If curvilinear or rectilinear time or location data exist, it is unclear how to alter the dimensionality, so the pad operation will fail. If uniform location data exist padding occurs, but the location information is not altered in any way.

Map Data The pad operator does not modify map data.

Failure Modes The input object must contain value or mask data.

REQUIRED ARGUMENTS

-i
type: infile
desc: Input data file
-o
type: outfile
desc: Resulting output file

OPTIONAL ARGUMENTS

-wsize
type: integer
desc: Size of width dimension after padding
default: 512
bounds: value > 0
-hsize
type: integer
desc: Size of height dimension after padding
default: 512
bounds: value > 0
-dsize
type: integer
desc: Size of depth dimension after padding
default: 1
bounds: value > 0
-tsize
type: integer
desc: Size of time dimension after padding
default: 1
bounds: value > 0
-esize
type: integer
desc: Size of element dimension after padding
default: 1
bounds: value > 0
-woff
type: integer
desc: Offset of original object in width dimension
default: 0
bounds: no range checking
-hoff
type: integer
desc: Offset of original object in height dimension
default: 0
bounds: no range checking
-doff
type: integer
desc: Offset of original object in depth dimension
default: 0
bounds: no range checking
-toff
type: integer
desc: Offset of original object in time dimension
default: 0
bounds: no range checking
-eoff
type: integer
desc: Offset of original object in elements dimension
default: 0
bounds: no range checking
-real
type: double
desc: Real part of pad constant
default: 0
bounds: no range checking
-imag
type: double
desc: Imaginary part of pad constant
default: 0
bounds: no range checking
-wrap
type: flag
desc: fill outside data regions by WRAPPING
-valid
type: boolean
desc: Identify data added by kpad as valid/invalid in mask
default: true

EXAMPLES

kpad -i input_file -o output_file- Pad Data with a Constant Value
Will create a zero padded output object, using the default size and zero offset.

kpad -i input_file -o output_file -wsize 512 -hsize 256 -real 200 -imag 100- Pad Data with a Constant Value
This padding operation will produce an output object with a width of 512 and height of 256. If the input data is complex, padding for the real component will be 200, and 100 for the imaginary component. If the data is not complex, the imaginary value is ignored.

SEE ALSO

RESTRICTIONS

kpad will fail if the source object contains curvilinear or rectilinear location or time data. If uniform time or location data exist, it is transferred, but not modified.

REFERENCES

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.