
PRO eis_exposure_times, data, exptimes

;+
; NAME
;
;     EIS_EXPOSURE_TIMES
;
; PROJECT
;
;     HINODE/EIS
;
; EXPLANATION
;
;     This routine extracts the start times of each exposure in an EIS data
;     object. The times are given in seconds relative to the first exposure.
;
; INPUTS
;
;     DATA   Can be either an EIS data object, or an EIS filename.
;
; OUTPUTS
;
;     EXPTIMES  An array containing the start time of each exposure in
;               seconds relative to the start of the first exposure.
; 
; HISTORY
;
;     Ver.1, 19-Jan-2007, Peter Young
;     Ver.2, 12-Feb-2007, Peter Young
;        now tidies up objects and structures
;-

IF datatype(data) EQ 'STR' THEN BEGIN
  data_obj=obj_new('eis_data',data)
  swtch=1
ENDIF ELSE BEGIN
  data_obj=data
  swtch=0
ENDELSE

aux_data=data_obj->getaux_data()

exptimes=data_obj->sec_from_obs_start(*(aux_data.ti_1))

;
; Tidy up objects & structures
;
aux_data=0
IF swtch EQ 1 THEN obj_destroy,data_obj

END
