chianti2atomneb.py converts raw CHIANTI atomic-data folders into
AtomNeb-style FITS files.
It is intended for workflows that want to use CHIANTI atomic data through AtomNeb/pyEQUIB-style FITS tables rather than reading the original CHIANTI ASCII files directly.
The converter writes:
AtomAij.fits # radiative transition probabilities
AtomElj.fits # energy levels
AtomOmij.fits # electron effective collision strengths on a temperature grid
chianti2atomneb.py is intentionally kept separate from the lightweight
chianti-raw package.
chianti-rawreads CHIANTI files directly and only needs NumPy.chianti2atomneb.pywrites FITS files and therefore requires Astropy.
This keeps the direct reader lightweight while still providing a conversion tool when AtomNeb-compatible FITS files are needed.
The converter supports several CHIANTI generations and Cloudy-converted layouts:
| Source | Level file | A-value file | Collision file |
|---|---|---|---|
| CHIANTI 6/7 | .elvlc |
.wgfa |
.splups |
| original CHIANTI 8/9/10/11 | .elvlc |
.wgfa |
.scups |
| Cloudy-converted CHIANTI 9-style | .elvlc |
.wgfa |
.splups |
The standard CHIANTI tree layout is preferred:
chianti_root/
o/
o_3/
o_3.elvlc
o_3.wgfa
o_3.scups
The converter also accepts compact single-ion layouts such as:
chianti_root/
o/
o_3.elvlc
o_3.wgfa
o_3.scups
or:
chianti_root/
o_3.elvlc
o_3.wgfa
o_3.scups
pip install numpy astropyNo ChiantiPy installation is required.
Convert a full CHIANTI tree:
python chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110 \
--tag CHI110This creates:
./atomneb_chianti110/AtomAij.fits
./atomneb_chianti110/AtomElj.fits
./atomneb_chianti110/AtomOmij.fits
Use CHIANTI ion folder names:
python chianti2atomneb.py \
--chianti-root ./chianti11 \
--ions o_3,ne_3,mg_5 \
--out-dir ./atomneb_subset \
--tag CHI110The converter can auto-detect .scups or .splups:
python chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110 \
--tag CHI110 \
--include-list \
--collision-format autoAvailable modes:
auto prefer .scups if present, otherwise use .splups
scups force original CHIANTI .scups format
splups force older/Cloudy .splups format
Use scups for original CHIANTI 8/9/10/11:
python chianti2atomneb.py \
--chianti-root ./chianti10 \
--out-dir ./atomneb_chianti100 \
--tag CHI100 \
--include-list \
--collision-format scupsUse splups for CHIANTI 6/7 or Cloudy-converted CHIANTI 9-style files:
python chianti2atomneb.py \
--chianti-root ./chianti7 \
--out-dir ./atomneb_chianti70 \
--tag CHI70 \
--include-list \
--collision-format splupsCHIANTI .scups and .splups store scaled effective collision strengths.
AtomOmij.fits stores values evaluated on a physical temperature grid.
By default, the converter uses a logarithmic grid. You can control it with:
--temp-log10-min 2
--temp-log10-max 9
--temp-points 71Example:
python chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110 \
--tag CHI110 \
--include-list \
--temp-log10-min 2 \
--temp-log10-max 9 \
--temp-points 71This produces:
log10(T/K) = 2.0, 2.1, 2.2, ..., 9.0
For a denser grid:
--temp-log10-min 3 --temp-log10-max 9 --temp-points 121To restrict each ion to the first N levels:
python chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110_70lev \
--tag CHI110 \
--include-list \
--max-levels 70This also filters A-values and collision records to transitions whose upper and lower levels are within the retained level range.
Default layout:
PRIMARY
References
ion data extensions...
With --include-list:
PRIMARY
References
List
ion data extensions...
With --no-references:
PRIMARY
ion data extensions...
With both --include-list --no-references:
PRIMARY
List
ion data extensions...
The converter writes AtomNeb-style extension names using lowercase ion labels and the supplied tag.
Examples with --tag CHI110:
AtomAij.fits:
o_iii_aij_CHI110
AtomElj.fits:
o_iii_elj
AtomOmij.fits:
o_iii_omij_CHI110
The List HDU, when requested, stores extension names and HDU numbers.
By default, each output FITS file includes a References HDU with columns:
ATOMICDATA
REFERENCE
References are extracted from the relevant CHIANTI source files:
AtomElj.fits <- .elvlc references
AtomAij.fits <- .wgfa references
AtomOmij.fits <- .scups or .splups references
The converter cleans common CHIANTI comment prefixes such as:
% A values:
% oscillator strengths:
% Effective collision strength:
Excitation data from:
Use --no-references to omit the References HDU.
Use --include-list to include a List HDU.
python chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110 \
--tag CHI110 \
--include-listThis is useful for inspecting output files with FITS viewers such as fv, or
for workflows that expect a list of available ion extensions.
For original CHIANTI 8/9/10/11 folders, keep:
.elvlc
.wgfa
.scups
For CHIANTI 6/7 and Cloudy-converted CHIANTI 9-style folders, keep:
.elvlc
.wgfa
.splups
A safe rule for mixed-version archives is to keep:
.elvlc
.wgfa
.scups
.splups
Proton collision files such as .psplups are not used by this converter.
python chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110 \
--tag CHI110 \
--collision-format auto \
--temp-log10-min 2 \
--temp-log10-max 9 \
--temp-points 71 \
--include-listpython chianti2atomneb.py \
--chianti-root ./chianti9_original \
--out-dir ./atomneb_chianti90_original \
--tag CHI90 \
--collision-format scups
--include-listpython chianti2atomneb.py \
--chianti-root ./chianti9_cloudy \
--out-dir ./atomneb_chianti90_cloudy \
--tag CHI90CLOUDY \
--collision-format splups
--include-listpython chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110_no_refs \
--tag CHI110 \
--no-referencespython chianti2atomneb.py \
--chianti-root ./chianti11 \
--out-dir ./atomneb_chianti110_list_only \
--tag CHI110 \
--include-list \
--no-referencesAfter conversion, inspect the output with Python:
from astropy.io import fits
for fname in ["AtomElj.fits", "AtomAij.fits", "AtomOmij.fits"]:
hdul = fits.open(f"./atomneb_chianti110/{fname}")
print(fname)
for i, hdu in enumerate(hdul):
print(i, hdu.name)Check one O III level table:
from astropy.io import fits
with fits.open("./atomneb_chianti110/AtomElj.fits") as hdul:
data = hdul["o_iii_elj"].data
print(data.names)
print(data[:5])Check one O III collision table:
from astropy.io import fits
with fits.open("./atomneb_chianti110/AtomOmij.fits") as hdul:
data = hdul["o_iii_omij_CHI110"].data
print(data.names)
print(data[0])AtomOmij.fitsstores effective collision strengths evaluated on a chosen temperature grid, not the original CHIANTI scaled spline coefficients.- The converter currently handles electron-impact collision strengths only.
- Proton collision data such as
.psplupsare ignored. - The converter is independent of ChiantiPy.
- The converter is independent of the
chianti-rawpackage, although both use the same parsing philosophy.
The detected options in the current script are:
--chianti-root--collision-format--include-list--ions--max-levels--no-overwrite--no-references--out-dir--tag--temp-grid--temp-log10-max--temp-log10-min--temp-points
For authoritative help:
python chianti2atomneb.py --help