;+
; Get a data structure from the default io object and put that into
; the default 0 element of the array of data containers.
;
; If the value of !g.line is true, then the data comes from !g.lineio
; and the result is stored in !g.s[0], otherwise the data comes from
; !g.contio and is stored in !g.c[0].
;
; Currently, the selection criteria are passed directly to the io
; class's get_spectra or get_continua function via the _EXTRA parameter. Eventually, a
; more specific detailed interface will be found here.
; See the line index's
; search_index or
; continuum index's search_index
; for the full set of parameters that are available through the _EXTRA
; parameter here.
;
; @uses set_data_container
;
; @version $Id: get.pro,v 1.12 2005/05/28 15:24:23 paghots Exp $
;-
pro get, _EXTRA=ex
compile_opt idl2
if (!g.line) then begin
if (!g.lineio->is_data_loaded()) then begin
dc = !g.lineio->get_spectra(count,_EXTRA=ex)
endif else begin
message, 'No line data is attached yet, use filein or dirin.',/info
return
endelse
endif else begin
if (!g.contio->is_data_loaded()) then begin
dc = !g.contio->get_continua(count,_EXTRA=ex)
endif else begin
message, 'No continuum data is attached yet, use filein or dirin.',/info
return
endelse
endelse
if (data_valid(dc) gt 0) then begin
if (n_elements(dc) gt 1) then begin
message,'More than one item fetched - ignoring all by the first',$
/info
for i=1,n_elements(dc)-1 do data_free, dc[i]
dc = dc[0]
endif
set_data_container, dc
data_free, dc
endif else begin
if (count eq 0) then begin
message, 'No matching entries',/info
endif else begin
message, 'There was a problem getting the data from the i/o object',/info
endelse
endelse
end