%N imscale %F $MIR/src/subs/tvsubs.for
%D Autoscale a map.
%P jm
%: image-data, utilities
%B
      subroutine imscale(map, Mx, Nx, Ny, pmin, pmax)

      implicit none
      integer Mx, Nx, Ny
      real map(Mx, Ny), pmin, pmax

  Finds the minimum and maximum of the real array map(x,y).

  Input:
    map(Nx,Ny)   Input real array of values.
    Mx           The maximum (or declared) X dimension of the array.
    Nx, Ny       X/Y working dimensions of the map array.

  Output:
    pmin, pmax   The minimum (pmin) and maximum (pmax) of the array.
