MGH_BYTSCL Name
MGH_BYTSCL Purpose
This function, like the standard IDL BYTSCL routine, converts
numeric values to byte values. It is more flexible than BYTSCL in
two respects:
- It allows one to specify the lower limit of the range of byte
values as well as the upper limit.
- It allows the mapping to be inverted, ie. large numeric values
mapping to small byte values.
Calling Sequence
result = MGH_BYTSCL(data)
Positional Parameters
data (input, numeric scalar or array)
Data values to be scaled. Keyword Parameters
BYTE_RANGE (input, 2-element byte vector)
This keyword specifies the range of byte values to which the
data range is to be mapped. Default is [0B,255B]
DATA_RANGE (input, 2-element numeric vector)
The range of data values to be mapped onto the byte range. Data
values outside the range are mapped to the nearest end of the
range. If not specified, DATA_RANGE is calculated from the
maximum and minimum of data.
MISSING (input, byte scalar)
Output value for missing data. Default is 0B.
NAN (input, logical)
This keyword controls whether IEEE NaN values are treated as
missing, in which case they are mapped to the MISSING value. The
default is one--which differs from BYTSCL's default of zero--so
the keyword must be explicitly set to zero to disable NaN processing.
Return Value
The function returns a byte array with the same shape as the input.
###########################################################################
This software is provided subject to the following conditions:
1. NIWA makes no representations or warranties regarding the
accuracy of the software, the use to which the software may
be put or the results to be obtained from the use of the
software. Accordingly NIWA accepts no liability for any loss
or damage (whether direct of indirect) incurred by any person
through the use of or reliance on the software.
2. NIWA is to be acknowledged as the original author of the
software where the software is used or presented in any form.
###########################################################################
Modification History
Mark Hadfield, 1993-04:
Written.
Mark Hadfield, 1996-07:
Added BOTTOM, NAN and MISSING keywords.
Mark Hadfield, 2000-05:
IDL2 syntax.
Mark Hadfield, 2001-11:
Changed keyword names to bring them into line with other routines.