def plot_aplpy(title, image, target, sources={'id': np.array([None])}): target.reinsert_image(image) hdu = fits.PrimaryHDU(target.data) hdu.header = target.header af = aplpy.FITSFigure(hdu) af.show_colorscale(vmin=1., vmax=np.max(target.data), smooth=None, stretch='log') af.add_label(0.1, 0.9, detection.targname(target.targname), relative=True, color='r', weight='bold') ind = (sources['id'] == i) if ind.sum() > 0: af.show_circles(sources[ind]['ra'], sources[ind]['dec'], 0.0001, color='r') #af.canvas.draw() af.recenter(target.header['CRVAL1'], target.header['CRVAL2'], 0.0007) af.add_grid() return af
af.show_circles(sources[ind]['ra'], sources[ind]['dec'], 0.0001, color='r') #af.canvas.draw() af.recenter(target.header['CRVAL1'], target.header['CRVAL2'], 0.0007) af.add_grid() return af AXCIR = targets[5] AXCIR.reinsert_image(imout[:, :, 5]) hdu = fits.PrimaryHDU(AXCIR.data) hdu.header = AXCIR.header af = aplpy.FITSFigure(hdu, figsize=(6,5)) af.show_colorscale(vmid=-40,vmin=-30, vmax=np.max(AXCIR.data), smooth=None, stretch='log') #af.show_colorscale(vmin=1, vmax=np.percentile(imout[:,:,5],99), smooth=None, stretch='log') af.set_title(detection.targname(AXCIR.targname)) ind = (fluxes['name'] == 'AX-CIR') if ind.sum() > 0: af.show_circles(fluxes[ind]['ra'], fluxes[ind]['dec'], 0.00007, color='r', linewidth=4) raceph, decceph = AXCIR.all_pix2world(50,50) af.show_markers([raceph], [decceph], color='b', linewidth=30, marker='+') af.set_theme("publication") af.recenter(AXCIR.header['CRVAL1'], AXCIR.header['CRVAL2'], 0.0005) af.add_grid() af.grid.set_color('k') af.grid.set_linewidth(2) from astropy import units as u af.add_scalebar(1 * u.arcsecond) af.scalebar.set_label('1 arcsec')