Skip to content
Snippets Groups Projects
Commit ac267496 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

Merge branch 'suspension_grid' into 'master'

See merge request jameson.rollins/locklost!100
parents 643c5286 7ddd00aa
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ def grab_data(gps):
"""
shift_times = {
'H1': [np.arange(0, 8), np.arange(8, 16), np.arange(16, 24)],
'L1': [np.concatenate(([23, 24], np.arange(22, 8))), np.arange(8, 12), np.arange(12, 22)]
'L1': [np.concatenate(([23], np.arange(0, 8))), np.arange(8, 12), np.arange(12, 22)]
}
shift_names = ['owl', 'day', 'eve']
shifts = {
......@@ -178,7 +178,7 @@ def get_five_sats(sat_path):
sat1 = sat_123[0]
sat2 = sat_123[1].split('_')[0]
sat3 = sat_123[1].split('_')[1]
channel_shorthand = '%s %s %s' % (sat1, sat2, sat3)
channel_shorthand = '%s %s' % (sat2, sat3)
# Make sure the degenerate channels don't get added
if channel_shorthand not in five_sats:
five_sats = np.append(five_sats, channel_shorthand)
......@@ -324,6 +324,35 @@ def plot_summary(path, epoch):
fig.savefig(outpath_plot, bbox_inches='tight')
plt.close()
#saturating suspension grid plot
y_sats = sorted(list(set([i[0] for i in five_sats])))
x_sats = sorted(list(set([item for sublist in five_sats for item in sublist[1:]])))
sat_grid = np.zeros((len(y_sats), len(x_sats)))
for y_idx, yval in enumerate(y_sats):
for x_idx, xval in enumerate(x_sats):
for sat_set in five_sats:
if yval == sat_set[0]:
if xval in sat_set[1:]:
sat_grid[y_idx][x_idx] += 1
fig, ax = plt.subplots(1, figsize=(22,16))
img = ax.imshow(sat_grid, interpolation='nearest',)
ax.set_xlabel('2nd-5th saturating suspension', labelpad=10)
ax.tick_params(width=5)
ax.set_ylabel('First saturating suspension')
ax.set_title('O3 suspension correlations: %s' % (epoch))
ax.set_xticks(np.arange(len(x_sats)))
ax.set_yticks(np.arange(len(y_sats)))
ax.set_xticklabels(x_sats, rotation = 45, ha = 'right')
ax.set_yticklabels(y_sats)
fig.tight_layout()
cbar = fig.colorbar(img)
cbar.set_label('# of locklosses')
outpath_plot = os.path.join(epoch_path, 'suspension_grid')
fig.savefig(outpath_plot, bbox_inches='tight')
plt.close()
######################################################
def _parser_add_arguments(parser):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment