-
Notifications
You must be signed in to change notification settings - Fork 12
/
iri1DExample01.py
executable file
·51 lines (37 loc) · 1.23 KB
/
iri1DExample01.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python
from pyiri2016 import IRI2016Profile
from numpy import arange
from matplotlib.pyplot import figure, legend, show
import seaborn
def example01():
""" Height Profile Example """
altlim = [100., 1000.]
altstp = 5.
lat, lon = -11.95, -76.77
year, month, dom = 2003, 11, 21
iri2016Obj = IRI2016Profile(altlim=altlim, altstp=altstp, lat=lat, \
lon=lon, year=year, month=month, dom=dom, option=1, verbose=False)
altbins = arange(altlim[0], altlim[1] + altstp, altstp)
nalt = len(altbins)
index = range(nalt)
fig = figure(figsize=(16,6))
pn = fig.add_subplot(121)
ne = iri2016Obj.a[0, index]
pn.plot(ne, altbins, label='N$_e$')
pn.set_title(iri2016Obj.title1)
pn.set_xlabel('Density (m$^{-3}$)')
pn.set_ylabel('Altitude (km)')
pn.set_xscale('log')
legend(loc='best')
pn = fig.add_subplot(122)
ti = iri2016Obj.a[2, index]
te = iri2016Obj.a[3, index]
pn.plot(ti, altbins, label='T$_i$')
pn.plot(te, altbins, label='T$_e$')
pn.set_title(iri2016Obj.title2)
pn.set_xlabel('Temperature ($^\circ$)')
pn.set_ylabel('Altitude (km)')
legend(loc='best')
if __name__ == '__main__':
example01()
show()