plasma
Input data representing plasma background species.
Plasma input is required for simulations with collisions or collisional diagnostics enabled. This includes BBNBI5 and ASCOT-BMC.
Plasma profiles that have only radial dependency. |
|
Same input as |
- class a5py.ascot5io.plasma.plasma_1D(root, path, **kwargs)
Bases:
DataGroup
Plasma profiles that have only radial dependency.
- static create_dummy()
Create dummy data that has correct format and is valid, but can be non-sensical.
This method is intended for testing purposes or to provide data whose presence is needed but which is not actually used in simulation.
The dummy output is an uniform hydrogen plasma.
- Returns:
- data
dict
Input data that can be passed to
write_hdf5
method of a corresponding type.
- data
- plot_radial(rholim=None, densitylim=None, temperaturelim=None, axes=None)
Plot plasma profiles as a function of rho.
- Parameters:
- rholim[
float
,float
],optional
Limits on x-axis.
- densitylim[
float
,float
,float
],optional
Limits on the first y axis where the middle value is when the scale changes from logarithmic to linear [m^-3].
- temperaturelim[
float
,float
,float
],optional
Limits on the second y axis where the middle value is when the scale changes from logarithmic to linear [eV].
- axes
Axes
,optional
The axes where figure is plotted or otherwise new figure is created.
- rholim[
- read()
Read data from HDF5 file.
- Returns:
- data
dict
Data read from HDF5 stored in the same format as is passed to
write_hdf5()
.
- data
- static write_hdf5(fn, nrho, nion, anum, znum, mass, charge, rho, edensity, etemperature, idensity, itemperature, desc=None)
Write input data to the HDF5 file.
- Parameters:
- fn
str
Path to hdf5 file.
- nrho
int
Number of rho grid points.
- nion
int
Number of ion species.
- anumarray_like (nion,1)
Ion species atomic mass number
- znumarray_like (nion,1)
Ion species charge number.
- massarray_like (nion,1)
Ion species mass [amu].
- chargearray_like (nion,1)
Ion species charge [e].
- rhoarray_like (nrho,1)
rho grid, doesn’t have to be uniform.
- edensityarray_like (nrho,1)
Electron density [m^-3].
- etemperaturearray_like (nrho,1)
Electron temperature [eV].
- idensityarray_like (nrho,nion)
Ion density [m^-3].
- itemperaturearray_like (nrho,1)
Ion temperature [ev].
- desc
str
,optional
Input description.
- fn
- Returns:
- name
str
Name, i.e. “<type>_<qid>”, of the new input that was written.
- name
- Raises:
ValueError
If inputs were not consistent.
- class a5py.ascot5io.plasma.plasma_1DS(root, path, **kwargs)
Same input as
plasma_1D
but interpolated with splines.Spline interpolation could yield negative value even though the inputs were all positive. To avoid this, ASCOT5 internally takes a logarithm of the input data before constructing the splines. The actual values are then computed after the spline-evaluation. The logarithmic also helps to interpolate the values at the edge more accurately.
- static create_dummy()
Create dummy data that has correct format and is valid, but can be non-sensical.
This method is intended for testing purposes or to provide data whose presence is needed but which is not actually used in simulation.
The dummy output is an uniform hydrogen plasma.
- Returns:
- data
dict
Input data that can be passed to
write_hdf5
method of a corresponding type.
- data
- plot_radial(rholim=None, densitylim=None, temperaturelim=None, axes=None)
Plot plasma profiles as a function of rho.
- Parameters:
- rholim[
float
,float
],optional
Limits on x-axis.
- densitylim[
float
,float
,float
],optional
Limits on the first y axis where the middle value is when the scale changes from logarithmic to linear [m^-3].
- temperaturelim[
float
,float
,float
],optional
Limits on the second y axis where the middle value is when the scale changes from logarithmic to linear [eV].
- axes
Axes
,optional
The axes where figure is plotted or otherwise new figure is created.
- rholim[
- read()
Read data from HDF5 file.
- Returns:
- data
dict
Data read from HDF5 stored in the same format as is passed to
write_hdf5()
.
- data
- static write_hdf5(fn, nrho, nion, anum, znum, mass, charge, rhomin, rhomax, edensity, etemperature, idensity, itemperature, desc=None)
Write input data to the HDF5 file.
- Parameters:
- fn
str
Path to hdf5 file.
- nrho
int
Number of rho grid points.
- nion
int
Number of ion species.
- anumarray_like (nion,1)
Ion species atomic mass number
- znumarray_like (nion,1)
Ion species charge number.
- massarray_like (nion,1)
Ion species mass [amu].
- chargearray_like (nion,1)
Ion species charge [e].
- rhomin
float
Minimum rho grid value.
- rhomax
float
Maximum rho grid value.
- edensityarray_like (nrho,1)
Electron density [m^-3].
- etemperaturearray_like (nrho,1)
Electron temperature [eV].
- idensityarray_like (nrho,nion)
Ion density [m^-3].
- itemperaturearray_like (nrho,1)
Ion temperature [ev].
- desc
str
,optional
Input description.
- fn
- Returns:
- name
str
Name, i.e. “<type>_<qid>”, of the new input that was written.
- name
- Raises:
ValueError
If inputs were not consistent.