%N imminmax %F $MIR/src/subs/imminmax.for
%D Return Miriad image minimum and maximum value.
%P rjs
%: image-data
%B
        subroutine ImMinMax(lun,naxis,nsize,rmin,rmax)

        implicit none
        integer lun,naxis,nsize(naxis)
        real rmin,rmax

  Determine the min and max values of a Miriad image. This first checks
  the image header for the information. If it is not present in the header,
  it calculates it directly from the data, and then stores it in the header.
  TODO: it ignores the masked values

  Input:
    lun        The handle of the input image.
    naxis      The number of axes.
    nsize      The length of each axis.

  Output:
    rmin,rmax  The min and max value of the image.
