PRO Image_Info,z,x,y,DELETE=delete, FILE = file
;+
; NAME:
;	Image_Info
; PURPOSE:
;	Displays the value range of an image and its
;	axes, the step between x- and y-values and
;	the titles stored in the corresponding
;	system variables. Indicate if the axes are compressed.
; CALLING SEQUENCE:
;	Image_Info [ ,image [ ,xAxis [,yAxis ] ] ]
; CATEGORY:
;	Image Processing
; INPUTS:
;	image: The two-dimensionnal array which contains the 
;		image.
;	xAxis,yAxis: The axes.
;	The three parameters are optional
; MODIFICATION HISTORY:
;	Created 4/91, A.Csillaghy, ETHZ, csillag@astro.phys.ethz.ch
;       Adapted for IDL5/RagView/SSW in March 1998 -- ACs
;-

Print, '---------------------------------------------------------------------'
Print, '               IMAGE INFORMATION'
Print, '---------------------------------------------------------------------'
Print, ' '
IF Keyword_Set( file ) THEN Print,'File: '+file
Print,'Name of the image: '+!p.title

nx = N_Elements(x)
ny = N_Elements(y)

Print, '    Number of pixels in x: '+StrTrim(nx,2)
Print, '    Number of pixels in y: '+StrTrim(ny,2)

hms = GetHMS()
IF nx GE 2 THEN BEGIN
    text = 'x range : [ '
    IF hms THEN $
      text = text + HMSConvert( Min(x) ) + ' .. ' + $
      HMSConvert( Max(x) ) $
    ELSE text = text + StrTrim(MIN(x),2)+' .. ' +StrTrim(MAX(x),2)
    text = text + ' ] '
    Print, '          ' + text
ENDIF ELSE IF nx EQ 1 THEN BEGIN
    text = 'x value : '
    IF hms THEN  Print, '          ' + text+HMSConvert(x(0)) $
    ELSE Print, "          " +text+StrTrim(x(0),2) 
ENDIF ELSE Print, '          no x axis defined'

IF ny GE 2 THEN $
  Print,'          y range:  [ '+ $
         StrTrim(MIN(y),2)+' .. ' +StrTrim(MAX(y),2)+']' $
ELSE IF ny EQ 1 THEN Print, '          y value: '+StrTrim(y(0),2) $
ELSE Print, '          no y axis defined'

IF N_Elements(z) NE 0 THEN $
  Print,'          z range:  [ '+$
           StrTrim(Float(MIN(z)),2) + ' .. ' $
         + StrTrim(Float(MAX(z)),2)+']'

IF nx GT 1 THEN Print,'          step x: '+StrTrim(x(1)-x(0),2) 
IF ny GT 1 THEN Print,'          step y: '+StrTrim(y(1)-y(0),2)

Print, '     title of the x axis: ' + !x.title
Print, '     title of the y axis: ' + !y.title
Print, '     title of the z axis: ' + !z.title
 

GetImageSizes, d1,d2, width, height 

IF nx GT width THEN BEGIN
    Print, '                     Image is compressed in X direction'
    Print, STRING(7B)
ENDIF
IF ny GT height THEN BEGIN
    Print,'                      Image is compressed in Y direction'
    Print, STRING(7B)
ENDIF

Print, ' '
Print, '--------------------------------------------------------------------'
Print, ' '

END
  
