Function adas.write_adf06

def write_adf06(file=None, fulldata=None, sort=False, comments=None)

Write an adf06 specific ion file from a user supplied fulldata dictionary.

Parameters

file : str
full name of adf06 file.
fulldata : dict
contents of the adf06 file
    'adf06_type' :  variant of the adf06 file
                      1 = collision strengths vs E/delta_E
                      2 = unused
                      3 = effective collision strengths

    'iz0'        :  nuclear charge
    'iz'         :  recombined ion charge
    'ia'         :  energy level index number (array)
    'cstrga'     :  nomenclature/configuration for level (array)
    'isa'        :  multiplicity for level (array)
                       note: (isa-1)/2 = quantum number (s)
    'ila'        :  quantum number (l) for level (array)
    'xja'        :  quantum number (j-value) for level (array)
                       note: (2*xja)+1 = statistical weight
    'wa'         :  energy relative to level 1 (cm-1) for level (array)
    'npla'       :  number of parent/zeta contributions to ionisation
                    of level (array)
    'ipla'       :  parent index of contributions to ionisation
                    of level (array[parent index, level index])
    'zpla'       :  effective zeta parameter of contributions to ionisation
                    of level (array[parent index, level index])
    'bwnoa'      :  ionisation potential (cm-1) of parents (array)
    'cprta'      :  parent name in brackets (array)
    'prtwta'     :  parent weight for parents in bwnoa array
    'eorb'       :  orbital energies (Rydberg) of occupied orbitals
                    in the configuration present (array)
    'te'         :  electron temperatures (K) or energy parameter (array)
    'lower'      :  lower energy level index for excitation (array)
    'upper'      :  upper energy level index for excitation (array)
    'aval'       :  E2 quadrupole A-value (s-1) (array)
                           1st dimension - transition number
    'gamma'      :  gamma (array [transition, te, projectile]
                      - effective collision strength for type 3 adf06
                      - collision strength for type 1 and 5
                           1st dimension - transition number
                           2nd dimension - temperature/energy
                           3rd dimension - ion projectile case
    'beth'       :  Bethe coefficient

    'projectile'        : name of projectile (array), eg 7^Li
    'mass_target'       : mass of target (array)
    'charge_projectile' : charge of projectile (array)
    'mass_projectile'   : mass of projectile (array)

    'level_ion'  :  ionising level index for ionisation (array)
    'parent_ion' :  parent level index for ionisation (array)
    'ion'        :  ionisation rate (cm3 s-1) (array[te, transition, projectile])
    'level_cx'   :  capturing level index for charge exchange (array)
sort : bool
if set to True, sort the excitation indices
comments : list
comments for the end of the file as a list of strings.

Notes

Not all of the entries in an adf06 fulldata dictionary are needed (yet). The above is the subset required.

Any meaningful A-value is the electric quadrupole (E2) transition. It is not dependent on the projectile and is repeated in each projectile block.

Version History

  • Martin O'Mullane, 23-02-2021

    • First version
  • Martin O'Mullane, 10-06-2022

    • Ensure lower and upper are numpy arrays and not lists.
    • Enable more than one projectile.
    • Check if is_beth is True before composing transition line.

Example

Round trip of proton impact on Li0.

>>> import adas as adas
>>> file='/home/adas/adas/adf06/lilike/lilike_aug99#li0_t1.dat
>>> fulldata=adas.xxdata_06(file)
>>> my_comments=['C Testing write_adf06', 'C By me, today']
>>> my_file='/tmp/test_write_adf06.dat'
>>> adas.write_adf06(file=my_file, fulldata=fulldata,
...                  comments=my_comments)