fig_int_edges.suptitle('Edge Teeth Intercept vs. Beamformer Temperature') pol_titles = ['XX', 'YY', 'XY', 'YX'] # Show bad obs on scatter plots c = 30 * ['b'] # bad_obs_ind = [23, 24, 27, 28, 29] # for k in bad_obs_ind: # c[k] = 'r' for m in range(4): plot_lib.scatter_plot_2d(fig_slope_main, ax_slope_main[m / 2][m % 2], max_loc_array, fit_coeff_array[:, 0, m], title=pol_titles[m], xlabel='Beamformer Temperature (C)', ylabel='Main Slope', c=c, ylim=[ np.amin(fit_coeff_array[:, 0, m]), np.amax(fit_coeff_array[:, 0, m]) ]) plot_lib.scatter_plot_2d(fig_int_main, ax_int_main[m / 2][m % 2], max_loc_array, fit_coeff_array[:, 1, m], title=pol_titles[m], xlabel='Beamformer Temperature (C)', ylabel='Main Y-Intercept', c=c) plot_lib.scatter_plot_2d(fig_slope_centers, ax_slope_centers[m / 2][m % 2],
use('Agg') import matplotlib.pyplot as plt import glob import plot_lib as pl flag_title = 'All' rms_path = '/Users/mike_e_dubs/MWA/Temperatures/Golden_Set_RMS/arrs/%s/' % ( flag_title) outpath = '/Users/mike_e_dubs/MWA/Temperatures/Golden_Set_RMS/figs/%s/' % ( flag_title) rms_list = glob.glob('%s*.npym' % (rms_path)) rms_list.sort() rms_arr = np.zeros([2, len(rms_list)]) xticks = [1061313496, 1061315320, 1061317152, 1061318984, 1061320688] for k, rms in enumerate(rms_list): rms_arr[0, k] = int(rms[len(rms_path):len(rms_path) + 10]) rms_arr[1, k] = np.load(rms) fig, ax = plt.subplots(figsize=(14, 8)) pl.scatter_plot_2d(fig, ax, rms_arr[0], rms_arr[1], title='Golden Set RMS, Post-Flagging', xlabel='Obsid', ylabel='RMS (UNCALIB)', xticks=xticks) fig.savefig('%sGolden_Set_RMS_%s.png' % (outpath, flag_title))
bins_all_widths = np.diff(bins_all) bins_unflagged_widths = np.diff(bins_unflagged) bins_all_centers = bins_all[:-1] + 0.5 * bins_all_widths bins_unflagged_centers = bins_unflagged[:-1] + 0.5 * bins_unflagged_widths max_loc_all = bins_all_centers[hist_all.argmax()] max_loc_unflagged = bins_unflagged_centers[hist_unflagged.argmax()] max_locs.append([int(obs1), max_loc_unflagged, max_loc_all]) max_locs.sort() max_locs = np.array(max_locs) fig, ax = plt.subplots(figsize=(14, 8), nrows=2) fig.suptitle('Golden Set Histogram Count Max Locations') fig_titles = ['Unflagged', 'All'] xticks = [1061313496, 1061315320, 1061317152, 1061318984] for m in range(2): plot_lib.scatter_plot_2d(fig, ax[m], max_locs[:, 0], max_locs[:, m + 1], title=fig_titles[m], xlabel='GPS Time', ylabel='Max Location (UNCALIB)', xticks=xticks) np.save('%smax_locs.npy' % (outpath), max_locs) fig.savefig('%smax_locs_day1.png' % (outpath))
import numpy as np import plot_lib as pl import matplotlib.pyplot as plt from matplotlib import cm ant_pos_arr = np.load( '/Users/mike_e_dubs/python_stuff/MJW-MWA/Useful_Information/MWA_ant_pos.npy' ) fig, ax = plt.subplots(figsize=(14, 8)) pl.scatter_plot_2d(fig, ax, ant_pos_arr[:, 0], ant_pos_arr[:, 1], title='Antennas by Color', xlabel='X (m)', ylabel='Y (m)', c=np.arange(128).astype(float), cmap=cm.plasma) fig.savefig('/Users/mike_e_dubs/MWA/Test_Plots/MWA_Ant_by_color.png')
plot_lib.line_plot( fig_line, ax_line[m / 2][m % 2], [ mean[:, m], fit[:, m], fit[:, m] + fit_centers[:, m], fit[:, m] + fit_edges[:, m] ], title=pol_titles[m], xticks=xticks, xminors=xminors, xticklabels=xticklabels, zorder=[1, 2, 2, 2], labels=['Template', 'Fit', 'Center Teeth Fit', 'Edge Teeth Fit']) plot_lib.scatter_plot_2d(fig_scatter, ax_scatter[m / 2][m % 2], temps[:, m], mean[:, m], title=pol_titles[m], xlabel='Fit Width', ylabel='Template') fig_exc.savefig('%s%s_Vis_Avg_Excess.png' % (plot_dir, obslist[n])) fig_ratio.savefig('%s%s_Vis_Avg_Ratio.png' % (plot_dir, obslist[n])) fig_line.savefig('%s%s_Vis_Avg_Template.png' % (plot_dir, obslist[n])) fig_scatter.savefig('%s%s_Vis_Avg_Temperature.png' % (plot_dir, obslist[n])) plt.close(fig_exc) plt.close(fig_ratio) plt.close(fig_line) plt.close(fig_scatter)
} color_dict = { 'soft_grad': 'blue', 'hard_grad': 'purple', 'NB': 'black', 'TV6': 'red', 'TV7': 'orange', 'TV8': 'yellow', 'streaks': 'green' } base = '/Users/mike_e_dubs/MWA/INS/Long_Run' fig, ax = plt.subplots(figsize=(14, 8)) for key in obs_dict: lst = [] for obs in obs_dict[key]: obs_lst = np.load('%s/time_arrs/%s_lst_arr.npy' % (base, obs))[0] if obs_lst > np.pi: obs_lst -= 2 * np.pi obs_lst *= 23.9345 / (2 * np.pi) lst.append(obs_lst) pl.scatter_plot_2d(fig, ax, lst, obs_dict[key], c=color_dict[key], xlabel='LST (hours)', ylabel='GPS Time (s)') fig.savefig('%s/LST_v_Obs_Scatter.png' % base)