;+
; Project     : SOHO - CDS     
;                   
; Name        : QWAVECAL()
;               
; Purpose     : Lists current calibration parameters
;               
; Explanation : Human readable form of common block-held wavelength
;               calibration.
;               
; Use         : IDL> qwavecal
;    
; Inputs      : None
;              
;               
; Opt. Inputs : None
;               
; Outputs     : None
;               
; Opt. Outputs: None
;               
; Keywords    : None
;
; Calls       : None
;
; Common      : None
;               
; Restrictions: None
;               
; Side effects: None
;               
; Category    : Data analysis, wavelength calibration
;               
; Prev. Hist. : None
;
; Written     : C D Pike, RAL, 13-Mar-96
;               
; Modified    : Convert NIS to quadratic.  CDP, 23-Jul-96
;
; Version     : Version 2, 23-Jul-96
;-            

pro qwavecal

common cds_wavecal, ncoff, gcoff

if datatype(ncoff,1) eq 'Structure' then begin
   print,' '
   print, 'Currently loaded ** NIS ** wavelength calibration:'
   print, 'Applicable date (on or after): '+ anytim2cal(ncoff.date)
   print, 'Source FITS file: '+ ncoff.filename
   print, 'Coefficients used to convert pixels to wavelength:'
   print, 'NIS1: '+string(ncoff.coeff(0,0,0),$
                          ncoff.coeff(0,1,0),$
                          ncoff.coeff(0,2,0),$
                          form='(f10.5,3x,f11.9,3x,e15.9)')
   print, 'NIS2: '+string(ncoff.coeff(1,0,0),$
                          ncoff.coeff(1,1,0),$
                          ncoff.coeff(1,2,0),$
                          form='(f10.5,3x,f11.9,3x,e15.9)')
endif else begin
   print,' '
   print,'No ** NIS ** coefficients yet loaded.'
endelse

if datatype(gcoff,1) eq 'Structure' then begin
   print,' '
   print, 'Currently loaded ** GIS ** wavelength calibration:'
   print, 'Applicable date (on or after): '+ anytim2cal(gcoff.date)
   print, 'Associated GSET ID: '+trim(gcoff.gset_id)
   print, 'Source FITS file: '+ gcoff.filename
   print, 'Quadratic coefficients used to convert pixels to wavelength:'
   print, 'GIS1: '+string(gcoff.coeff(0,0,0),$
                          gcoff.coeff(0,1,0),$
                          gcoff.coeff(0,2,0),$
                          form='(f10.5, 3x, f11.9,2x,e15.9)')
   print, 'GIS2: '+string(gcoff.coeff(1,0,0),$
                          gcoff.coeff(1,1,0),$
                          gcoff.coeff(1,2,0),$
                          form='(f10.5, 3x, f11.9,2x,e15.9)')
   print, 'GIS3: '+string(gcoff.coeff(2,0,0),$
                          gcoff.coeff(2,1,0),$
                          gcoff.coeff(2,2,0),$
                          form='(f10.5, 3x, f11.9,2x,e15.9)')
   print, 'GIS4: '+string(gcoff.coeff(3,0,0),$
                          gcoff.coeff(3,1,0),$
                          gcoff.coeff(3,2,0),$
                          form='(f10.5, 3x, f11.9,2x,e15.9)')
   print,' '
endif else begin
   print,' '
   print,'No ** GIS ** coefficients yet loaded.'
endelse
   
end
