;+
; PROJECT
;          SolarB EIS
;
; NAME
;          EIS_XRTF_PROPS_TO_CONTROL
;
; PURPOSE
;          Procedure to convert EIS Event (EEBP) props from TL entry type
;          to CPT-type control structures
;
; CATEGORY
;          EIS Timeline Planning
;          Trigger/Response Studies
;
; INPUTS
;          sty_props    - tl.sc.eis_flare_response
;          sra_props    - tl.sc.studyRasters[index].eis_flare_props, where
;                         index is the index of the selected raster
;          eisf_control - is a CPT defined structure; {eis_flare_control}
;
; KEYWORDS
;          None
;
; WRITTEN
;          John Rainnie, RAL, Dec-2005
;
; HISTORY
;          v0.1 JAR 27-Jan-2010
;               Added comments.
;
;-
;______________________________________________________________________________
FUNCTION eis_eisf_props_to_control , sty_props , sra_props , eisf_control

; Which response line has been selected
line_index_list = WHERE(sra_props.flare_flag EQ 1 , count)
eisf_control.line_index          = line_index_list[0]

eisf_control.response_identifier = sty_props.response_study_id
eisf_control.raster_identifier   = sty_props.repoint_raster_index
eisf_control.adjust_x            = sty_props.x_repoint
eisf_control.adjust_y            = sty_props.y_repoint
eisf_control.x_threshold         = sra_props.x_pixel_threshold
eisf_control.y_threshold         = sra_props.y_pixel_threshold
eisf_control.x_min_limit         = sra_props.x_min_limit
eisf_control.y_min_limit         = sra_props.y_min_limit
eisf_control.locate_x            = sra_props.x_centre
eisf_control.locate_y            = sra_props.y_centre


RETURN , eisf_control

END
