IMGFILT

Formats

Parameters

sdataset

source ADDE dataset name and position; specify one of the following formats:

group/descriptor.position

alias.position

a position greater than zero represents an absolute position in the dataset; a position less than or equal to zero represents a relative position in the dataset based on image time, for example, 0 is the most recent and -1 is the next most recent; to use the default position, do not specify .position; specify two source datasets only if using FILTER=CLOUD, CORE, DIS or MERGE (no default for group/descriptor or alias; default=0 for position)

ddataset

destination ADDE dataset name and absolute position; specify one of the following formats:

Image Positioning Keywords

latitude and longitude of the sdataset image to place at the ddataset image location specified in the PLACE keyword

LINele=

line ele sys

line

line number of the sdataset image to place at the ddataset image location specified in the PLACE keyword (default=0)

ele

element number of the sdataset image to place at the ddataset image location specified in the PLACE keyword (default=line)

sys

coordinate system of the line and ele values; specify either F for file (area) coordinates or I for image coordinates (default=F)

PLAce=

location in the ddataset image to place the point specified in the LATLON, STATION or LINELE keyword

ULEFT

upper-left corner of the image (default when the LINELE keyword is used)

CENTER

center of the image (default when the LATLON or STATION keyword is used)

STAtion=

station ID to place at the ddataset image location specified in the PLACE keyword; specify as the ID, e.g., KMSN or YSSY, optionally followed by the station type in brackets, e.g., ARX[N] or ARX[V]; see the TYPE keyword in the STNLIST command for valid station types

Output Keywords

BANd=

b1 b2

bands in the source image to filter; specify b2 only if using FILTER=CLOUD, CORE, DIS or MERGE (b1 default=existing band for single-band images; no b1 default for multiband images; b2 default=b1)

CF=

YES

creates a CF-compliant
netCDF file (default)

NO

creates a netCDF
file in the previous (pre-2009.2) format, which is not CF-compliant; the
CF=YES/NO keyword is valid only when writing to netCDF format destination
datasets; it is ignored when writing to datasets of other formats

ID=

selects from sdataset images with the specified NEXRAD station ID, e.g., MKX

MAG=

lmag emag

line and element magnification of the data; use a positive integer for blowup and a negative integer for blowdown (default=1 lmag)

NAVtype=

RECT

remaps MODIS imagery into a rectilinear projection and
applies a bowtie correction using MRTSwath (MODIS
Reprojection Tool - Swath, package courtesy of the U.S.
Geological Survey); use this keyword only when the source
image is MODIS Level 1B or Level 2 data on a remote
server with the MRTSwath package installed; this keyword
is ignored if used with any other type of data

PROd=

product name for destination image, up to four characters (default=PRD)

number of lines and elements of the sdataset image to copy (default=480 640)

ALL

copies the entire sdataset image including all bands and the documentation section

TAIl=

lo hi

tail percentage after filtering (default=0 0)

TRACKing=

YES

tracks image if allowed by the server; tracking allows commands
to receive data as it's being ingested by the server; commands complete when their data request has been fulfilled; tracking
is only supported on some servers (e.g., Area, GVAR and MTSAT) and it can be disabled by the server administrator

NO

does not track image so server only sends data that is
currently available (default=value of MCTRACK environment variable; if MCTRACK is not set, default=value set by server
or server administrator)

UNIt=

calibration units for output (default=BRIT)

WL=

l1 l2

filters source image bands with image wavelengths closest to those specified in l1 and l2; valid only with high spectral resolution data, e.g., Aqua AIRS; specify l2 only if using FILTER=CLOUD, CORE, DIS or MERGE (no default for l1; l2 default=l1)

WN=

n1 n2

filters source image bands with image wave numbers closest to those specified in n1 and n2; valid only with high spectral resolution data, e.g., Aqua AIRS; specify n2 only if using FILTER=CLOUD, CORE, DIS or MERGE (no default for n1; n2 default=n1)

Filter and Stretch Keywords

FILter=

filter used to generate the destination image; see the Remarks for more details

CLEAN

replace bline eline pdiff ldiff

CLOUD

replace constant

CORE

brkpnt1 brkpnt2 replace1 replace2

DIS

brkpnt1 brkpnt2 brkpnt3 brkpnt4 replace

GRAD

HIGH1

distance efficiency

HIGH2

HOLE

brkpnt1 brkpnt2

LOW1

distance efficiency

LOW2

lcoef ecoef

MERGE

brkpnt1 brkpnt2 constant

REPLACE

outval bline eline belem eelem inval1..invaln

SHOT

bline eline pdiff

SPOT

omcon oacon imcon iacon cmin cmax DISt= TARget=

STRetch=

applies a stretch to sdataset's brightness values

CONT

contrast stretch (default)

HIST

bin

histogram stretch; increment, or bin width (default=16)

Remarks

IMGFILT generates a new image by applying a filter to data from a source image or images. The CLOUD, CORE, DIS and MERGE filters use two source datasets; all other filters use only one.

All filters are applied to each element of an image line. The CLEAN filter is also applied to each line in the image. The HIGH2 and LOW2 filters are applied to each element, but use surrounding lines and elements in their calculations.

The IMGFILT command automatically applies a contrast stretch to images after the filter process. The range of the stretch is specified with the SCALE keyword. Product values outside the range are set to zero. If no values are supplied, the minimum to maximum product values are stretched from 0 to 255. The tail percentages specified with the TAIL keyword clip the ddataset minimum and maximum data values before the stretch. Use this option to sharpen an image.

The ddataset has a generated product source type, PRD, and a 1-byte data calibration type, BRIT. Elements of the ddataset are in brightness units. The image file's calibration allows you display native product values by specifying the native units in the IMGPROBE command.

Use IMGOPER to perform arithmetic operations on individual image elements.

You can use IMGFILT to create a netCDF image file. To do so, the destination dataset must be NCDF-format and IMAGE-type. See the Remarks section in the DSSERVE command for more information.

Each option for the FILTER keyword is described below. Positional parameters and the equation used by the filter to generate the destination image are listed. Defaults for the filters are based on brightness (UNIT=BRIT).

CLEAN

This option cleans an image by first applying a shot noise filter to each element in the source image, and then locating and replacing bad lines. Each element is compared to the elements on either side and replaced if the values are significantly different. The average value of each line is then compared to the lines above and below and replaced if it is significantly different.

Positional parameters:

replace

AVE

average of surrounding values (default)

MIN

sdataset minimum value

MAX

sdataset maximum value

bline

beginning line in the source image to clean (default=first line)

eline

ending line in the source image to clean (default=last line)

pdiff

absolute difference between an element's value and the value of the element on either side (default=15)

ldiff

percentage difference between a line's average value and the average value of the line above and below (default=15)

Equation for each ddataset element:

if (the difference between the sdataset and the surrounding elements is < pdiff)
then ddataset = sdataset
else ddatset = replace

Equation for each ddataset line:

if (the difference between sdataset line average and the surrounding lines is < ldiff) and (deviation of element values on the sdataset line is > 0)
then ddataset = sdataset
else ddataset = replace

CLOUD

This option applies a cloud filter to an image by comparing each element to the elements of another image. Use this filter to mask off a portion of the first source image.

GRAD

This option applies a gradient filter to the source image.

Equation for each ddataset element:

ddataset = ABSOLUTE(sdatasetn - (sdatasetn+1) )

HIGH1

This option applies a one-dimensional high-pass filter to each element in the source image. It eliminates low-frequency deviations by clustering them around the distribution's midpoint. A sample average is determined using values on either side of the source element and the percentage of filter efficiency.

Positional parameters:

distance

sample length surrounding the source element; used for sample average (default=50)

efficiency

filter efficiency (default=100)

Equation for each ddataset element:

ddataset = (sdataset - (sample average) + (sample midpoint))

HIGH2

This option applies a two-dimensional high-pass filter to each element in the source image. It eliminates low-frequency deviations by clustering them around the distribution's midpoint. A sample average is calculated by the program using values in a two-dimensional region around the source element.

Equation for each dataset element:

ddataset = (sdataset - (sample average) + (sample midpoint))

HOLE

This option searches for missing data and fills the holes in the image using the average of the surrounding element values.

LOW1

This option applies a one-dimensional low-pass filter to each element of the source image. It eliminates high-frequency deviations by replacing the source image data values with the average of the values on either side of the source element. The sample average is determined using the percentage of filter efficiency.

Positional parameters:

distance

sample length in pixels surrounding the source element; used for sample average (default=50)

efficiency

filter efficiency (default=100)

Equation for each ddataset element:

ddataset = (sample average)

LOW2

This option applies a two-dimensional low-pass filter to each element in the source image. It eliminates high-frequency deviations by replacing the source image data values with the average of the values in the sample defined with the line and element coefficients.

Positional parameters:

lcoef

line coefficient; 0.0 < lcoef < 1.0 (default=0.5)

ecoef

element coefficient; 0.0 < ecoef < 1.0 (default=lcoef)

Equation for each ddataset element:

ddataset = (sample average)

MERGE

This option merges two images by selecting the sdataset1 value for each element if its value is between the specified breakpoints. Otherwise it selects the sdataset2 value minus the specified constant.

if sdataset lies outside the region defined by the line and element ranges, or its value is not in inval1..invalN
then ddataset = sdataset
else ddataset = outval

SHOT

This option cleans an image by applying a shot noise filter to each element in the source image. Each element is compared to the elements on either side and replaced if the values are significantly different.

Positional parameters:

bline

beginning line in the source image to clean (default=first line)

eline

ending line in the source image to clean (default=last line)

pdiff

maximum percentage of the product range specified in the SCALE keyword to allow before a new value for the pixel is derived using the average of two adjacent pixels (default=15)

Equation for each ddataset element:

if the difference between sdataset and the surrounding elements is < pdiff
then ddataset = sdataset
else dataset = (average of the surrounding sdataset element values)

SPOT

This option illuminates or darkens one or more spots on an image. The locations and sizes of the spots are determined by the TARGET and DIST keywords.

Positional parameters:

omcon

value by which to multiply elements located outside the spots defined by the TARGET and DIST keywords (default=0.0)

oacon

value to add to elements located outside the spots defined by the TARGET and DIST keywords (default=0.0)

imcon

value by which to multiply elements located inside the spots defined by the TARGET and DIST keywords (default=1.0)

iacon

value to add to elements located inside the spots defined by the TARGET and DIST keywords (default=0.0)

cmin

conditional minimum for values located inside the spots defined by the TARGET and DIST keywords; values less than cmin are treated as if they are outside the spots (default=no minimum)

cmax

conditional maximum for values located inside the spots defined by the TARGET and DIST keywords; values greater than cmax are treated as if they are outside the spots (default=no maximum)

radial distance(s) from the target(s); the distance value(s) determine the size of the spot(s); run CU LIST to list valid units (default=0[KM] for first value; last specified value for all subsequent values)

city, where st and co are the two-letter state and country codes for the city, e.g., 'MADISON,WI,US' or 'TORONTO,,CA'

Examples

IMGFILT GOES7/VIS.1 LOCAL/AREA.1

This entry applies a contrast stretch to the brightness data in the image in position 1 of dataset GOES7/VIS. The resulting image is placed in position 1 of dataset LOCAL/AREA.

IMGFILT BLIZZARD/G7-IR-4K.2 BLIZZARD/CLEAN.2 FILTER=CLEAN STATION=DCA

This entry applies clean and shot noise filters and contrast stretch to the image in position 2 of dataset BLIZZARD/G7-IR-4K. The resulting image is placed in position 2 of dataset BLIZZARD/CLEAN. The destination image is 480 lines by 640 elements and centered over Washington, DC.

IMGFILT COMPOSITE/MOSAIC LOCAL/MOSAIC.1 FILTER=HOLE 0 1 LATLON=-90 0

This entry applies a hole filter to the most recent image in dataset COMPOSITE/MOSAIC. The resulting image is placed in position 1 of dataset LOCAL/MOSAIC. The filter averages elements that have brightness values between 0 and 1 (inclusive) to fill holes and gaps in the data. The destination image is 480 lines by 640 elements and centered over the South Pole.

IMGFILT A/A.8101 A/A.4000 FILTER=REPLACE 119 2001 2209 3362 3726

This entry replaces the brightness values in a region of the image in position 8101 of dataset A/A. The brightness values between image lines 2001 and 2209 and elements 3362 and 3726 are replaced with a new brightness value of 119. The resulting image is 480 lines by 640 elements. It is placed in position 4000 of dataset A/A.

This entry applies a two-dimensional low pass filter and histogram stretch to the band 3 temperature data in the most recent image in dataset GOES9/IR. The resulting 600 line by 600 element image is placed in position 4001 of dataset A/A, has the product name LO-2, and is centered over Kirksville, MO.

This entry applies a spot filter to band 1 of the most recent image in dataset EASTS/CONUS. The resulting image is centered on Chicago, blown down by a factor of 3 in the line direction and 6 in the element direction, and is placed in position 1 of dataset LOCAL/AREA. The filter sets the brightness values of pixels outside the spots defined by the TARGET and DIST keywords to 50% of their original values, and pixels inside the spots to 125% of their original values. In this case, the spots show the 124 nautical mile coverage of the NEXRAD "short range" (S Rng) reflectivity products for NEXRAD stations BIS, OAX, TLX, MKX, LSX, MRX, PBZ and RAX.