forked from SolarDrew/macrospicules_paper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tmaps.py
27 lines (25 loc) · 912 Bytes
/
run_tmaps.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
from matplotlib import use
use('agg')
import sys
from os.path import join, expanduser
CThome = expanduser(join('~', 'CoronaTemps'))
sys.path.append(CThome)
from temperature import TemperatureMap as TMap
from matplotlib import pyplot as plt
from sunpy.time import parse_time as parse
dates = ['2014-12-15 12:00', '2014-12-15 12:30', '2014-12-15 14:00']
completed = False
while completed == False:
try:
for date in dates:
thismap = TMap(date, data_dir=join(CThome, 'data'), maps_dir=CThome, verbose=True)
thismap.save()
#thismap = thismap.submap([-1200, -200], [-500, 500], units='data')
fig = plt.figure(figsize=(32, 24))
thismap.plot()
plt.colorbar()
plt.savefig('t_{:%Y-%m-%d_%H-%M-%S}'.format(parse(thismap.date)))
plt.close()
completed = True
except:
print 'Failed - restarting'