;+
; Project     : SOHO - CDS     
;                   
; Name        : WAVESIZE()
;               
; Purpose     : Return no. of dispersion pixels in a Spectral Window
;               
; Explanation : Straightforward.
;               
; Use         : N_DISPERSION_PIXELS = WAVESIZE(QLDS,WINDOW)
;    
; Inputs      : QLDS:	A "CDS QL data structure"
;
;		WINDOW:	The number or name of a Spectral Window in the
;			QLDS.
;               
; Opt. Inputs : None.
;               
; Outputs     : Return value.
;               
; Opt. Outputs: None.
;               
; Keywords    : NOCHECK:Set to avoid call to QLMGR.
;
; Calls       : QLMGR, QL_DIMENSIONS(), WINDOWNO()
;
; Common      : None.
;               
; Restrictions: QLDS == CDS QL data structure.
;               
; Side effects: None.
;               
; Category    : CDS, QuickLook
;               
; Prev. Hist. : None.
;
; Written     : Stein Vidar Hagfors Haugan, October 1993
;               
; Modified    : SVHH, 21 November - Documentation added.
;		SVHH, 7-March-1995 - Added call to QL_DIMENSIONS() to 
;			cope with new data formats.
;
; Version     : 1.1, 7-March-1995
;-            

FUNCTION WaveSize,QLDS,window,NOCHECK=NOCHECK
  
  IF NOT Keyword_SET(NOCHECK) THEN QLMGR,QLDS

  dims = ql_dimensions(QLDS,/nocheck)

  if not dims.wavelnth then return,0

  win =	windowno(QLDS,window,/NOCHECK)
  IF window eq 0 THEN return,0
  
  return,QLDS.DetDesc(win-1).ixstop(0)-QLDS.DetDesc(win-1).ixstart(0)+1
  
END
