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:
DataGroupPlasma 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_hdf5method of a corresponding type.
- data
- plot_radial(rholim=None, rholim_sol=None, densitylim=None, densitylim_sol=None, temperaturelim=None, temperaturelim_sol=None, axes=None, plot_sol_separately=False)
Plot plasma profiles as a function of rho. If
plot_sol_separatelyis True, then the core and scrape-off layer are plotted separately.- Parameters:
- rholim[
float,float],optional Limits on x-axis. If plot_sol_separately is True, then the limits are applied to the left side of x-axis.
- rholim_sol[
float,float],optional Limits on the right side of x-axis when
plot_sol_separatelyis True.- densitylim[
float,float,float]or[float,float],optional Limits on the first y axis where the middle value is when the scale changes from logarithmic to linear [m^-3]. If
plot_sol_separatelyis True, only the first and last values are used.- densitylim_sol[
float,float],optional Limits on the sol y axis when
plot_sol_separatelyis True.- temperaturelim[
float,float,float]or[float,float],optional Limits on the second y axis where the middle value is when the scale changes from logarithmic to linear [eV]. If
plot_sol_separatelyis True, only the first and last values are used.- temperaturelim_sol[
float,float],optional Limits on the sol y axis when
plot_sol_separatelyis True.- axes
Axes,optional The axes where figure is plotted or otherwise new figure is created. If
plot_sol_separatelyis True, there should be two axes: axes[0] for core and axes[1] for SOL.- plot_sol_separatelybool,
optional If True, plot core on left-hand side and SOL on the right-hand side.
- 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, vtor, 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.
- vtorarray_like (nrho,1)
Plasma rotation [rad/s].
- 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:
ValueErrorIf inputs were not consistent.
- class a5py.ascot5io.plasma.plasma_1DS(root, path, **kwargs)
Same input as
plasma_1Dbut 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_hdf5method of a corresponding type.
- data
- plot_radial(rholim=None, rholim_sol=None, densitylim=None, densitylim_sol=None, temperaturelim=None, temperaturelim_sol=None, axes=None, plot_sol_separately=False)
Plot plasma profiles as a function of rho. If
plot_sol_separatelyis True, then the core and scrape-off layer are plotted separately.- Parameters:
- rholim[
float,float],optional Limits on x-axis. If plot_sol_separately is True, then the limits are applied to the left side of x-axis.
- rholim_sol[
float,float],optional Limits on the right side of x-axis when
plot_sol_separatelyis True.- densitylim[
float,float,float]or[float,float],optional Limits on the first y axis where the middle value is when the scale changes from logarithmic to linear [m^-3]. If
plot_sol_separatelyis True, only the first and last values are used.- densitylim_sol[
float,float],optional Limits on the sol y axis when
plot_sol_separatelyis True.- temperaturelim[
float,float,float]or[float,float],optional Limits on the second y axis where the middle value is when the scale changes from logarithmic to linear [eV]. If
plot_sol_separatelyis True, only the first and last values are used.- temperaturelim_sol[
float,float],optional Limits on the sol y axis when
plot_sol_separatelyis True.- axes
Axes,optional The axes where figure is plotted or otherwise new figure is created. If
plot_sol_separatelyis True, there should be two axes: axes[0] for core and axes[1] for SOL.- plot_sol_separatelybool,
optional If True, plot core on left-hand side and SOL on the right-hand side.
- 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, vtor, 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.
- vtorarray_like (nrho,1)
Plasma rotation [rad/s].
- 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:
ValueErrorIf inputs were not consistent.