;+ ; Set the line io object to look at the online file. ; The online file is determined by finding the most recently ; updated file in the online directory (/home/sdfits). ; Once a file is connected to, this command must be used again to ; connect to a more recent spectral line sdfits file (from switching projects ; or switching backends). ; ; @keyword acs {in}{optional}{type=boolean} the most recent spectrometer sdfits file will be connected to. This is the default. ; @keyword sp {in}{optional}{type=boolean} the most recent spectral processor sdfits file will be connected to. ;- pro online, acs=acs, sp=sp compile_opt idl2 if !g.line eq 0 then begin message, "Online contnuum mode not supported", /info return endif ; what files can we connect to? latest_file = !g.lineio->get_online_files(acsf,dcrf,spf,status) if status eq 0 then begin message, "Cannot load online file", /info return endif ; should we connect to acs or sp fits files? use_acs = 0 use_sp = 0 if keyword_set(acs) eq 0 and keyword_set(sp) eq 0 then begin use_acs = 1 endif else begin if keyword_set(acs) and keyword_set(sp) then begin use_acs = 1 endif else begin if keyword_set(acs) then begin use_acs = 1 endif else begin use_sp = 1 endelse endelse endelse ; is there a spectral line fits file to connect to? if use_acs then begin if acsf eq "" then begin message, "No spectrometer fits file can be found in online directory.", /info return endif filename = acsf endif if use_sp then begin if spf eq "" then begin message, "No spectral processor fits file can be found in online directory.", /info return endif filename = spf endif ; inform the user what is being used fi = file_info(filename) age = (systime(/seconds) - fi.mtime)/60.0 ; age in minutes print, "Connecting to file: "+filename print, "File has not been updated in ",age," minutes.",format='(a29,f16.2,a9)' if filename ne latest_file then begin print, "Latest file in online directory: "+latest_file endif new_io = obj_new("io_sdfits_line") if (obj_valid(new_io)) then begin if (obj_valid(!g.lineio)) then obj_destroy, !g.lineio !g.lineio = new_io endif ; finally, load this file in online mode !g.lineio->set_online, filename !g.line_filein_name = filename end