MacroCombine

Combine Chianti levels to create a more succinct MacroAtom model

Command line usage (if any):

usage: MacroCombine.py [-guess] level_file line_file phot_file

with
-guess implies that the program will try to guess

what levels should be combined. In the absence of this, the program will check if the levels one wants to combine have beeen set already.

Description:

This routine attempts to reconfigure the level, line and phot files files to allow for the fact that one would often like to combine levels to make MacroAtoms smaller

There are two basically possibilities:

with the -guess option, the program takes the original level file, in the format produced by MakeMacro, and guesses what levels to combine, producing an ‘intermediate level file’ that contains information extra columns indicating what to combine.

It then continues to produce final level fileline annd photoionization files that reflect this choice.

Alternatively, without the -guess option the routine will read epects to read a level file which contains the extra columns that indcicate what needs to combine, and uses this to produce final level, line and photoionization files.

Primary routines:

Notes:

History:

231013 ksl Coding begun

Functions

add_gtot([filename])

Add the final G factors to the for the combined levels to the level file

plot_xsec(selection, xtab[, style, clear])

Heree

read_phot([file])

Read a Python photoionization file and return the information in a form the is eacy to manipulate

redo_lines([master, lines])

Write out a new line file, based on the intermidate level file

redo_phot([xlevel_file, phot_file_orig, ...])

Read a file containing the levels we want to compress amd the associted phot_file and produce a new phot file

reweight(levels, g, xtab)

Reweight a group of of photionsation xsections, based on g

steer(argv)

This is just steering routine to allow operations from the command line

write_phot(outfile, xtab, xsec)

Write a valid Macro photometry xsection file from what amounts to an internal format for this routine.

xguess([tab_name, out_name, frac, redo])

Guess how levels for an atom should be combined and write out the intermediate level file that contains the various suggestions