eppaurora.recombination.alpha_vickrey1982()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 19
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 19
rs 10
c 0
b 0
f 0
1
# coding: utf-8
2
# Copyright (c) 2020 Stefan Bender
3
#
4
# This file is part of pyeppaurora.
5
# pyeppaurora is free software: you can redistribute it or modify
6
# it under the terms of the GNU General Public License as published
7
# by the Free Software Foundation, version 2.
8
# See accompanying LICENSE file or http://www.gnu.org/licenses/gpl-2.0.html.
9
"""Atmospheric recombination rate parametrizations
10
11
Atmospheric recombination rate parametrizations as described
12
in [1]_, [2]_, and [3]_.
13
14
.. [1] Vickrey et al., J. Geophys. Res. Space Phys., 87, A7, 5184--5196,
15
	doi:10.1029/ja087ia07p05184
16
.. [2] Gledhill, Radio Sci., 21, 3, 399-408, doi:10.1029/rs021i003p00399
17
.. [3] https://ssusi.jhuapl.edu/data_algorithms
18
"""
19
20
import numpy as np
21
22
__all__ = [
23
	"alpha_vickrey1982",
24
	"alpha_gledhill1986_aurora",
25
	"alpha_gledhill1986_day",
26
	"alpha_gledhill1986_night",
27
	"alpha_ssusi",
28
]
29
30
31
def alpha_vickrey1982(h):
32
	u""" Vickrey et al. 1982 [#]_
33
34
	Parameters
35
	----------
36
	h: float or array_like
37
		Altitude in [km]
38
39
	Returns
40
	-------
41
	alpha: float or array_like
42
		The recombination rate [cm³ s⁻¹].
43
44
	References
45
	----------
46
	.. [#] Vickrey et al., J. Geophys. Res. Space Phys.,
47
		87, A7, 5184--5196, doi:10.1029/ja087ia07p05184
48
	"""
49
	return 2.5e-6 * np.exp(-h / 51.2)
50
51
52
def alpha_gledhill1986_aurora(h):
53
	""" Gledhill 1986, Aurora parameterization [#]_
54
55
	Parameters
56
	----------
57
	h: float or array_like
58
		Altitude in [km]
59
60
	Returns
61
	-------
62
	alpha: float or array_like
63
		The recombination rate [cm³ s⁻¹].
64
65
	References
66
	----------
67
	.. [#] Radio Sci., 21, 3, 399-408, doi:10.1029/rs021i003p00399
68
	"""
69
	return 4.3e-6 * np.exp(-2.42e-2 * h) + 8.16e12 * np.exp(-0.524 * h)
70
71
72
def alpha_gledhill1986_day(h):
73
	u""" Gledhill 1986, day-time parameterization [#]_
74
75
	Parameters
76
	----------
77
	h: float or array_like
78
		Altitude in [km]
79
80
	Returns
81
	-------
82
	alpha: float or array_like
83
		The recombination rate [cm³ s⁻¹].
84
85
	References
86
	----------
87
	.. [#] Radio Sci., 21, 3, 399-408, doi:10.1029/rs021i003p00399
88
	"""
89
	return 0.501 * np.exp(-0.165 * h)
90
91
92
def alpha_gledhill1986_night(h):
93
	""" Gledhill 1986, night-time parameterization [#]_
94
95
	Parameters
96
	----------
97
	h: float or array_like
98
		Altitude in [km]
99
100
	Returns
101
	-------
102
	alpha: float or array_like
103
		The recombination rate [cm³ s⁻¹].
104
105
	References
106
	----------
107
	.. [#] Radio Sci., 21, 3, 399-408, doi:10.1029/rs021i003p00399
108
	"""
109
	return 652 * np.exp(-0.234 * h)
110
111
112
def alpha_ssusi(z, alpha0=4.2e-7, scaleh=28.9, z0=108., z1=None):
113
	u""" Recombination rate from the SSUSI algorithm [#]_
114
115
	Implements section 2.6.2.15 from [#]_,
116
	more details are also in [#]_.
117
118
	Parameters
119
	----------
120
	z: float, array_like
121
		Profile altitude [km].
122
	alpha0: float, optional
123
		Predetermined peak effective recombination coefficient.
124
		Default: 4.2e-7
125
	scaleh: float, optional
126
		Predetermined scale height [km] of the effective recombination coefficient.
127
		Default: 28.9.
128
	z0: float, optional
129
		Predetermined altitude [km] of the peak effective recombination coefficient.
130
		Default: 108.
131
	z1: float, optional
132
		Use :func:`alpha_vickrey1982()` above z1 [km].
133
		Default: None
134
135
	Returns
136
	-------
137
	alpha: float or array_like
138
		The recombination rate [cm³ s⁻¹].
139
140
	References
141
	----------
142
	.. [#] https://ssusi.jhuapl.edu/data_algorithms
143
	.. [#] https://ssusi.jhuapl.edu/docs/algorithms/Aurora_LID_c_Version_2.0.pdf
144
	.. [#] https://ssusi.jhuapl.edu/docs/algorithms/SSUSI_DataProductAlgorithms_V1_13.doc
145
	"""
146
	alpha = np.zeros_like(z)
147
	alpha[z < z0] = alpha0
148
	alpha[z >= z0] = alpha0 * np.exp(-(z[z >= z0] - z0) / scaleh)
149
	if z1 is not None:
150
		# use Vickrey et al. above z1
151
		alpha[z >= z1] = 2.5e-6 * np.exp(-z[z >= z1] / 51.2)
152
	return alpha
153