This code is a simple collisional-radiative model designed to be as data source agnostic as possible. It was primarily designed to enable modeling of EBIT plasmas using other data sources: the main issues these present is the need for Gaussian electron energy distribution functions instead of Maxwellian/Thermal.
This code is in very rough shape for now, but "works". Please send feedback/development etc ideas.
The main code is in saocrm.py. An example for running it is shown in testsaocrm.py.
You start by declaring an Ion (e.g. Ba 50+) using the element and ion charge +1 (z1). Then load up energy levels, radiative transition information, and electron collision information using the "read_lv, read_trn and read_ec" functions.
You specify the function to be used in to actually read the data in these calls. There are examples written for reading from FAC ascii, AtomDB APED , and ADAS ADF04 formats. If you plan on mixing and matching this, some level matching will be required which is not yet fully implemented.
The main calls are then "gather_rates", which collects all the transition information into a pair of matrices; one for density dependent, one for density independent values.
Then "solve_levels" finds the level populations.
"calc_lines" calculates the line emission spectrum. You then have a few options for output.
- return_lines will return a numpy array of all the lines, with their wavelengths and emissivities.
- return_spectrum will return the spectrum on an energy grid specified by set_spectral_bins.
I will try and flesh this out more in the future, but for now see testsaocrm.py, testsaocrm_adf04_S.py for ideas.
There is also a "plot_pickle.py" which creates plots from the files.