;+
; PROJECT
;           SolarB EIS
;
; NAME
;           EIS_GET_TOTAL_RASTER_WIDTH
;
; PURPOSE
;           Function to calculate the spatial width of a raster
;
; CATEGORY
;           EIS Technical Planning
;
; INPUTS
;           ra - an eis_raster structure
;
; OPTIONAL INPUTS
;           None
;
; WRITTEN
;           John A Rainnie RAL Dec-2005
;
; HISTORY
;           v0.1 3-Apr-2007
;               Tidied this routine
;           v0.2 24-Apr-2007
;               Updated slot to 266". Replaced stop statement with
;               warning message.
;
;-
;************************************************************************
FUNCTION eis_get_total_raster_width , ra

; Get slitSlotWidth
CASE ra.slitindex OF
        0    : ssWidth = 1.
        1    : ssWidth = 266.
        2    : ssWidth = 2.
        3    : ssWidth = 40.
        ELSE :  BEGIN
      print,'% EIS_GET_TOTAL_RASTER_WIDTH: raster slit_index parameter is out of range!'
      print,'  Allowed values are 0-3.  Current value is '+trim(ra.slitindex)
      print,'  A value of 0 will be assumed.'
      ssWidth=1.
    ENDELSE
ENDCASE

CASE ra.rasterType OF
    0    : width = (ra.scan_fm_nsteps * ra.scan_fm_stepsize) + ssWidth
    1    : width =                                             ssWidth
    ELSE : stop
ENDCASE

RETURN , width

END
