rescale
R = rescale(A, a=0.0, b=1.0; inputmin=nothing, inputmax=nothing, stretch=false, type=nothing)
A
: is either a GMTgrid, GMTimage, Matrix{AbstractArray} or a file name. In later case the file is read with a call to gmtread that automatically decides how to read it based on the file extension ... not 100% safe.
rescale(A)
rescales all entries of an arrayA
to [0,1].
rescale(A,b,c)
rescales all entries of A to the interval [b,c].
rescale(..., inputmin=imin)
sets the lower boundimin
for the input range. Input values less thanimin
will be replaced withimin
. The default is min(A).
rescale(..., inputmax=imax)
sets the lower boundimax
for the input range. Input values greater thanimax
will be replaced withimax
. The default is max(A).
rescale(..., stretch=true)
automatically determines [inputmin inputmax] via a call to histogram that will (try to) find good limits for histogram stretching. The formstretch=(imin,imax)
allows specifying the input limits directly.
type
: Converts the scaled array to this data type. Valid options are all Unsigned types (e.g.UInt8
). Default returns the same data type asA
if it's an AbstractFloat, or Flot64 ifA
is an integer.
Returns
A GMTgrid if A
is a GMTgrid of floats, a GMTimage if A
is a GMTimage and type
is used or an array of Float32|64 otherwise.
See Also
imagescThese docs were autogenerated using GMT: v1.11.0