MacroCombine

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

Command line usage:

usage: MacroCombine.py [-guess] level_file line_file phot_file upsilon_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.

The order of the input files is IMPORTANT!

Description:

This routine attempts to reconfigure the level, line and phot and collision 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 and 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.

Generally, speaking one should start with the -guess option and then modify the xlev column to reflect a final choice of levels to combine, and then one should rerun the routine without the -guess option to synchronize the rest of the files.

Primary routines:

Notes:

History:

231013 ksl Coding begun 240910 ksl Updated to add collisions to the process and to get the correct format for the output photometry files

Functions

add_gtot([filename])

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

combine_collisions(coltab)

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

Here

read_collisions([col, return_original])

Read the collision file and put everything into table for retrieval

read_phot([file])

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

redo_collisions([master, col])

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

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