% % Set up a namespace for all the APED data % implements("aped"); variable runonce; if (__is_initialized(&runonce) == 0) { static variable LL_filename = "$ATOMDB/apec_linelist.fits"; static variable LL_filename_101 = "$ATOMDB/apec_v1.01_linelist.fits"; static variable LL_data = NULL; static variable FM_FileMap = "$ATOMDB/filemap"; static variable FM_Z = -1; static variable FM_rmJ = -1; static variable FM_FileType = -1; static variable FM_FileName = -1; static variable LV_data = Assoc_Type[]; static variable LA_data = Assoc_Type[]; static variable EC_data = Assoc_Type[]; static variable PC_data = Assoc_Type[]; static variable DR_data = Assoc_Type[]; static variable ionbal_filename = "$ATOMDB/APED/ionbal/MM98_ionbal.fits"; static variable ionbal = NULL; static variable ionbal_index = -1; % % Define the necessary structures % () = evalfile("guide_types.sl"); variable runonce = 1; } % % Check to see if the ATOMDB exists % () = evalfile("expand_env.sl"); () = evalfile("readlinelist.sl"); () = evalfile("read_filemap.sl"); variable fp = fopen(expand_env("$ATOMDB/VERSION"), "r"); if (fp == NULL) { message("The atomic data required for GUIDE is not available."); message("This could be due either to:"); message("(1) $ATOMDB is not defined (check with 'echo $ATOMDB' or "); message("(2) the ATOMDB is not installed (check with system manager)."); } else { variable atomdbVer; if (fgets(&atomdbVer, fp) == -1) atomdbVer = "Unknown"; () = fclose(fp); % % Install all the necessary routines. % () = evalfile("array_math.sl"); () = evalfile("isnan.sl"); () = evalfile("interpol.sl"); () = evalfile("interp_keyword.sl"); () = evalfile("GetHdrKey.sl"); () = evalfile("make_range.sl"); () = evalfile("get_filename.sl"); () = evalfile("roman_element.sl"); () = evalfile("check_version.sl"); () = evalfile("read_elev.sl"); () = evalfile("read_eline.sl"); () = evalfile("read_ecoll.sl"); () = evalfile("read_pcoll.sl"); () = evalfile("read_drline.sl"); () = evalfile("read_ion_bal.sl"); () = evalfile("ionbal.sl"); () = evalfile("calc_energy.sl"); () = evalfile("calc_statwt.sl"); () = evalfile("calc_wavelength.sl"); () = evalfile("calc_einstein_a.sl"); () = evalfile("ParseLineStr.sl"); () = evalfile("GetLineEmisRows.sl"); () = evalfile("find_floor.sl"); () = evalfile("identify.sl"); () = evalfile("describe.sl"); () = evalfile("strong.sl"); () = evalfile("mdl2latex.sl"); () = readlinelist(LL_filename, LL_filename_101); () = read_filemap(FM_FileMap); vmessage("GUIDE Initialized using ATOMDB v%s",atomdbVer); }