flipchem.Flipchem

The Flipchem class is the main class of the flipchem package.

class flipchem.Flipchem(date, altop=1000.0)[source]

A python wrapper to the flipchem ionospheric photochemistry model developed by Phil Richards [1]. Specifically, this code wraps the version of flipchem that was used for [2]. All ion densities, except for O+ are calculated from chemical equilibrium.

Parameters:
  • date (datetime.datetime) – Date and time for which to evaluate the flipchem model.
  • altop (float, optional) – Altitude above which ion fractions are set to 100% O+. Only used by the get_point() with keyword fractions=True.
Variables:
  • f107 (float) – The F10.7 solar flux for the previous day.
  • f107a (float) – The 81 day average F10.7 solar flux.
  • ap (array_like) – An array of AP index values. See read_geophys().

Notes

flipchem requires an input neutral atmosphere and the geophysical indicies: f107 and f107a. NRLMSIS-00 is used to provide a neutral atmosphere (see flipchem.MSIS). See read_geophys() for more details about geophysical indicies.

Examples

from datetime import datetime
from flipchem import Flipchem

date = datetime(2017,1,4,2)
fc = Flipchem(date)

glat = 60
glon = -70
alt = 300
ne = 5.0e11
te = ti = 500.
outputs = fc.get_point_fractions(glat,glon,alt,ne,te,ti)
LTHRS,SZAD,DEC,OXPLUS,O2PLUS,NOPLUS,N2PLUS,NPLUS,NNO,N2D,ITERS = outputs

References

[1]Richards, P. G. (2011), Reexamination of ionospheric photochemistry, J. Geophys. Res., 116, A08307, doi:10.1029/2011JA016613.
[2]Richards, P. G., Bilitza, D., and Voglozin, D. (2010), Ion density calculator (IDC): A new efficient model of ionospheric ion densities, Radio Sci., 45, RS5007, doi:10.1029/2009RS004332.
get_point(glat, glon, alt, ne, te, ti, user_no=-1.0, user_oplus=-1.0, msis_outputs=None, fractions=False)[source]

Evaluates the flipchem model for the input geodetic coordinates

Parameters:
  • glat (float) – Geodetic Latitude
  • glon (float) – Geodetic Longitude
  • alt (float) – Altitude above the Geodetic surface of the Earth
  • ne (float) – Electron density in number per cubic meter
  • te (float) – Electron temperature in Kelvin
  • ti (float) – Ion temperature in Kelvin
  • user_no (float, optional) – If positive, replaces the NO density in number per cubic meter determined from chemical equilibrium with user input density.
  • user_oplus (float, optional) – If positive, used as the O+ density in number per cubic meter. If negative the O+ number density is determined from photochemistry.
  • msis_outputs (tuple, optional) – A tuple of the outputs of msis.get_point
  • fractions (bool, optional) – A flag for whether the returned ion densities should be instead returned as fractions.
Returns:

  • lthrs (float) – Local time in decimal hours
  • sza (float) – The solar zenith angle in degrees
  • dec (float) – The solar declination angle in degrees
  • oxplus (float) – The O+ density in number per cubic meter
  • o2plus (float) – The O2+ density in number per cubic meter
  • noplus (float) – The NO+ density in number per cubic meter
  • n2plus (float) – The N2+ density in number per cubic meter
  • nplus (float) – The N+ density in number per cubic meter
  • nno (float) – The NO density in number per cubic meter
  • n2d (float) – The N2(D) density in number per cubic meter
  • iters (integer) – The number of iterations required before chemical equilibrium was achieved