MakeMacro

To facillitate generation of data for MacroAtoms several routines exist, including

  • Makemacro.py

  • RedoPhot.py

  • MacroCombine.py

These routines use data contained in a (local) Chianti repository and from TopBase to construct atomic data files that can be used to generate the atomic data needed for MacroAtoms. Chiani is the primary source of data, but unfortunately for SIROCCO, it does not include photionization x-sections, and so these are obtained from TopBase.

It should be emphacised at the outset that these routines, while they generate that can be read and used within in SIROCCO, they do not guaranteed that the Macro atom models are physically sensible. In particular, it is easy to generate models that are overly complex or ones that do not include all of the sublevels of a particular ion

Mechanics

All of the programs can be run from the command line. All of the programs can be ruun with a -h flag to obtain helo information.

The programs must be run in an enviroment in which astropy, matplotlib and ChiantiPy are installed.

MakeMacro.py

MakeMacro.py is the main program that needs to be run first. It retrieves data from a local installation of the CChianti database and from an external version of Topbase using wget.

If for example, one wishes to make C a macro atom, one needs to run MakeMacro as follows:

MakeMacro.py c_1 20
MakeMacro.py c_2 20
MakeMacro.py c_3 20
MakeMacro.py c_4 20
MakeMacro.py c_5 20
MakeMacro.py c_6 20  True

These commands create all of the files needed to make carbon a macro atom. The number 20 implies that one wants to create 20 levels for each of the ions, and need not be the same for each of the ions. This number should be larger than the number of levels one wants to ulitmately use with SIROCCO, and can be smaller. The extra command line option True for c_6 imples causes a bare C ion to be created for C

The files that will be created include:

  • c_2_levels.dat - A set of levels for C II taken from Chianti

  • c_2_lines.dat - A set of line files for C II taken from Chianti

  • c_2_phot.dat - A set of photoionization x-section taken from Topbase, matched to the level files. The photionization x-sections will have been extended to an energy (currently 100 keV by the routines contained in RedoPhot.py

  • c_2_upsilon.dat - A set of collisional x-sections taken from Chianti

There will also be a figure

  • c_2_phot.png which shows how the photoionzation x-sections have been extended to higher energies.

RedoPhot.py

RedoPhot.py is the program that contains routines to extend x-sections to a higher energy. it is normally called as a subroutine from MakeMacro.py, although it can be called from the command line for testing. .

The underlying issue is that the TopBase x-sections, which are simple tables of photon encergy and x-sections, do not extend to very high or consistent energies. The routine assumes one can use the logarighmic slope of the x-sections at the high end of what TopBase provides to extend the x-sections.

The routine called from MakeMacro.py rewrites the same file, but called from the command line can write the extended x-sections to a different file.

MacroCombine.py

MacroCombine.py is a routine that is intended to allow the user to selectively combine level generated by MakeMacro.py into level files that are physically reasonable but more compact that the models generated by MakeMacro.

The underlying assumption made in MacroCombine is that levels that are combined have relative populations that are portional to g of the original uncombined level.

Typically one would run MacroCombine.py as follows for C II

MacroCombine.py -guess c_2_levels.dat c_2_lines.dat c_2_phot.dat

The would produce the following files

  • c_2_lev_final.dat - A compressed level file based on the assumption that levels with very similar excitation energy should be combined

  • c_2_lines_final.dat - A set of lines for the compressed files.

  • c_2_phot_final.dat - A set of x-sections, matched to the other files

  • c_2_levels_guess.dat - A file which has two extra columns, xlev and G, compared to a typical level file. The xlev column shows which of the original levels been combined.

The last file needs to be inspected carefully. If the user wishes to change the choices that were made, he or she, should edit this file to reflect what levels should be combined.

When this is done, one reruns the routine

MacroCombine.py c_2_levels_guess.dat c_2_lines.dat c_2_phot.dat

without the -guess option to produce a final set of files

Note that at present the routine does not handle the collisional x-sections, though this should be straightforward to add

API Documentation

MakeMacro

Uses Chianti and Topbase to create the base for macro-atom models.

MacroCombine

Combine levels, etc in a MacroAtoms (generated with MakeMacro) to to create a more succinct MacroAtom model

RedoPhot

Extend phot tables retrieved from Topbase to higher energies and produce a plot file which shows the extended x-section file