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.
- 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.
Modules