ATOMDB Banner

 

Using ATOMDB in IDL (Version 2.0.0)

We have written a number of tools in IDL to help extract data from the ATOMDB. A tar file containing them is available from the download page. These routines use a number of routines from the IDL astronomy library, but all the necessary routines have already been extracted and included in a subdirectory.

There are two prerequisites for using these routines (besides having the ATOMDB installed):

You must have the ATOMDB variable set to point to the top directory of the ATOMDB. This is automatically done when CIAO is installed, or it can be done by hand as shown below. In addition the environment variable ATOMDB_IDL should be set to point to the directory containing these idl scripts, i.e. the atomdb_idl-2.00 directory. If the ATOMDB is in /local/data/atomdb and the atomdb IDL files are in /local/data/atomdb/atomdb_idl-2.00, then you should use

(in csh or tcsh)

unix% setenv ATOMDB /local/data/atomdb
unix% setenv ATOMDB_IDL /local/data/atomdb/atomdb_idl-2.00

(in sh or bash)

unix% ATOMDB=/local/data/atomdb ; export ATOMDB
unix% ATOMDB_IDL=/local/data/atomdb/atomdb_idl-2.00 ; export ATOMDB_IDL

You must initialize the routines using the command @/path/to/atomdb_idl/init_atomdb_idl.pro at the IDL prompt before using any of the values. The init_atomdb_idl.pro file sets up some required structures and automatically initializes all the routines.

The following routines exist in the ATOMDB idl library and are designed for user-interaction:

read_linelist.pro : Call as IDL> read_linelist, filename, linestruct, temperature, density, power. This routine reads a line list file and returns an array of structures (linestruct). The last three parameters are optional, and return vectors giving the temperature, density, and emitted power for the model.
read_coco.pro : Call as IDL> read_coco, filename, cocostruct, temperature, dnesity, power. Similar to the above, this reads a compressed continuum (coco) file, and returns an array of structures (cocostruct).
calc_spectrum.pro : Call as IDL> result = calc_spectrum(line,coco,E_grid,T,[ELEMENTS=Zarr,/angstrom,/ergs]). This routine calculates the emitted spectrum (in photons cm^3 / s, unless the /ergs flag is set in which case it is in ergs cm^3 / s) for a given energy grid E_grid (in keV unless the /angstrom flag is set in which case E_grid is assumed to be in angstromgs) at a given temperature T (which must be a scalar) using the model data in the structures line and coco. If an array of Z values is passed with the ELEMENTS flag, only those elements are used when calculating the spectrum.
extract_strong.pro: This function extracts the strongest lines for a given ion from an array of line emissitivity structures. It is called as IDL> strongline = extract_strong(line, Z, rmJ, [MIN_EPSILON=min_epsilon]), where line is an array of line structures, Z is the elemental Z value (or 0 for all Z's), rmJ is the roman numeral of the ion (or 0 for all ions). Set MIN_EPSILON if you are only interested in lines stronger than a particular value.
extract_line.pro : This function returns the line emissivity for a given line; it is called as IDL> epsilon = extract_line(line, Z, rmJ, ll, lu, T, [/ACTUAL_T]). Line is an array of line emissivity structures, Z is the element, rmJ is the ion (1 = I, 2 = II, etc), ll is the lower level, lu is the upper level, and T is the temperature. If the /ACTUAL_T flag is set, then all the emissivities for this line is returned, and T is set to the temperatures for those emissivities. Otherwise, T is an input vector of temperatures, and the emissivities are interpolated as needed on that temperature grid.
select_line.pro : This function returns the an array of line emissivity structures for the line which matches the ion and wavelength given. If no line exists at this wavelength, the line closest in wavelength is chosen. The routine is called as IDL> data = select_line(line, Z, ion, wavelength).

We also have some sample idl scripts. These scripts use files from the main ATOMDB release (apec_line.fits and apec_coco.fits) as well as those from the Raymond-Smith code (RS93_line.fits and RS93_coco.fits).
makeplot_lines.pro: Creates plots comparing line emissitives for lines of O VII, O VIII, Fe XXV, and Fe XXVI.
makeplot_spec.pro: Creates plots of APEC spectra at various temperatures, and compares them to the equivalent Raymond & Smith models.