marker

Markers whose orbits are solved within the ASCOT5 code.

a5py.ascot5io.marker.Prt

Marker input representing physical particles.

a5py.ascot5io.marker.GC

Particle input in guiding-center coordinates.

a5py.ascot5io.marker.FL

Magnetic-field-line tracer input.

class a5py.ascot5io.marker.Prt(root, path, **kwargs)

Bases: Marker

Marker input representing physical particles.

Particle phase-space is (r, phi, z, pr, pphi, pz), where r, phi, and z are particle position in cylindrical coordinates, and pr, phi, and pz are its momentum components.

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.

This dummy input sets electric field to zero everywhere.

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, n, ids, mass, charge, r, phi, z, vr, vphi, vz, anum, znum, weight, time, desc=None)

Write input data to the HDF5 file.

Parameters:
fnstr

Full path to the HDF5 file.

nint

Number of markers.

idsarray_like (n,)

Unique identifier for each marker (must be a positive integer).

massarray_like (n,)

Mass [amu].

chargearray_like (n,)

Charge [e].

rarray_like (n,)

Particle R coordinate [m].

phiarray_like (n,)

Particle phi coordinate [deg].

zarray_like (n,)

Particle z coordinate [m].

vrarray_like (n,)

Particle velocity R-component [m/s].

vphiarray_like (n,)

Particle velocity phi-component [m/s].

vzarray_like (n,)

Particle velocity z-component [m/s].

anumarray_like (n,)

Marker species atomic mass number.

znumarray_like (n,)

Marker species charge number.

weightarray_like (n,)

Particle weight [markers/s].

timearray_like (n,)

Particle initial time [s].

descstr, optional

Input description.

Returns:
namestr

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

Raises:
ValueError

If inputs were not consistent.

class a5py.ascot5io.marker.GC(root, path, **kwargs)

Bases: Marker

Particle input in guiding-center coordinates.

The guiding center phase-space is (R, Phi, Z, mu, ppar, zeta), where R, Phi, Z are the guiding center position in cylindrical coordinates, mu is the magnetic moment (first adiabatic invariant), and ppar is the parallel momentum along the magnetic field line). The gyro-angle zeta is an ignorable quantity in guiding-center integration, but it is used in guiding-center-to-particle transformation.

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.

This dummy input sets electric field to zero everywhere.

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, n, ids, mass, charge, r, phi, z, energy, pitch, zeta, anum, znum, weight, time, desc=None)

Write input data to the HDF5 file.

Parameters:
fnstr

Full path to the HDF5 file.

nint

Number of markers.

idsarray_like (n,)

Unique identifier for each marker (must be a positive integer).

massarray_like (n,)

Mass [amu].

chargearray_like (n,)

Charge [e].

rarray_like (n,)

Guiding center R coordinate [m].

phiarray_like (n,)

Guiding center phi coordinate [deg].

zarray_like (n,)

Guiding center z coordinate [m].

energyarray_like (n,)

Guiding center energy [eV].

pitcharray_like (n,)

Guiding center pitch (v_para/v_tot).

zetaarray_like (n,)

Guiding center gyroangle [rad].

anumarray_like (n,)

Marker species atomic mass number.

znumarray_like (n,)

Marker species charge number.

weightarray_like (n,)

Guiding center weight [markers/s].

timearray_like (n,)

Guiding center initial time [s].

descstr, optional

Input description.

Returns:
namestr

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

Raises:
ValueError

If inputs were not consistent.

class a5py.ascot5io.marker.FL(root, path, **kwargs)

Bases: Marker

Magnetic-field-line tracer input.

These are markers that trace magnetic field lines exactly. They don’t represent physical particles except that for calculating quantities like mileage, they are assumed to be photons travelling at the speed of light.

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.

This dummy input sets electric field to zero everywhere.

Returns:
datadict

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

eval_pitch(ascotpy)

Evaluate pitch.

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, n, ids, r, phi, z, pitch, weight, time, desc=None)

Write input data to the HDF5 file.

Parameters:
fnstr

Full path to the HDF5 file.

nint

Number of markers.

idsarray_like (n,)

Unique identifier for each marker (must be a positive integer).

rarray_like (n,)

Magnetic field line R coordinate [m].

phiarray_like (n,)

Magnetic field line phi coordinate [deg].

zarray_like (n,)

Magnetic field line z coordinate [m].

pitcharray_like (n,)

Sign which defines the direction field line is traced, + is parallel

weightarray_like (n,)

Magnetic field line weight [markers/s].

timearray_like (n,)

Magnetic field line initial time [s].

descstr, optional

Input description.

Returns:
namestr

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

Raises:
ValueError

If inputs were not consistent.