USGS

Isis 2 Documentation


makeflat Documentation

makeflat - Creates a flat-field image from a set of input images
"makeflat" will create a flat-field image from a set of input images.
The names of the cube files used to create the flat-field image
must be entered using an ASCII file (FROMLIST) with one filename per
line (any line beginning with a ! will be treated as a comment).  The
flat-field image is created in a 2-step process.  The first process
computes the mode or median of each image file and divides each
pixel value in the file by the mode or median to create an average
image.  The STATVAL parameter determines whether the mode or median will
be used.  Next, each pixel in the average image is checked to see if it
falls between the range of values specified by TESTLO1 and TESTHI1.  If
the average pixel value is within this range, it is used in
accumulating sum and count arrays.  When all the pixels in all the
images have been processed, a first-iteration flat-field image is
calculated by dividing the sum array by the count array.

The second process or iteration divides each original input image by
the 1st iteration flat-field image created in process 1.  The mode or
median is then calculated for this output image.  Next, each pixel
value used to calculate the mode or median above is divided by the
mode or median and compared to TESTLO2 and TESTHI2.  If the value is
good, a sum and count array is calculated using the values from the
original input image divided by the mode or median.  Once again, when
all the input images have been processed, the final flat-field image
is computed by dividing the sum array by the count array.  The last
step is to produce a normalized flat-field image by determining the
average of this last flat-field image and dividing each pixel value
in the image by the average.

If the user wishes to input a flat-field image and not calculate
one in the first iteration described above, they may do so by
entering the flat-field image name in AVGFILE and setting ACTION
to 2ND.  If ACTION = ALL, then both iterations described above
will be done.

PROGRAMMER: Jim Mathews

ParmDescriptionDefault
FROM
Input Cube (multi-band)
--
FROMLIST
List of input cube file names
  (No default extension)
--
TO
Output cube file name
 (Default extension is .cub)
NONE
AVGFILE
User input flat-field cube
  file name
--
ACTION
Desired action in the program
  ALL or 2ND
"ALL"
STATVAL
Statistical data value to use
MEDIAN or MODE
"MEDIAN"
TESTLO1
Low test value for ratio of DN
  to MODE or MEDIAN for 1st pass
0.8
TESTHI1
High test value for ratio of DN
  to MODE or MEDIAN for 1st pass
1.2
TESTLO2
Low test value for ratio of DN
  to MODE or MEDIAN for 2nd pass
0.9
TESTHI2
High test value for ratio of DN
  to MODE or MEDIAN for 2nd pass
1.1
USERNOTE
User comment
" "

ADDITIONAL NOTES:

ParmDescription
FROMLIST
File containing the list of image cube file names used to
create the flat-field image.  Enter the file names one per
line and include the entire file name with any extensions
(.cub is not assumed).  Any line beginning with an ! will be
treated as a comment and not read.  A maximum of 4096 images
may be listed.
TO
Output cube file name.  If the file extension is omitted,
then ".cub" will be assumed.
AVGFILE
Name of the flat-field image cube file.  Used only when
ACTION = 2ND.
ACTION
The desired action of the program.  "ALL" will run both
iterations of the program and no AVGFILE needs to be
entered.  "2ND" will run only the second iteration of the
program and the user must enter a flat-field image file in
AVGFILE that matches the dimensions of the input image
files.
STATVAL
Determines which statistical value of the data to use for
image normalization.  For most cases, the "MODE" gives a
better representation of data distribution than does the
"MEDIAN".  The "MODE" is defined as the value at the peak
of the data distribution curve (maximum frequency).
"MEDIAN" is the value in the center of the distribution
curve.
TESTLO1
The low value to test to see if the ratio of DN value and
mode or median is a good value.  All values between TESTLO1
and TESTHI1 will be considered good.  This is used when
ACTION = "ALL".
TESTHI1
The high value to test to see if the ratio of DN value and
mode or median is a good value.  All values between TESTLO1
and TESTHI1 will be considered good.  This is used when
ACTION = "ALL".
TESTLO2
The low value to test to see if the ratio of DN value and
mode or median is a good value.  All values between TESTLO2
and TESTHI2 will be considered good.  This is used when
ACTION = "ALL" or "2ND".
TESTHI2
The high value to test to see if the ratio of DN value and
mode or median is a good value.  All values between TESTLO2
and TESTHI2 will be considered good.  This is used when
ACTION = "ALL" or "2ND".
USERNOTE
Comment from the user.  This will be recorded in the ISIS
session log file and also in the History entry that is put
into the History object of the output file.

Last updated: Jan 31 2005
File: pdfs2.html

Contact us online at the Isis Support Center: http://isisdist.wr.usgs.gov

ISIS Documentation Home Page