boozer

Input representing mapping from real-space to Boozer coordinates.

This input is required in simulations where the input with MHD eigenfunctions is used.

a5py.ascot5io.boozer.Boozer

Mapping between cylindrical and Boozer coordinates assuming that psi is axisymmetric.

class a5py.ascot5io.boozer.Boozer(root, path, **kwargs)

Bases: DataGroup

Mapping between cylindrical and Boozer coordinates assuming that psi is axisymmetric.

This input can be automatically created from tokamak field input.

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 a very large rectangular wall.

Returns:
datadict

Input data that can be passed to write_hdf5 method of a corresponding type.

read()

Read data from HDF5 file.

Returns:
datadict

Data read from HDF5 stored in the same format as is passed to write_hdf5().

static write_hdf5(fn, psimin, psimax, npsi, ntheta, nthetag, rmin, rmax, nr, zmin, zmax, nz, r0, z0, psi0, psi1, psi_rz, theta_psithetageom, nu_psitheta, nrzs, rs, zs, desc=None)

Write input data to the HDF5 file.

Note: the data in theta_psithetageom is assummed to span the whole interval (i.e. coinciding start and end points included) in the angular axis. This is needed so that we can add “padding” to this dataset. To be mores specic, the padding means that the dataset is artificially extended in the angular space. This is needed so that ASCOT5 can use the natural boundary condition when fitting the splines to the data: the data is effectively periodic but the periodic condition would assume x_end = x_ini when in fact x_end = x_ini + 2*pi e.g. for theta_psithetageom.

Note that the nu_psitheta data is also periodic, but there it is valid to use the natural boundary condition which sets y’’ = 0 (the nu data is has a local extrema at theta=0).

Parameters:
fnstr

Full path to the HDF5 file.

psiminfloat

Minimum psi grid value.

psimaxfloat

Maximum psi grid value.

npsiint

Number of psi grid points.

nthetaint

Number of boozer theta grid values.

nthetagint

Number of geometric theta grid values.

rminfloat

Minimum R grid value.

rmaxfloat

Maximum R grid value.

nrint

Number of R grid points.

zminfloat

Minimum z grid value.

zmaxfloat

Maximum z grid value.

nzint

Number of z grid points.

r0float

Magnetic axis R coordinate.

z0float

Magnetic axis z coordinate.

psi0float

Coordinate psi on axis.

psi1float

Coordinate psi on separatrix.

psi_rzarray_like (nr,nz)

Coordinate psi(R,z).

theta_psithetageomarray_like (npsi,nthetag)

Coordinate theta(psi, thetag).

nu_psithetaarray_like (npsi,ntheta)

nu(psi, theta).

nrszint

Number of separatrix Rz points.

rsarray_like (nrsz,1)

Separatrix R coordinates, start and end points should coincide.

zsarray_like (nrsz,1)

Separatrix z coordinates, start and end points should coincide.

descstr, optional

Input’s description.

Returns:
namestr

Name, i.e. “<type>_<qid>”, of the new input that was written.

Raises:
ValueError

If inputs were not consistent.