;+
; Project     : SOHO - CDS     
;                   
; Name        : SLIT4V5_DEMO
;               
; Purpose     : Demonstrates slit 4 and 5 NIS data.
;               
; Explanation : The use of slit 5 (4" wide) is shown to degrade the spectral
;               resolution achieved only slightly compared to use of slit 4
;               (2" wide).  The count rate of course is higher by approx a 
;               factor 2. 
;               
; Use         : IDL> slit4v5_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 slit4v5_demo

sp4 = 0
sp5 = 0
w2 = 0
w2s = 0

;
;  restore data from s5099 and s5100
;
restore,concat_dir('$CDS_ENG_DEMO','nis2_slit5_eg')

!p.multi=[0,1,3]
circle_sym

plot,w2s,sp5,psym=10,xr=[552,557],/xst,chars=2,$
           tit='Slit 4 & 5 data overlayed'
oplot,w2,sp4*1.9,psym=-8

w210a = findgen(430)*0.01167716 + 551.96456

plot,w2s,sp5,psym=10,xr=[552,557],/xst,/yst,chars=2,$
      yr=[-5,1.2*max(sp5)],tit='Slit 5 data with 4 gaussian fit (width 0.34)'
g1 = 41.9777 *exp(-(w210a-553.441)*(w210a-553.441)/(0.34*0.34))
g2 = 72.2219 *exp(-(w210a-554.182)*(w210a-554.182)/(0.34*0.34))
g3 = 172.6644*exp(-(w210a-554.637)*(w210a-554.637)/(0.34*0.34))
g4 = 44.3085 *exp(-(w210a-555.357)*(w210a-555.357)/(0.34*0.34))
gs5 = g1+g2+g3+g4
oplot,w210a-0.0585,gs5,th=2


w210b = findgen(430)*0.01167716 + 552.02306

plot,w2,sp4,psym=10,xr=[552,557],/xst,/yst,chars=2,$
     yr=[-5,1.2*max(sp4)],tit='Slit 4 data with 4 gaussian fit (width 0.32)' 
g1 = 21.7648 *exp(-(w210b-553.390)*(w210b-553.390)/(0.32*0.32))
g2 = 40.0616 *exp(-(w210b-554.128)*(w210b-554.128)/(0.32*0.32))
g3 = 94.8467*exp(-(w210b-554.574)*(w210b-554.574)/(0.32*0.32))
g4 = 23.3257 *exp(-(w210b-555.291)*(w210b-555.291)/(0.32*0.32))
gs4 = g1+g2+g3+g4
oplot,w210b,gs4,th=2


end
