states

This utility function instantiates a structured numpy.ndarray of Monte Carlo states that represent photons.

Syntax

states(shape, **kwargs)

The shape argument determines the shape of the numpy.ndarray. Optional arguments can be provided to initialize specific fields. The available fields are listed below.

"direction"

Current direction (unit vector), using Cartesian coordinates.

"energy"

Current energy, in MeV.

"length"

Trajectory path length, in cm.

"position"

Current position, in cm, using Cartesian coordinates.

"weight"

Trajectory Monte Carlo weight.

Examples

Instantiate a size 3 array of photons with default values.

>>> states = goupil.states(3)

As before, but with a specified photon energy of 0.5 MeV for all states.

>>> states = goupil.states(3, energy=0.5)