-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbriggs_grid.py
More file actions
122 lines (104 loc) · 3.58 KB
/
briggs_grid.py
File metadata and controls
122 lines (104 loc) · 3.58 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env python
#Used to create Figure 2 in Murphy et al. 2020
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import numpy as np
import icrs_to_helio as icrs_to_helio
import astropy.units as u
import sunpy
from astropy.io import fits
from astropy import wcs
from sunpy.map import Map
from astropy.coordinates import SkyCoord
from datetime import datetime
from matplotlib.patches import Ellipse
from sunpy.coordinates import frames
import glob
from plot_aia_lofar import get_beam
import warnings
warnings.simplefilter("ignore")
plt.rcParams['font.size'] = 12
no_multi = glob.glob("/mnt/murphp30_data/typeIII_int/briggs_comparison/*image.fits")
no_multi.sort()
no_multi[0], no_multi[1] = no_multi[1], no_multi[0]
multi = glob.glob("/mnt/murphp30_data/typeIII_int/briggs_comparison/multiscale/*image.fits")
multi.sort()
multi[0], multi[1] = multi[1], multi[0]
aiafile = "/mnt/murphp30_data/typeIII_int/scripts/AIA20171015.fits"
aiamap = Map(aiafile)
def make_comp(fitsfile):
briggs= Map(fitsfile)
briggs = icrs_to_helio.icrs_to_helio(briggs)
briggs.plot_settings['cmap'] = 'viridis'
lmax = (briggs.data).max()
levels = lmax*np.arange(0.5, 1.1, 0.05)
comp_map = sunpy.map.Map(aiamap, briggs, composite=True)
comp_map.set_levels(index=1, levels=levels)
return comp_map
comp_maps_no_multi = [make_comp(file) for file in no_multi]
comp_maps_multi = [make_comp(file) for file in multi]
axlims = [-2500,2500]
fig = plt.figure(figsize=(18,8))
gs = GridSpec(2, 5)
ax10 = fig.add_subplot(gs[1,0])
ax11 = fig.add_subplot(gs[1,1], sharey=ax10)
ax12 = fig.add_subplot(gs[1,2], sharey=ax10)
ax13 = fig.add_subplot(gs[1,3], sharey=ax10)
ax14 = fig.add_subplot(gs[1,4], sharey=ax10)
ax00 = fig.add_subplot(gs[0,0], sharex=ax10)
ax01 = fig.add_subplot(gs[0,1], sharey=ax00)
ax02 = fig.add_subplot(gs[0,2], sharey=ax00)
ax03 = fig.add_subplot(gs[0,3], sharey=ax00)
ax04 = fig.add_subplot(gs[0,4], sharey=ax00)
plt.setp(ax00.get_xticklabels(), visible=False)
plt.setp(ax00.get_xticklines(), visible=False)
for ax in [ax01,ax02,ax03,ax04,ax11,ax12,ax13,ax14]:
plt.setp(ax.get_xticklabels(), visible=False)
plt.setp(ax.get_yticklabels(), visible=False)
plt.setp(ax.get_xticklines(), visible=False)
plt.setp(ax.get_yticklines(), visible=False)
for ax in [ax00,ax01,ax02,ax03,ax04,ax10,ax11,ax12,ax13,ax14]:
ax.spines['bottom'].set_color('white')
ax.spines['top'].set_color('white')
ax.spines['right'].set_color('white')
ax.spines['left'].set_color('white')
ax.set_aspect('equal')
plt.subplots_adjust(hspace=0.0)
plt.subplots_adjust(wspace=0.0)
for comp_map,ax in zip(comp_maps_no_multi,[ax00,ax01,ax02,ax03,ax04]):
try:
comp_map.plot(ax,title=' ')
except: ValueError
ax.set_xlabel(' ')
ax.set_ylabel(' ')
ax.set_xlim(axlims)
ax.set_ylim(axlims)
# ax.set_title(' ')
ax.patch.set_facecolor('black')
try:
comp_maps_multi[0].plot(ax10,title=' ')
except: ValueError
ax10.set_xlabel(' ')
ax10.set_ylabel(' ')
ax10.set_xlim(axlims)
ax10.set_ylim(axlims)
# ax10.set_title(' ')
ax10.patch.set_facecolor('black')
for comp_map,ax in zip(comp_maps_multi[1:],[ax11,ax12,ax13,ax14]):
try:
comp_map.plot(ax,title=' ')
except: ValueError
ax.set_xlabel(' ')
ax.set_ylabel(' ')
ax.set_xlim(axlims)
ax.set_ylim(axlims)
# ax.set_title(' ')
ax.patch.set_facecolor('black')
for ax, title in zip([ax00,ax01,ax02,ax03,ax04],["Briggs -2", "Briggs -1", "Briggs 0", "Briggs 1", "Briggs 2"]):
ax.set_title(title)
ax00.set_ylabel("No Multiscale (Solar-Y)")
ax10.set_ylabel("Multiscale (Solar-Y)")
ax10.set_xlabel("Solar-X (arcsec)")
gs.tight_layout(fig, h_pad=-2, w_pad=-2)
plt.savefig("briggs_comparison.png", dpi=400)
plt.show()