;+
; Project     :	SOHO - CDS
;
; Name        :	GET_RASTER_INFO
;
; Purpose     :	Gets version numbers and internal IDs for CDHS tables.
;
; Explanation : First checks the current software version number of the code which creates
;               the table and then searches the raster_id database to determine whether this
;               precise table has been used before and if so gets the internal CDHS IDs.
;               It then searches the commprep database to determine whether the table is
;               already loaded or gets CDS index for loading it.
;
; Use         : <get_raster_info, raster, cut_off_time>
;
; Inputs      : raster  = structure array listing information on table used in science plan.
;                    raster.vs     = character string indicating the software version
;                                    of the code used to create the table.
;                    raster.id     = integer planning database ID for the table.
;                    raster.var    = integer planning database variation for the table.
;                    raster.cdhsx  = the internal CDHS index where the table is loaded
;                    raster.cdhsid = the internal CDHS ID used to reference the table
;                    raster.repn   = an integer indicating how many times the RASTER is to be repeated. 
;               cut_off_time = DOUBLE TAI format time before which tables may be overwritten
;
; Opt. Inputs : None.
;
; Outputs     : Updates the entries in raster directly.
;                    raster.ok     = an integer flag indicating whether table is already 
;                                    loaded onto the CDS.
;
; Opt. Outputs:	None.
;
; Keywords    : None.
;
; Calls       :	get_version, get_raster_id, get_cdhs_index, shorthex.
;                
; Common      :	None.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	Command preparation.
;
; Prev. Hist. :	None.
;
; Written     :	Version 0.0, Martin Carter, RAL, 14/10/94
;
; Modified    :	Version 0.1, Martin Carter, RAL, 28/11/94
;                            Added proforma.
;               Version 0.2, MKC, RAL, 2/3/95
;                            Added repn and sft to table info.
;                            Removed some tags from dexwin and vdswin tables. 
;               Version 0.3, MKC, RAL, 6/3/95
;                            Modified printout.
;               Version 0.4, MKC, RAL, 21/3/95
;                            Modified printout.
;               Version 0.5, MKC, RAL, 18/4/95
;                            Adapted from get_table_info.
;                            Modified argument list.
;                            Modified call to get_version.
;               Version 0.6, MKC, RAL, 24/4/95
;                            Modified printout.
;               Version 0.7, MKC, 3/11/95
;                            Modified printout so that masks of IEF bits in repn.
;               Version 0.8, MKC, 3/10/96
;                            Added time to allow previous tables to be overwritten to argument list.
;
; Version     :	Version 0.8, 3/10/96
;-
;**********************************************************

PRO get_raster_info, raster, cut_off_time

  ; get table creation software version

  get_version, 'RASTER', raster

  ; check if table already defined and get CDHS ID

  raster = get_raster_id ( raster ) 

  ; check all tables loaded onto CDHS and get CDHS indeces

  raster = get_cdhs_index ( 'RASTER', raster, cut_off_time )

  ; display some info on table

  PRINT,'RASTER table',                          $
        ' LOADED=', STRTRIM ( raster.ok, 1),     $
        ' SW=', raster.vs,                       $
        ' CDHSID=', STRTRIM ( raster.cdhsid, 1), $
        ' CDHSX=', STRTRIM ( raster.cdhsx, 1),   $
        ' ID=', STRTRIM ( raster.id, 1),         $
        ' VAR=', STRTRIM ( raster.var, 1),       $
        ' REPN=',shorthex ( raster.repn )

END
