; docformat = 'rst'

;+
; $Id$
;-

;+
; For any planning timeline entry, retrieve the OBS_ID integer
; from the planning database. Since it does a non-indexed search
; of the timeline database, this may be slow.
;
; :Returns:
;   obs_id:
;     The integer obs_id for the timeline entry, or -1 if entry
;     is not found.
; :Params:
;   tl_id:
;     The sequence id for the timeline entry.
;
; :Author:
;   John Mariska, GMU, jmariska@gmu.edu, jtmariska@gmail.com
;-
function eis_get_obs_id, tl_id
    compile_opt strictarr

    tl = eis_get_tl_entry(tl_id)
    if (size(tl, /type) eq 8) then begin
        result = tl.science_component.obs_id
    endif else begin
        result = -1
    endelse

    return, result
end
