Model#

class aep8.Model(particle, solar, _geomag, _flux)[source]#

Bases: object

Trapped particle flux model for a given particle species and solar cycle phase.

Notes

Do not instantiate this class directly. Call the function aep8.model() to return an existing model.

Attributes Summary

particle

Particle species, "e" for electrons or "p" for protons.

solar

Phase in the solar cycle, "min" for solar minimum or "max" for solar maximum.

Methods Summary

differential_flux(location, time, energy)

Calculate the differential flux for a given time and location.

differential_flux_for_geomagnetic_coordinates(L, ...)

Calculate the differential flux for given geomagnetic coordinates.

geomagnetic_coordinates(location, time)

Calculate the geomagnetic coordinates for a given time and location.

integral_flux(location, time, energy)

Calculate the integrated flux for a given time and location.

integral_flux_for_geomagnetic_coordinates(L, ...)

Calculate the integrated flux for given geomagnetic coordinates.

Attributes Documentation

Parameters:
particle: Literal['e', 'p'] = <dataclasses._MISSING_TYPE object>#

Particle species, "e" for electrons or "p" for protons.

solar: Literal['min', 'max'] = <dataclasses._MISSING_TYPE object>#

Phase in the solar cycle, "min" for solar minimum or "max" for solar maximum.

Methods Documentation

differential_flux(location, time, energy)[source]#

Calculate the differential flux for a given time and location.

Parameters:
  • location (EarthLocation) – Location at which to calculate the geomagnetic field.

  • time (Time) – Time at which to calculate the geomagnetic field.

  • energy (Annotated[Quantity, PhysicalType({'energy', 'torque', 'work'})]) – Energy per particle.

Returns:

Differential particle flux.

Return type:

Annotated[Quantity, Unit(“1 / (MeV s cm2)”)]

Notes

This is a lightweight wrapper around Model.integral_flux() that performs first-order finite differences.

differential_flux_for_geomagnetic_coordinates(L, B, energy)[source]#

Calculate the differential flux for given geomagnetic coordinates.

Parameters:
Returns:

Differential particle flux.

Return type:

Annotated[Quantity, Unit(“1 / (MeV s cm2)”)]

Notes

This is a lightweight wrapper around Model.integral_flux_for_geomagnetic_coordinates() that performs first-order finite differences.

geomagnetic_coordinates(location, time)[source]#

Calculate the geomagnetic coordinates for a given time and location.

Parameters:
  • location (EarthLocation) – Location at which to calculate the geomagnetic field.

  • time (Time) – Time at which to calculate the geomagnetic field.

Returns:

  • L – McIlwain L.

  • BBo – Local magnetic field divided by magnetic field at the equator.

Return type:

tuple[ArrayLike, ArrayLike]

integral_flux(location, time, energy)[source]#

Calculate the integrated flux for a given time and location.

Parameters:
  • location (EarthLocation) – Location at which to calculate the geomagnetic field.

  • time (Time) – Time at which to calculate the geomagnetic field.

  • energy (Annotated[Quantity, PhysicalType({'energy', 'torque', 'work'})]) – Energy per particle.

Returns:

Integrated particle flux up to the given energy.

Return type:

Annotated[Quantity, Unit(“1 / (s cm2)”)]

integral_flux_for_geomagnetic_coordinates(L, B, energy)[source]#

Calculate the integrated flux for given geomagnetic coordinates.

Parameters:
Returns:

Integrated particle flux up to the given energy.

Return type:

Annotated[Quantity, Unit(“1 / (s cm2)”)]