Skip to content
Snippets Groups Projects
Commit e49ecedd authored by Alexander Kutkin's avatar Alexander Kutkin
Browse files

better plotting soulutions

parent 73be0165
No related branches found
No related tags found
No related merge requests found
...@@ -250,21 +250,21 @@ def view_sols(h5param, outname=None): ...@@ -250,21 +250,21 @@ def view_sols(h5param, outname=None):
data = grp['val'][()] data = grp['val'][()]
time = grp['time'][()] time = grp['time'][()]
ants = ['RT2','RT3','RT4','RT5','RT6','RT7','RT8','RT9','RTA','RTB','RTC','RTD'] ants = ['RT2','RT3','RT4','RT5','RT6','RT7','RT8','RT9','RTA','RTB','RTC','RTD']
freq_avg_gains = np.nanmean(data, axis=1) # average by frequency
print(dict(f['sol000/amplitude000/val'].attrs.items())) # h5 attributes
for ipol, pol in enumerate(['XX', 'YY']): for ipol, pol in enumerate(['XX', 'YY']):
fig = plt.figure(figsize=[20, 15]) fig = plt.figure(figsize=[20, 15])
fig.suptitle('Freq. averaged {} gain solutions ({})'.format(key.rstrip('000'), pol)) fig.suptitle('Freq. averaged {} gain solutions ({})'.format(key.rstrip('000'), pol))
print(dict(f['sol000/amplitude000/val'].attrs.items())) # h5 attributes
for i, ant in enumerate(ants): for i, ant in enumerate(ants):
ax = fig.add_subplot(4, 3, i+1) ax = fig.add_subplot(4, 3, i+1)
ax.set_title(ant) ax.set_title(ant)
gavg = np.nanmean(data, axis=1)[...,ipol] # average by frequency
if key.startswith('phase'): if key.startswith('phase'):
ax.plot((time-time[0])/3600.0, gavg[:, i,]*180.0/np.pi, alpha=0.7) ax.plot((time-time[0])/3600.0, freq_avg_gains[:, i,...,ipol]*180.0/np.pi, alpha=0.7)
ax.set_ylim([-180,180]) ax.set_ylim([-180,180])
else: else:
ax.plot((time-time[0])/3600.0, gavg[:, i,], alpha=0.7) ax.plot((time-time[0])/3600.0, freq_avg_gains[:, i,...,ipol], alpha=0.7)
if key.startswith('amplitude'): if key.startswith('amplitude'):
ax.set_ylim([-0.1,2.1]) ax.set_ylim([-0.1, np.max(freq_avg_gains)])
if i == 0: if i == 0:
ax.legend(['c{}'.format(_) for _ in range(data.shape[-2])]) ax.legend(['c{}'.format(_) for _ in range(data.shape[-2])])
if i == 10: if i == 10:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment