gtsimulation.medium#

Medium models.

This subpackage provides an abstract interface for custom medium implementations as well as several predefined models describing physical media used in simulations.

class gtsimulation.medium.GTGeneralMedium[source]#

Abstract base class for medium models.

At each step of the trajectory, the simulator calls calculate_model with the particle coordinates in metres and then reads the result with the get_* methods. A subclass stores the result of calculate_model in the object: get_density returns the mass density in kg/m3, get_element_list returns the chemical symbols of the elements and get_element_abundance returns their mass fractions.

abstractmethod calculate_model(x, y, z)[source]#

Evaluate the model at the given point.

The result is stored in the object and is returned by the get_* methods.

Parameters:
x, y, zfloat

Coordinates of the point, in metres.

abstractmethod get_density()[source]#

Return the mass density at the last evaluated point.

Returns:
float

Mass density, in kg/m3.

abstractmethod get_element_abundance()[source]#

Return the mass fractions of the elements at the last evaluated point.

Returns:
array_like of float

Mass fractions of the elements in the order of get_element_list, summing to 1.

abstractmethod get_element_list()[source]#

Return the chemical symbols of the elements forming the medium.

Returns:
list of str

Element symbols, such as "H" or "He", in the order used by get_element_abundance.

class gtsimulation.medium.GTUniformMedium(density=1.0, element='H')[source]#
calculate_model(x, y, z)[source]#

Evaluate the model at the given point.

The result is stored in the object and is returned by the get_* methods.

Parameters:
x, y, zfloat

Coordinates of the point, in metres.

get_density()[source]#

Return the mass density at the last evaluated point.

Returns:
float

Mass density, in kg/m3.

get_element_abundance()[source]#

Return the mass fractions of the elements at the last evaluated point.

Returns:
array_like of float

Mass fractions of the elements in the order of get_element_list, summing to 1.

get_element_list()[source]#

Return the chemical symbols of the elements forming the medium.

Returns:
list of str

Element symbols, such as "H" or "He", in the order used by get_element_abundance.

class gtsimulation.medium.GTVacuum[source]#

Modules