CrossTable

class PlasmaCalcs.quantities.collisions.cross_section_tools.CrossTable(kT, cross, crossunits, fc=1.3333333333333333)

Bases: object

stores data about a cross sections table.

kT: temperatures [eV]. array of values cross: cross sections [crossunits]. array of values crossunits: conversion factor; cross * crossunits = cross section [cm^-2]. single value.

fc numerical factor, based on convention of the cross table.
when getting the collision frequency, the formula needs to use fc * cross.
PlasmaCalcs ‘collisions_cross_section’ (‘collcross’) already includes the fc factor.
The value of fc should probably be set as follows:
tables utilizing Bruno+2010 should have fc=4/3.
tables utilizing Vranjes+2013 should have fc=1.
By default, should prefer to use Bruno+2010 (hence the default is 4/3),
as explained in Wargnier+2022.
note: some cross tables are available by default;
these can be loaded with cls.default(name), where name is one of cls.DEFAULTS.keys().

Methods

__getitem__(key)

returns self.key, if key in self.keys().

from_defaults(name)

return CrossTable from one of the default cross table files.

from_file(filename[, fc])

return CrossTable from file.

interp(value[, input, output, log])

interpolate value from input (default: 'T') to output (default: 'collcross_si')

keys()

returns keys of self, as a list.

lims(attr)

return self.attr.min(), self.attr.max()

_default_file(name)

return (abspath to one of the default cross table files, fc for that file)

_get_T()

return T based on self.kT

Attributes

DEFAULTS

T

temperatures [K], associated with kT.

collcross_si

cross sections, in [m^-2], multiplied by fc.

cross_si

cross sections, in [m^-2].

property T

temperatures [K], associated with kT.

__getitem__(key)

returns self.key, if key in self.keys().

classmethod _default_file(name)

return (abspath to one of the default cross table files, fc for that file)

name = one of cls.DEFAULTS.keys().
_get_T()

return T based on self.kT

property collcross_si

cross sections, in [m^-2], multiplied by fc.

property cross_si

cross sections, in [m^-2].

classmethod from_defaults(name)

return CrossTable from one of the default cross table files.

name = one of cls.DEFAULTS.keys().
classmethod from_file(filename, fc=1.3333333333333333)

return CrossTable from file. Be sure to put the appropriate value of fc.

Bruno+2010 should have fc=4/3. Vranjes+2013 should have fc=1.
see help(CrossTable) for more fc info.
interp(value, input='T', output='collcross_si', *, log=True, **kw_interp)

interpolate value from input (default: ‘T’) to output (default: ‘collcross_si’)

returns result like value (e.g., number if number; array if array),
with numerical values corresponding to output variable instead of input variable.
value: number or array-like
values to interpolate
note: if value is an xarray, return an xarray with same dims, attrs, and coords as value.
input: str
input variable; should be an attribute of self.
value is a value of this variable.
output: str
output variable; should be an attribute of self.
result is a value of this variable.
log: bool, default True
whether to interpolate on log scale.
True –> interpolate log10(value) against log10(input).
additional kwargs go to np.interp.
example: interp(2000, ‘T’, ‘cross_si’) –> single value, with cross section at T=2000 K.
keys()

returns keys of self, as a list.

These are: [‘kT’, ‘cross’, ‘cross_si’, ‘crossunits’, ‘T’]
lims(attr)

return self.attr.min(), self.attr.max()