
;+ ***********************************************************************
; NAME:
;	SIGRMN
;
; PURPOSE:
;  Search for significant signals in a 1D data array, through comparison between
;  original data and those evaluated by a running mean (moving window smoothing 
;  method).	
;
; CATEGORY:
;	NRH1 Positions
;
; CALLING SEQUENCE:
;	SIGRMN, Scan, Width, Poids, Mscan, Imx
;
; INPUTS:
;	SCAN	1D array of original data
;	WIDTH	Window for calculation of the running mean (no. of points)
;	POIDS	minimum weight for an excess value to be considered significant
;		(excess above running mean, divided by the standard
;		 deviation of the "fit" of the scan by the running
;		 mean)
;
; KEYWORD PARAMETERS:
;	Non
;
; OUTPUTS:
;		mscan	1D array of running averaged data
;		imx	Index of the  point where the excess above
;			the running mean is highest; 
;			= -1 if no significant value was found
;
; PROCEDURE:
;	Cette procedure appelle RUNMN_RH
;
; EXAMPLE:
;	Please provide a simple example here
;
; MODIFICATION HISTORY: (bonmartin@obspm.fr)
;	le 17/11/98	adapte du logiciel XHELIO (JB)
;	le 12/4/99	redefinition imax, weight (KLK)
;-*******************************************************************


pro sigrmn, scan, width, poids, mscan, imx

runmn_rh, scan, width, mscan, sdev

imax = MAX(scan-mscan, imx)	; Highest excess brightness in the scan
weight = imax / sdev		; Relative excess of the amplitude at this point
IF (weight LT poids) THEN imx = -1

end
