-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_pyapex.py
More file actions
46 lines (32 loc) · 1.14 KB
/
example_pyapex.py
File metadata and controls
46 lines (32 loc) · 1.14 KB
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
import seaborn
from matplotlib.pyplot import figure, show
import pyapex
from scipy import arange, nan, where
if __name__ == '__main__':
def main1():
Obj = pyapex.ApexFL()
year, doy = 2003, 323
date = 2003. + doy / 365
dlon = -75.
hlim = [80., 160.]
f = figure(figsize=(16,6))
pn = f.add_subplot(111)
for h in arange(hlim[0], hlim[1] + 10., 10.):
gc, qc = Obj.getFL(date=date, dlon=dlon, hateq=h, verbose=False)
x, y, z = gc['lat'], gc['alt'], gc['lon']
ind = where(y < (hlim[0] - 10.))
if len(ind) > 0: x[ind], y[ind], z[ind] = nan, nan, nan
pn.plot(x, y)
strDate = 'DATE: {:4d}.{:03d}'.format(year, doy)
strLoc = 'GEOG. LON.: {:6.2f}$^\circ${:s}'.format(abs(dlon), 'E' if dlon > 0. else 'W')
title = '{:s} - {:s}'.format(strDate, strLoc)
pn.set_title(title)
pn.set_ylim([hlim[0] - 1, hlim[1] + 1])
pn.set_xlabel("Geog. Lat. ($^\circ$)")
pn.set_ylabel("Altitude (km)")
pn.invert_xaxis()
show()
#
# End of 'main1'
#####
main1()