lir_achem.class_definition
Classes
|
Each species is declared as a class, with two attributes: their altitudes (in km) and number densities (in cm-3) The electrons are considered separately as they are initialized from the FIRI model |
|
Each species is declared as a class, with two attributes: their altitudes (in km) and number densities (in cm-3) Only altitudes is required for the initialisation, as all others are initialised to zeros |
|
The neutral species are declared apart from the others. |
|
EUV, hard X-rays and soft X-rays from the Sun. |
- class lir_achem.class_definition.ion_species(altitudes, z)[source]
Bases:
objectEach species is declared as a class, with two attributes: their altitudes (in km) and number densities (in cm-3) Only altitudes is required for the initialisation, as all others are initialised to zeros
- Parameters:
altitudes – Altitudes in the D-region (in km)
density – Number density (in cm-3)
z – Number charge of the ion
- class lir_achem.class_definition.electrons(glat, glon, time_here, f107, n_here)[source]
Bases:
objectEach species is declared as a class, with two attributes: their altitudes (in km) and number densities (in cm-3) The electrons are considered separately as they are initialized from the FIRI model
Class attributes:
- Parameters:
altitudes – Altitudes in the D-region (in km)
densities – Number densities (in cm-3) in the D-region
temperature – Temperature (in K), assumed to be the same as the neutrals
Parameters for the initialisation:
- Parameters:
glat – Latitude (in °) of the point of interest
glon – Longitude (in °) of the point of interest
time_here – Datetime, time of the initialisation. It must contain the information on the timezone in order to compute the sza
f107 – f10.7 index of the day in question
n_here – Neutrals class instance
- class lir_achem.class_definition.neutrals(time_here, altitudes, glat, glon, alpha=1, manual_ini=False, ini_file=None)[source]
Bases:
objectThe neutral species are declared apart from the others. Because they dominate in the D-region, we consider that they do not interact in the ion dynamics other than as a reservoir for the chemical reactions
All neutral densities are initialised from the MSISE-00 model.
Parameters for the initialisation:
- param time_here:
Time of interest (datetime, must be timezone blind)
- param altitudes:
Altitude array (in km)
- param glat:
Latitude of interest (in °)
- param glon:
Longitude of interest (in °)
- Class attributes:
- param glat:
Latitude (in °) of the point of interest
- param glon:
Longitude (in °) of the point of interest
- param altitudes:
Altitudes in the D-region (in km)
- param N2:
Number densities (in cm-3) of N2 in the D-region
- param O2:
Number densities (in cm-3) of O2 in the D-region
- param O:
Number densities (in cm-3) of O in the D-region
- param He:
Number densities (in cm-3) of He in the D-region
- param Ar:
Number densities (in cm-3) of Ar in the D-region
- param H:
Number densities (in cm-3) of H in the D-region
- param N:
Number densities (in cm-3) of N in the D-region
- param AO:
Number densities (in cm-3) of anomalous O in the D-region
- param NO:
Number densities (in cm-3) of NO in the D-region
- param H2O:
Number densities (in cm-3) of H2O in the D-region
- param Tn:
Temperature (in K) in the D-region
- param Total:
Total mass density (in kg.cm-3)
- param f107:
Value of f107. It is not an attribute of the neutral densities themselves, but it is easier to store it here
- param M:
Addition of O2 and N2 (here because we use it a lot)
- param O3:
Number density (in cm-3) of ozone in the D-region
- class lir_achem.class_definition.radiation(today, file_EUV, file_XR, altitudes_D, neutrals_here, chi)[source]
Bases:
objectEUV, hard X-rays and soft X-rays from the Sun. The absorbed fluxes are given by abs_flux = flux*np.exp(-tau) where tau depends on the wavelength
- Parameters:
HXR – Hard X-ray flux at the time demanded
SXR – Soft X-ray flux at the time demanded
EUV – EUV flux at the time demanded
EUV_times – Time array for EUV data (from GOES daily average file)
EUV_array – Lyman-alpha data from GOES
XR_times – Time array for the XR from GOES
SXR_array – SXR data from GOES
HXR_array – HXR data from GOES
tau_HXR – Absorbed hard X-ray flux
tau_SXR – Absorbed soft X-ray flux
tau_EUV – Absorbed EUV flux
Ch – Chapman function for all altitudes
H – Atmosphere scale height (in km)
altitudes_D – Altitudes (in km) in the D-region
bin_0 – Integrated HXR flux between 0.05 and 0.1 nm
tau_HXR_0 – Tau_HXR for bin_0
bin_1 – Integrated HXR flux between 0.1 and 0.15 nm
tau_HXR_1 – Tau_HXR for bin_1
bin_2 – Integrated HXR flux between 0.15 and 0.2 nm
tau_HXR_2 – Tau_HXR for bin_2
bin_3 – Integrated HXR flux between 0.2 and 0.25 nm
tau_HXR_3 – Tau_HXR for bin_3
bin_4 – Integrated HXR flux between 0.25 and 0.3 nm
tau_HXR_4 – Tau_HXR for bin_4
bin_5 – Integrated HXR flux between 0.3 and 0.35 nm
tau_HXR_5 – Tau_HXR for bin_5
bin_6 – Integrated HXR flux between 0.35 and 0.4 nm
tau_HXR_6 – Tau_HXR for bin_6
Phi_HXR_bins – Phi_HXR in the shape (bins * altitudes). It is computed in ‘cs.compute_photon_flux’ and called in ‘chemistry_mr_eq’
- get_flux_now(time_s, today)[source]
Updates the XR flux (the EUV is a daily average)
- Parameters:
time_s – Time since the start (in s)
today – Datetime of the start of the computation
- update_chi(today, n_here)[source]
Updates the solar zenith angle and recomputes taus, Ch and H
- Parameters:
today – Datetime, time of interest. Must be timezone unaware
glat/glon – geographic latitude and longitude
n_here – Neutrals class instance
- bin_HXR_flux()[source]
Bins GOES HXR flux (0.05 - 0.4 nm) into bins with 0.05 nm length, following Siskind et al., 2022 Does not return anything, but puts the integrated flux in each bin as attributes of the radiation class. For example, bin_0 contains the integrated flux between 0.05 and 0.1 nm.
It is considered that the spectrum is linear between 0.05 and 0.15 nm, and increases by a factor of 100. It similarly increases by a factor 5 between 0.15 and 0.4 nm (See Fig. 1, Siskind et al., 2022)
If M is the flux at 0.05 nm, the total integral between 0.05 nm and 0.4 nm is given by:
A = M (0.5*0.1nm*99 + 0.5*0.25nm*400 + 0.25nm*99) = M * B