Function adas.adf10_update

def adf10_update(uid='adas', year=96, root_dir=None, prefix='pj', seq=None, supp_dir=None, adf10types=None, out_dir=None, replace=False)

Replaces, or inserts, data from an adas208 run into an iso-electronic adf10 file.

Parameters

uid : str
owner of the iso-electronic adf10 files, defaults to 'adas'
year : int
year of iso-electronic adf10 data
root_dir : str
alternative definition for iso-electronic adf10 files
prefix : str
prefix of adf10 set (usually 'pj' but must be set)
seq : str
iso-electronic sequence
supp_dir : str
directory with the adas208 partial adf10 files, defaults to the launch directory
adf10types : str, list
the required adf10 classes to be processed
      'acd' : recombination
      'scd' : ionisation
      'qcd' : metastable cross coupling
      'xcd' : parent cross coupling
      'ccd' : charge exchange recomb.
      'prb' : recomb. + bremss. power
      'plt' : total line power
      'prc' : charge exchange power
out_dir : str
directory for the updated iso-electronic adf10 files, defaults to the launch directory
replace : bool
if True replace the iso-electronic files (dangerous) if False write new iso-electronic files to out_dir (default)

Returns

nothing - the output is files written to disk
 

Notes

Pure python code. A different implementation of adas403 which is more suitable for scripting.

The code assumes the partial adf10 files from adas208 are named acd208.pass etc. and that the iso-electronic files are in a typical directory structure, eg /home/adas/adas/adf10/XXX96/pj#XXX96_YYZZ.dat, where XXX is the adf10 type, YY the sequence and ZZ the parent/ground. If root_dir is set the files are assumed to be in root_dir and named following the template of pj#XXX96_YYXX.dat.

In the iso-electronic adf10 files temperature and density are in reduced units and powers are in ergs/s cm3. For adas208 adf10 these are eV, cm3 and W cm3. The user must ensure that the adas208 data are the same size and convert correctly onto the iso-electronic values. There is some testing which uses the allclose function from numpy but the tolerances may not be suited to all cases.

References

ADAS manual description of adf10: http://www.adas.ac.uk/man/appxa-10.pdf See also the maunal for adas403: http://www.adas.ac.uk/man/chap4-03.pdf

Version History

  • Martin O'Mullane, 30-03-2022
    • First version

Example

Run adas208 for a He-like element, on the GCR temperature and density grid and set the metastables to be ground and 1s 2s 3S level. With the option, gcr=True, adas208 will generate a set of files named acd208.pass etc. To insert, or add, these to the central ADAS scd, qcd and met iso-electronic adf10 files,

>>> import adas as adas
>>> adas.adf10_update(seq='he', adf10types=['scd', 'qcd', 'met'], out_dir='./')

Note that the routine writes the new iso-electronic adf10 files to the launch directory.