FUNCTION gt_snratio, ana, missing=missing
  
  
;
;+
;
; Purpose: Return the signal and estimated noise in the .ana-file. Theese
;          parameters will be used by e.g. disp_maps for setting the
;          signal/noise threshold to a stricter value (greater) than the one
;          used in the calculations of the .ana files (0.1). To be called by
;          mk_map_struct.pro
;
;-
;

handle_value,ana.data_h, data
handle_value,ana.weights_h, weights

a  = sqrt(1./(weights>1e-6))  
ix = where(data eq missing or weights eq missing) 
if ix(0) ne -1L then a(ix) = missing
noise  = average(a,1,missing=missing)    ;Average/total noise level',$
signal = average(data,1,missing=missing) ;Average/total signal level']

return, signal/noise

END



