FUNCTION eis_get_string_studyraster , sra , saved = saved

; We need - 
; acronym
; title
; author
; date - current
; nLines

ra = db_read_raster_entry(sra.ra_id)
;
; ID
;
IF (KEYWORD_SET(saved) EQ 1) THEN ra_id = sra.ra_id ELSE ra_id = -1
IF (KEYWORD_SET(saved) EQ 1) THEN ll_id = sra.ll_id ELSE ll_id = -1
;
; Title
;
title_length = STRLEN(STRTRIM(ra.title,2))
title_format = STRJOIN(["(A-24,A-",STRCOMPRESS(title_length,/REMOVE),")"],/SINGLE)
;
; Data Windows
;
dataW        = ra.dataWindows[0:ra.nWindows - 1]
dataWindows  = STRJOIN(STRTRIM(dataW,2) , ',' ,/SINGLE)
dataW_length = STRLEN(dataWindows)
dataW_format = STRJOIN(["(A-24,A-",STRCOMPRESS(dataW_length,/REMOVE),")"],/SINGLE)
;
; Exposures
;
exps         = ra.exposures[0:ra.nExp - 1]
exps_string  = STRJOIN(STRTRIM(exps,2) , ',' ,/SINGLE)
exps_length  = STRLEN(exps_string)
exps_format  = STRJOIN(["(A-24,A-",STRCOMPRESS(exps_length,/REMOVE),")"],/SINGLE)
;
; Delays
;
dels         = ra.delays[0:ra.nExp - 1]
dels_string  = STRJOIN(STRTRIM(dels,2) , ',' ,/SINGLE)
dels_length  = STRLEN(dels_string)
dels_format  = STRJOIN(["(A-24,A-",STRCOMPRESS(dels_length,/REMOVE),")"],/SINGLE)
;
; studyRaster AEC Flags
;
ra_aec_flags = STRJOIN(STRTRIM(FIX(sra.aec_props.aec_flag),2),',',/SINGLE)
ra_aec_length= STRLEN(ra_aec_flags)
ra_aec_format= STRJOIN(["(A-24,A-",STRCOMPRESS(ra_aec_length,/REMOVE),")"],/SINGLE)
;
; studyRaster AEC Properties
;
upperT    = sra.aec_props.upper_threshold
lowerT    = sra.aec_props.lower_threshold
upperL    = sra.aec_props.upper_count_limit
lowerL    = sra.aec_props.lower_count_limit
exp_id    = sra.aec_props.exposure_id
max_rt    = sra.aec_props.max_run_time
aec_props = STRJOIN(STRTRIM([upperT,lowerT,upperL,lowerL,                 $
		    exp_id,max_rt],2), ',',/SINGLE)

;
; studyRaster EIS Flare Flags
;
eisF_flags  = STRJOIN(STRTRIM(FIX(sra.eis_flare_props.flare_flag),2), ',',/SINGLE)
eisF_length = STRLEN(eisF_flags)
eisF_format = STRJOIN(["(A-24,A-",STRCOMPRESS(eisF_length,/REMOVE),")"],/SINGLE)
;
; studyRaster EIS Flare Properties
;
x_cent     = sra.eis_flare_props.x_centre
y_cent     = sra.eis_flare_props.y_centre
x_p_t      = sra.eis_flare_props.x_pixel_threshold
y_p_t      = sra.eis_flare_props.y_pixel_threshold
x_lim      = sra.eis_flare_props.x_min_limit
y_lim      = sra.eis_flare_props.y_min_limit
eisF_props = STRJOIN(STRTRIM([x_cent,y_cent,x_p_t,y_p_t,                    $
                             x_lim,y_lim],2), ',',/SINGLE)

;
; studyRaster EIS Event Flags
;
eisE_flags  = STRJOIN(STRTRIM(FIX(sra.eis_event_props.event_flag),2),',',/SINGLE)
eisE_length = STRLEN(eisE_flags)
eisE_format = STRJOIN(["(A-24,A-",STRCOMPRESS(eisE_length,/REMOVE),")"],/SINGLE)
;
; studyRaster EIS Event Properties
;
x_p_t      = sra.eis_event_props.x_pixel_threshold
y_p_t      = sra.eis_event_props.y_pixel_threshold
x_lim      = sra.eis_event_props.x_min_limit
y_lim      = sra.eis_event_props.y_min_limit
eisE_props = STRJOIN(STRTRIM([x_p_t,y_p_t,x_lim,y_lim],2), ',',/SINGLE)
;
; studyRaster XRT Properties
;
xrt_flags = STRTRIM(FIX(sra.xrt_flare_props.xrt_flag),2)

;
r     = STRARR(35)
; OK, here we go
r[0 ] = STRING(format='(A-24,I-6)'  , 'EIS_RASTER_START'     , sra.ra_index         )
r[1 ] = STRING(format='(A-24,I-6)'  , 'RA_ID'                , ra_id                )
r[2 ] = STRING(format='(A-24,A-20)' , 'ACRONYM'              , ra.acronym           )
r[3 ] = STRING(format=title_format  , 'TITLE'                , ra.title             )
r[4 ] = STRING(format='(A-24,A-20)' , 'AUTHOR'               , ra.author            )
r[5 ] = STRING(format='(A-24,A-20)' , 'DATE'                 , ra.date              )
r[6 ] = STRING(format='(A-24,I-6)'  , 'LL_ID'                , ll_id                )
r[7 ] = STRING(format='(A-24,I-6)'  , 'RASTERTYPE'           , ra.rasterType        )
r[8 ] = STRING(format='(A-24,I-6)'  , 'SCAN_FM_NSTEPS'       , ra.scan_fm_nsteps    )
r[9 ] = STRING(format='(A-24,I-6)'  , 'SCAN_FM_STEPSIZE'     , ra.scan_fm_stepsize  )
r[10] = STRING(format='(A-24,I-6)'  , 'SNS_NEXPS'            , ra.sns_nexps         )
r[11] = STRING(format='(A-24,I-6)'  , 'SNS_DURATION'         , ra.sns_duration      )
r[12] = STRING(format='(A-24,I-6)'  , 'NWINDOWS'             , ra.nWindows          )
r[13] = STRING(format=dataW_format  , 'DATAWINDOWS'          , dataWindows          )
r[14] = STRING(format='(A-24,I-6)'  , 'WINDHEIGHT'           , ra.windHeight        )
r[15] = STRING(format='(A-24,I-6)'  , 'WINDWIDTH'            , ra.windWidth         )
r[16] = STRING(format='(A-24,I-6)'  , 'SLITINDEX'            , ra.slitIndex         )
r[17] = STRING(format='(A-24,I-6)'  , 'NEXP'                 , ra.nExp              )
r[18] = STRING(format=exps_format   , 'EXPOSURES'            , exps_string          )
r[19] = STRING(format=dels_format   , 'DELAYS'               , dels_string          )
;r[20] = STRING(format='(A-24,I-6)'  , 'COMPRESSION'          , ra.compression       )
r[20] = STRING(format='(A-24,I-6)'  , 'SPLIT'                , ra.split             )
r[21] = STRING(format='(A-24,I-20)' , 'DURATION'             , ra.duration          )
r[22] = STRING(format='(A-24,I-20)' , 'VOLUME'               , ra.volume            )
r[23] = STRING(format='(A-24,I-6)'  , 'EIS_RASTER_END'       , sra.ra_index         )
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
r[24] = STRING(format='(A-24,I-6)'  , 'EIS_STUDYRASTER_START', sra.ra_index         )
r[25] = STRING(format='(A-24,I-6)'  , 'RA_REPEATS'           , sra.ra_repeats       )
r[26] = STRING(format='(A-24,I-6)'  , 'RA_COMPRESSION'       , sra.ra_compression   )
r[27] = STRING(format=ra_aec_format , 'AEC_LINE_FLAG'        , ra_aec_flags         )
r[28] = STRING(format='(A-24,A-20)' , 'AEC_PARAMETERS'       , aec_props            )
r[29] = STRING(format=eisF_format   , 'EIS_FLARE_LINE_FLAG'  , eisF_flags           )
r[30] = STRING(format='(A-24,A-20)' , 'EIS_FLARE_PROPERTIES' , eisF_props           )
r[31] = STRING(format=eisE_format   , 'EIS_EVENT_LINE_FLAG'  , eisE_flags           )
r[32] = STRING(format='(A-24,A-20)' , 'EIS_EVENT_PROPERTIES' , eisE_props           )
r[33] = STRING(format='(A-24,I-6)'  , 'XRT_FLARE_LINE_FLAG'  , xrt_flags            )
r[34] = STRING(format='(A-24,I-6)'  , 'EIS_STUDYRASTER_END'  , sra.ra_index         )


RETURN , TRANSPOSE(STRTRIM( r , 2))

END
