Empirical models

eppaurora.models.ssusiq2023

Empirical model for auroral ionization rates

Implements the empirical model for auroral ionization, derived from SSUSI UV observations [SB23].

[SB23]

Bender et al., in prep., 2023, preprint: https://doi.org/10.48550/arXiv.2312.11130

eppaurora.models.ssusiq2023.ssusiq2023(gmlat, mlt, alt, sw_coeffs, coeff_ds=None, interpolate=False, method='linear', return_var=False)[source]
Parameters:
  • gmlat (float) – Geomagnetic latitude in [degrees].

  • mlt (float) – Magnetic local time in [hours].

  • alt (float) – Altitude in [km]

  • sw_coeffs (array_like or xarray.DataArray) – The space weather index values to use (for the requested time(s)), should be of shape (N, M) with N = number of proxies, currently 4: [Kp, PC, Ap, log(f10.7_81ctr_obs)]. The xarray.DataArray should have a dimension named “proxy” with matching coordinates: [“Kp”, “PC”, “Ap”, “log_f107_81ctr_obs”] All the other dimensions will be broadcasted.

  • coeff_ds (xarray.Dataset, optional (default: None)) – Dataset with the model coefficients, None uses the packaged version.

  • interpolate (bool, optional (default: False)) – If True, uses bilinear interpolate in MLT and geomagnetic latitude, using periodic (24h) boundary conditions in MLT. Otherwise, the closest MLT/geomagnetic latitude bin will be selected.

  • method (str, optional (default: "linear")) – Interpolation method to use, see scipy.interpolate.interpn for options. Only used if interpolate is True.

  • return_var (bool, optional (default: False)) – If True, returns the predicted variance in addition to the values, otherwise only the mean prediction is returned.

Returns:

  • q (xarray.DataArray) – log(q), where q is the ionization rate in [cm⁻³ s⁻¹] if return_var is False.

  • q, var(q) (tuple of xarray.DataArray`s) – log(q) and var(log(q)) where q is the ionization rate in [cm⁻³ s⁻¹] if `return_var is True.

eppaurora.models.ssusiq2023.ssusiq2023_coeffs(file=None)[source]

SSUSI ionization rate model coefficients

Returns the fitted ionization rate model coefficents as read from the coefficient netcdf file.

Parameters:

file (str, optional) – The coefficient file, defaults to the packaged coefficients.

Returns:

coeffs – The default fitted model coefficients as read from the file.

Return type:

xarray.Dataset

eppaurora.models.zhangpaxton2008

Empirical model for electron energy and flux

Implements the empirical Kp-driven model for auroral electrons, providing mean energy and energy flux as described in [ZP08].

[ZP08]

Zhang and Paxton, JASTP, 70, 1231–1242, 2008, https://doi.org/10.1016/j.jastp.2008.03.008

eppaurora.models.zhangpaxton2008.epstein_coeffs(angle, table)[source]

Epstein coefficients from table

Returns the Epstein coefficients as read from the table, ready for evaluation with epstein_eval().

Parameters:
  • angle (float or array_like) – The magnetic local time hour angle: \(angle = \text{MLT} * 2\pi / 24\)

  • table (array_like) – Table of N harmonic (Fourier) coefficients. The 4 constant offsets are in the first row, then Nx4 cosine amplitudes followed by Nx4 sine amplitudes, each for the coefficients A, B, C, and D.

Returns:

coeffs – The Epstein coefficients for the MLT angle.

Return type:

array_like (4,)

See also

epstein_eval

eppaurora.models.zhangpaxton2008.epstein_eval(x, coeffs)[source]

Epstein function evaluated at x

The so-called Epstein function is defined by

\[E(x) = \frac{A\exp\{(x - B) / C\}}{(1 + \exp\{(x - B) / D\})^2}\]
Parameters:
  • x (float or array_like) – Argument of the Epstein function, e.g. the magnetic co-latitude \(x = 90 - |Mlat|\).

  • coeffs (array_like) – Epstein coefficients, e.g. from epstein_coeffs().

Returns:

y – The Epstein function with coefficients as given evaluated at x.

Return type:

float or array_like

eppaurora.models.zhangpaxton2008.hemispheric_power(Kp)[source]

Hemispheric Power in GW from Kp

Zhang and Paxton, 2008, Eqs. (1) and (2)

Parameters:

Kp (float or array_like) – Geomagnetic Kp index value(s).

Returns:

HP – Hemispheric power in [GW], same shape as Kp.

Return type:

float or array_like

eppaurora.models.zhangpaxton2008.read_zp2008_coeffs(file=None, nf=6, nKp=6)[source]

Read Epstein coefficient tables from file

Parameters:
  • file (str, optional) – The text file containing the coefficient tables, with the same layout as in [ZP08]. Defaults to the packaged coefficient file.

  • nf (int, optional) – The number of harmonic (Fourier) terms, defaults to 6 as in [ZP08]

  • nKp (int, optional) – The number of Kp bins, defaults to 6 as in [ZP08]

Returns:

Q0_table, Em_table – The tables for the total energy flux Q0 and the electron mean energy Em, the row names indicate the frequency and the columns the Epstein parameters A, B, C, D.

Return type:

tuple of numpy.recarray

References

[ZP08] (1,2,3)

Zhang and Paxton, JASTP, 70, 1231–1242, 2008, https://doi.org/10.1016/j.jastp.2008.03.008

eppaurora.models.zhangpaxton2008.zp2008(mlat, mlt, Kp, Q0table=None, Emtable=None)[source]

Electron total energy flux and mean energy model

Implements the model algorithm as given in Appendix A of [ZP08]. Defaults to using the packaged coefficients taken from that reference, but custom tables for the Q0 and Em Fourier coefficients can be provided.

Parameters:
  • mlat (float) – (Geo)Magnetic latitude in [degrees].

  • mlt (float) – Magnetic local time in [hours].

  • Kp (float) – Geomagnetic Kp index value(s).

  • Q0table (np.recarray, optional) – Fourier coefficient table for the Epstein coefficients for the energy flux. E.g. as returned by read_zp2008_coeffs().

  • Emtable (np.recarray, optional) – Fourier coefficient table for the Epstein coefficients for the mean energy. E.g. as returned by read_zp2008_coeffs().

Returns:

(Q0, Em) – Electron energy flux Q0 in [mW m⁻²] (= [erg s⁻¹ cm⁻²]), and electron mean energy in [keV].

Return type:

tuple

References

[ZP08]

Zhang and Paxton, JASTP, 70, 1231–1242, 2008, https://doi.org/10.1016/j.jastp.2008.03.008

Module contents

Empirical models for electron energy and flux and ionization rates

Implements the empirical proxy-driven models for auroral electrons, providing the proxy driven ionization rate model described in [1] and the empirical electron energy and flux model described in [2].

[1]

Bender et al., in prep., 2023, preprint: https://doi.org/10.48550/arXiv.2312.11130

[2]

Zhang and Paxton, JASTP, 70, 1231–1242, 2008, https://doi.org/10.1016/j.jastp.2008.03.008