PSF Module

penred phase space file module

pyPenred.psf.psf2ascii(filenameIn: str, filenameOut: str) tuple

Converts the binary Phase Space File into an ASCII file format.

Parameters:
  • filenameIn (str) – Path to the Phase Space File.

  • filenameOut (str) – Path to the converted Phase Space File into an ASCII format.

Returns:

A tuple containing the number of histories in the Phase Space File and the number of particle chuncks.

Return type:

tuple

Example

# Read the Phase space File and store the results
        results = pyPenred.psf.psf2ascii('psf.dat', 'psfASCII.dat')
pyPenred.psf.psfSpectre(filename: str, emin: SupportsFloat, emax: SupportsFloat, nbins: SupportsInt) tuple

Extracts the energy spectrum distribution of the particles from a Phase Space File.

Parameters:
  • filename (str) – Path to the Phase Space File.

  • emin (float) – Lower bound of energy range in eV (must be >= 0).

  • emax (float) – Upper bound of energy range in eV (must be > emin).

  • nbins (unsigned) – Number of linear-spaced energy bins between emin and emax.

Returns:

A tuple containing four tuples in the following order: energy bin edges, electron, gamma and positron spectrum.

Return type:

tuple

Example

# Read the Phase space File and store the results
        results = pyPenred.psf.psfSpectre('psf.dat', 0, 7e5, 200)