This repository has been archived by the owner on Dec 9, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
RunGlow.py
executable file
·56 lines (43 loc) · 1.73 KB
/
RunGlow.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
51
52
53
54
55
56
#!/usr/bin/env python
"""
default parameter values like those of Stan's fortran examples--yield rather similar output
Note, this simulation uses a specific input differential number flux spectrum
"""
from matplotlib.pyplot import show
from argparse import ArgumentParser
import glowaurora as glow
from glowaurora.plots import plotaurora
def E0aurora(params: dict):
sim = glow.runglowaurora(params)
plotaurora(params, sim)
return sim
def main():
p = ArgumentParser(description="Stan Solomon's GLOW auroral model")
p.add_argument('-t', '--simtime',
help='yyyy-mm-ddTHH:MM:SSZ time of sim', default='2013-04-14T15:54Z')
p.add_argument('-c', '--latlon', help='geodetic latitude/longitude (deg)',
type=float, nargs=2, default=(65., -148.))
# p.add_argument('-n','--nbins',help='number of energy bins in incident diff num flux',
# type=int,default=190) #hard-coded in cglow.h
p.add_argument(
'-q', '--flux', help='overall incident flux [erg ...]', type=float, default=1.)
p.add_argument(
'--e0', help='characteristic energy [eV]', type=float, default=1e3)
p.add_argument('-m', '--makeplot',
help='show to show plots, png to save pngs of plots', nargs='+', default=['show'])
p.add_argument(
'-zlim', help='plot limits of altitude axis [km]', nargs=2, type=float)
p = p.parse_args()
params = {'t0': p.simtime,
'glat': p.latlon[0],
'glon': p.latlon[1],
'flux': p.flux,
'E0': p.e0,
'makeplot': p.makeplot,
'zlim': p.zlim,
'plotformat': 'png',
}
E0aurora(params)
show()
if __name__ == '__main__':
main()