Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


Harris Geospatial / Docs Center / Libraries / Mankoff / KDM_RANGE

KDM_RANGE

KDM_RANGE

Name


KDM_RANGE

Purpose


  This function converts a variable or array from one scale to
  another. The input data is assumed to be on the scale
  [min(data),max(data)] although this can be customized. It is
  converted to a new scale of the range
  [rangemin,rangemax]. Overflow and underflow can be customized.

Category


Data massaging

Calling Sequence


result = KDM_RANGE( data, from, to )

Inputs


DATA This is your input data set, either a single number or
multi-dimensional array
  FROM: A 2 element array specifying the [min,max] input range of DATA
  TO: A 2 element array specifying the desired output range of DATA

Keyword Parameters


  UNDERFLOW: This is value to set data points that convert to less
              than RANGEMIN
  OVERFLOW: This is value to set data points that convert to more
            than RANGEMAX

Outputs


  This function returns the input array (data) scaled from FROM to TO

Restrictions


  Output is always float.

Procedure


  Scale the input data to [0,1], then multiply by the desired
  [minrange,maxrange]

Example


  data = [-1, 0, 0.1, 1]
  ; scale data to [0,100]
  print, kdm_range( data, from=minmax(data), to=[0,100] )
  ; -1 goes to 0, 1 goes to 100, and everything else betwixt...
  ; scale data to [-1,0] output, but force the data input range to
  ; [0,1]. Underflow (the -1 input value) should be set to -999
  print, kdm_range( data,from=[-1,1],to=[-1, 0], datamin=0, underflow=-999 )

Modification History


  Written by: Ken Mankoff, 2007-05.
2007-07-17: KDM. Re-wrote to use from and to arrays



© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us