;+
; Project     : SOHO - CDS     
;                   
; Name        : NEW_FF_DEMO
;               
; Purpose     : Demonstrates application of Flat Field and its effects
;               
; Explanation : When the ground based flat field is applied to raw data
;               a considerable improvement in image quality it seen. However
;               for those regions where in-flight data are available they are
;               shown to improve the data still further.  The effect of these
;               corrections on line profile fitting is also shown.
;               
; Use         : IDL> new_ff_demo
;    
; Inputs      : None
;               
; Opt. Inputs : None
;               
; Outputs     : None
;               
; Opt. Outputs: None
;               
; Keywords    : None
;
; Calls       : None
;
; Common      : None
;               
; Restrictions: None
;               
; Side effects: None
;               
; Category    : Calibration
;               
; Prev. Hist. : None
;
; Written     : C D Pike, RAL, 12-Nov-96
;               
; Modified    : 
;
; Version     : Version 1, 12-Nov-96
;-            
pro new_ff_demo

data = 0
dd = 0
ddav571 = 0
ddav571_cdp = 0
raw = 0
p1 = 0
p2 = 0
p3 = 0


restore,concat_dir('$CDS_ENG_DEMO','new_ff_demo')

exptv,data

print,' '
print,' '
print,'The three images show (left to right)...'
print,'  1) the raw OV window data'
print,'  2) data corrected by vds_calib
print,'  3) data corrected by in-flight flat field'
print,' '

yes_no,'Hit return when ready for line fitting results. > ',ans

circle_sym
plot,p1,psym=8,yr=[7,9],xtit='Pixel along slit',ytit='Line centroid',$
     tit='Effect of flat fielding on line profile fitting',chars=1.4
oplot,p2-0.2,psym=2
oplot,p3-0.4,psym=4

print,' '
print,'The three plots (top to bottom) show the result of fitting a gaussian'
print,'to each spectrum along the slit on the three data sets displayed'
print,'previously.  You are meant to see a decrease in the noise/scatter!'
print,' '
end

