FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Aether/srcPython/electrodynamics_read.py at refs/heads/develop · AetherModel/Aether · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
AetherModel
/
Aether
Public
Notifications
You must be signed in to change notification settings
Fork
31
Star
25
Code
Issues
21
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Aether
/
srcPython
/
electrodynamics_read.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
72 lines (55 loc) · 1.61 KB
Breadcrumbs
Aether
/
srcPython
/
electrodynamics_read.py
Copy path
File metadata and controls
executable file
·
72 lines (55 loc) · 1.61 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python
import
netCDF4
as
nc
import
datetime
as
dt
import
numpy
as
np
import
matplotlib
.
pyplot
as
plt
from
pylab
import
cm
from
datetime
import
datetime
from
datetime
import
timedelta
import
sys
args
=
sys
.
argv
file
=
args
[
1
]
ncfile
=
nc
.
Dataset
(
file
,
'r'
)
lats
=
np
.
array
(
ncfile
.
variables
[
'MagneticLatitude'
])
mlts
=
np
.
array
(
ncfile
.
variables
[
'MagneticLocalTime'
])
potential
=
np
.
array
(
ncfile
.
variables
[
'Potential'
])
/
1000.0
eflux
=
np
.
array
(
ncfile
.
variables
[
'EFlux'
])
times_in_s
=
np
.
array
(
ncfile
.
variables
[
'Time'
])
nTimes
=
len
(
times_in_s
)
base
=
datetime
(
1965
,
1
,
1
,
0
,
0
,
0
)
times
=
[]
for
t
in
times_in_s
:
times
.
append
(
base
+
timedelta
(
seconds
=
t
))
theta
,
r
=
np
.
meshgrid
(
mlts
*
np
.
pi
/
12.0
-
np
.
pi
/
2.0
,
90.0
-
lats
)
nLevels
=
21
maxp
=
np
.
max
(
np
.
abs
(
potential
))
dr
=
np
.
ceil
(
maxp
/
(
nLevels
-
1
)
*
2
)
minp
=
-
dr
*
(
nLevels
-
1
)
/
2
maxp
=
np
.
abs
(
minp
)
levelp
=
np
.
arange
(
minp
,
maxp
+
dr
,
dr
)
maxi
=
np
.
max
(
np
.
abs
(
eflux
))
mini
=
0.0
norm
=
cm
.
colors
.
Normalize
(
vmax
=
mini
,
vmin
=
maxi
)
if
(
mini
>=
0
):
cmap
=
cm
.
plasma
else
:
cmap
=
cm
.
bwr
di
=
int
(
np
.
ceil
(
nTimes
/
9
))
fig
=
plt
.
figure
(
figsize
=
(
10
,
10
))
iPlot
=
1
ax
=
[]
cax
=
[]
for
iT
in
np
.
arange
(
0
,
nTimes
,
di
):
subplot
=
330
+
iPlot
iPlot
+=
1
print
(
subplot
,
iT
)
ax
.
append
(
fig
.
add_subplot
(
subplot
,
projection
=
'polar'
))
pot2d
=
potential
[
iT
]
eflux2d
=
eflux
[
iT
]
eflux2d
[
eflux2d
<
0.1
]
=
np
.
nan
cax
.
append
(
ax
[
-
1
].
pcolor
(
theta
,
r
,
eflux2d
, \
vmin
=
mini
,
vmax
=
maxi
,
cmap
=
cmap
))
ax
[
-
1
].
contour
(
theta
,
r
,
pot2d
,
levelp
,
colors
=
'k'
)
#fig.colorbar(cax[-1])
fig
.
savefig
(
'netcdf_test.png'
)
plt
.
close
()
Back
|
FazBrowse Home
|
New Git URL