Function adas.write_adf11

def write_adf11(file=None, fulldata=None, comments=None, project='Unknown')

Write an adf11 source/power coefficient file from a user supplied fulldata dictionary.

Parameters

file : str
full name of adf11 file.
fulldata : dict
contents of the adf11 file
    'iz0'       : nuclear charge
    'class'     : One of 'acd','scd','ccd','prb','prc',
                         'qcd','xcd','plt','pls','zcd',
                         'ycd','ecd'
    'is1min'    : minimum ion charge + 1
                  (generalised to connection vector index)
    'is1max'    : maximum ion charge + 1
                  (note excludes the bare nucleus)
                  (generalised to connection vector index
                   and excludes last one which always remains
                   the bare nucleus)
    'icnctv'    : connection vector of number of partitions
                  of each superstage in resolved case
                  including the bare nucleus
                  1st dim: connection vector index
    'dnr_elem'  : donor element name (for ccd and prc)
    'dnr_ams'   : donor element mass (for ccd and prc)
    'isppr'     : 1st (parent) index for each partition block
                  1st dim: index of (sstage, parent, base)
                           block in isonuclear master file
    'ispbr'     : 2nd (base) index for each partition block
                  1st dim: index of (sstage, parent, base)
                           block in isonuclear master file
    'isstgr'    : s1 for each resolved data block
                  (generalises to connection vector index)
                  1st dim: index of (sstage, parent, base)
                           block in isonuclear master file
    'idmax'     : number of density values in isonuclear master file
    'itmax'     : number of temperature  values in isonuclear master file
    'ddens'     : log10(electron density) (cm-3) from adf11
    'dtev'      : log10(electron temperature) (eV) from adf11
    'deng'      : log10(energy bins) (eV) from adf11
    'drcof'     : if(iclass <=9):
                    log10(coll.-rad. coefft.) from isonuclear master file
                  if(iclass >=10):
                    coll.-rad. coefft. from isonuclear master file
                  1st dim: index of (sstage, parent, base)
                            block in isonuclear master file
                  2nd dim: electron temperature index
                  3rd dim: electron density index
    'lres'      : True  => partial file
                  False => not partial file
    'lptn'      : True  => partition block present
                  False => partition block not present
comments : list
comments for the end of the file as a list of strings.
project : str
project name. Default is 'Unknown'

Notes

Not all entries in the adf11 fulldata dictionary are required. Above are listed what is used by this routine depending on whether it is a standard or metastable-resolved adf1. lptn and lres are queried and suitable defaults are set if not present. dnr_elem and dnr_ams are only required for ccd and prc files.

adf11 files can be tagged with a project which is listed on the first line of the file. It is not obligatory.

Version History

  • Martin O'Mullane, 13-11-2019

    • First version
  • Martin O'Mullane, 28-11-2021

    • Adjust format statements due to change in array2strlist.
  • Martin O'Mullane, 17-10-2023

    • Write energy-resolved version if 'deng' is in fulldata.

Example

Round trip of carbon ionisation rate.

>>> import adas as adas
>>> file='/home/adas/adas/adf11/scd96/scd96_c.dat'
>>> fulldata=adas.xxdata_11(file, adf11type='scd')
>>> my_comments=['Testing write_adf11', 'By me, today']
>>> my_project='A test project'
>>> my_file='/tmp/test_write_adf11.dat'
>>> adas.write_adf11(file=my_file, fulldata=fulldata, 
...                  comments=my_comments, project='my_project')