;+
; PROJECT:
;	SXI-M Ground Data System
;
; NAME:
;	IMAGE_STATS
;
; PURPOSE:
;	Compute statistcs of a floating point image
;
; EXPLANATION:
;	TBS
;
; CALLING SEQUENCE:
;	IMAGE_STATISTICS,image
;
; INPUTS:
;	image			=	input image array
;   index			=	associated header index structure
;
; OUTPUTS:
;   index			=	associated header index structure
;						with updated parameter values
;
; OPTIONAL INPUT KEYWORDS:
;	N/A
;
; EXTERNAL CALLS:
;   N/A
;
; CALLED BY:
;	SXIM_PREP
;
; METHOD:
;	TBS
;
; HISTORY:
;   Version 1.x
;   Written by Steven Hill at NOAA/SEC 30 Jan 2001
;   001.001 Modified by Steven Hill 14 Mar 2001 to include directly write the header index
;   001.002 Modified by SM Hill 28 Mar 2001 to use IDL 5.4 Image statistics routine.
;           Renamed to IMAGE_STATS
;
;-;
pro image_stats,image,index

if (n_elements(image) gt 1) then begin ;Protect against null PDUs
  image_statistics,image,mean=IMG_MEAN,data_sum=IMG_WDI,stddev=IMG_SDEV, $
		     minimum=IMG_MIN,maximum=IMG_MAX

  index.IMG_MEAN=IMG_MEAN
  index.IMG_WDI=IMG_WDI
  index.IMG_SDEV=IMG_SDEV
  index.IMG_MIN=IMG_MIN
  index.IMG_MAX=IMG_MAX
  index.IMG_MED=median(image)

endif

end