def plot_isophotes(axA, axB, dataset, contour_color, label, edge_in_pixel, contour_base, new_grid_size, title=False, legend=False): if dataset == evn38: hdr, raw = read.fits_data(dataset.filename) A = make_subimage(raw, dataset.pos_pix, "A_core", edge_in_pixel, edge_in_pixel) B = make_subimage(raw, dataset.pos_pix, "B_core", edge_in_pixel, edge_in_pixel) levs_A = measure.contour_levels(dataset.rms, A.max(), base = contour_base, step=math.sqrt(2)) levs_B = measure.contour_levels(dataset.rms, B.max(), base = contour_base, step=math.sqrt(2)) if dataset == vlba or dataset == gvlbi: hdr, A_raw = read.fits_data(dataset.filenameA) hdr, B_raw = read.fits_data(dataset.filenameB) A = make_subimage(A_raw, dataset.pos_A_pix, "A_core", edge_in_pixel, edge_in_pixel) B = make_subimage(B_raw, dataset.pos_B_pix, "B_core", edge_in_pixel, edge_in_pixel) levs_A = measure.contour_levels(dataset.rms_A, A.max(), base = contour_base, step=math.sqrt(2)) levs_B = measure.contour_levels(dataset.rms_B, B.max(), base = contour_base, step=math.sqrt(2)) A = rebin(A, new_grid_size) B = rebin(B, new_grid_size) A_X, A_Y, A = recenter_data(A, (100, 100)) B_X, B_Y, B = recenter_data(B, (100, 100)) mu_A = dataset.mu_A mu_B = dataset.mu_B mu = mu_A.mean() / mu_B.mean() cntrs = axA.contour(A_X, A_Y, A, levels = levs_A, colors = contour_color, lw=1) axB.contour(B_X, B_Y, B, levels = levs_B, colors = contour_color, lw=1) if title: axA.set_title("%s (image A)"%label) axB.set_title("%s (image B)"%label) if legend: axB.legend([cntrs.collections[0]], ["%s"%label]) return cntrs, axA, axB
def plot_rasterimg(fig, axA, axB, dataset, colormap, label, edge_in_pixel, lev_min, new_grid_size): if dataset == evn38: hdr, raw = read.fits_data(dataset.filename) A = make_subimage(raw, dataset.pos_pix, "A_core", edge_in_pixel, edge_in_pixel) B = make_subimage(raw, dataset.pos_pix, "B_core", edge_in_pixel, edge_in_pixel) if dataset == vlba or dataset == gvlbi: hdr, A_raw = read.fits_data(dataset.filenameA) hdr, B_raw = read.fits_data(dataset.filenameB) A = make_subimage(A_raw, dataset.pos_A_pix, "A_core", edge_in_pixel, edge_in_pixel) B = make_subimage(B_raw, dataset.pos_B_pix, "B_core", edge_in_pixel, edge_in_pixel) A = rebin(A, new_grid_size) B = rebin(B, new_grid_size) A_X, A_Y, A = recenter_data(A, (100, 100)) B_X, B_Y, B = recenter_data(B, (100, 100)) mu_A = dataset.mu_A mu_B = dataset.mu_B mu = mu_A.mean() / mu_B.mean() imA = axA.imshow(A, origin='lower left', cmap=plt.get_cmap(colormap)) imB = axB.imshow(B, origin='lower left', cmap=plt.get_cmap(colormap)) # axA.imshow(A_X, A_Y, A)#, origin='lower left', vmin=lev_min, cmap=plt.get_cmap(colormap)) # axB.imshow(B_X, B_Y, B)#, origin='lower left', vmin=lev_min, cmap=plt.get_cmap(colormap)) return imA, imB, axA, axB