def show_con(dgmf, fignum=3, label="$f(n>10^4$ cm$^{-3})$"): figN = pl.figure(fignum) figN.clf() gray = copy.copy(pl.cm.gray) gray.set_bad('black') gray.set_under('black') FF = FITSFigure(cube13ss_slab3_masked_mom0.hdu, figure=figN, colorbar=False, cmap=gray, transparent_nan=False) #FF = FITSFigure(dgmf1e4, figure=fig4) #FF.show_grayscale() FF.show_contour(dgmf, levels=[0.1,0.3,0.5,0.7,0.9], zorder=1000, smooth=1) FF.add_colorbar() cax = FF.colorbar._colorbar_axes cax.collections[0].set_visible(False) FF.colorbar = pl.colorbar(FF._layers['contour_set_1'], cax=cax) FF.colorbar.set_label("Dense Fraction", rotation=270, labelpad=30) for lines in FF.colorbar.lines: lines.set_linewidth(76) FF._ax1.set_title(label) #FF.scalebar._scalebar.set_zorder(40) #FF.refresh() return FF
cmhot.set_under('white') cmhot.set_over('black') cmjet = mpl.cm.jet cmjet = mpl.cm.RdYlBu_r cmjet.set_bad('white') cmjet.set_under('white') cmjet.set_over('black') topbounds = [0.1,0.50,0.8,0.45] bottombounds = [0.1,0.05,0.8,0.464] # centerx, centery, radius, width, height pl.figure(1,figsize=(12,12)) pl.clf() dens1 = FITSFigure(parcubefile,convention='calabretta',slices=[0],figure=pl.figure(1),subplot=topbounds) dens1.show_colorscale(vmin=2,vmax=6,cmap=cmhot) dens1.recenter(**zoomargs) dens1.colorbar._colorbar_axes.set_ylabel('log$_{10}$(n(H$_2$) cm$^{-3}$)') dens1.hide_xaxis_label() dens1.hide_xtick_labels() velo1 = FITSFigure(parcubefile,convention='calabretta',slices=[4],figure=pl.figure(1),subplot=bottombounds) velo1.show_colorscale(vmin=52,vmax=66,cmap=cmjet) velo1.recenter(**zoomargs) velo1.colorbar._colorbar_axes.set_ylabel('Velocity ($V_{LSR}$ km s$^{-1}$)') savefig('W51_H2CO_2parfittry11_v1_densityvelocity%s.png' % extrastr,bbox_inches='tight') dens1.remove_colorbar() dens1.hide_colorscale() col1 = FITSFigure(parcubefile,convention='calabretta',slices=[1],figure=pl.figure(1),subplot=topbounds) col1.show_colorscale(vmin=11,vmax=13.5,cmap=cmhot)
tbl.add_column(Column(data=tbl['{0} Flux Over Threshold'.format(stat)] / total_co_slab_reg.value, dtype='float', name='{0} F_total(slab)'.format(stat))) pkfrac = cube13ss.with_mask(cubemask).spectral_slab(vrange1[0], vrange2[1])[slices].sum().value / total_co_slab_reg.value tbl.meta['Peak Fraction'] = pkfrac tables[region] = tbl if __name__ == "__main__": from aplpy_figure_maker import FITSFigure import aplpy import pylab as pl fig = pl.figure(1, figsize=(12,12)) fig.clf() F1 = FITSFigure(cube13ss_slab3_masked_mom0.hdu, subplot=[0.05,0.5,0.4,0.4], figure=fig) F1.show_grayscale() F1._ax1.set_title("$^{13}$CO masked with H$_2$CO") F2 = FITSFigure(cube13_slab3_masked_mom0.hdu, subplot=[0.50,0.5,0.4,0.4], figure=fig) F2.show_grayscale() F2._ax1.set_title("$^{13}$CO masked by S/N") F3 = FITSFigure(high5e4dens_co_slab3_mom0.hdu, subplot=[0.05,0.05,0.4,0.4], figure=fig) F3.show_grayscale() F3._ax1.set_title("$^{13}$CO masked by $n>5\\times10^4$") F4 = FITSFigure(high1e4dens_co_slab3_mom0.hdu, subplot=[0.50,0.05,0.4,0.4], figure=fig) F4.show_grayscale() F4._ax1.set_title("$^{13}$CO masked by $n>1\\times10^4$") F13 = FITSFigure(high1e5dens_co_slab3_mom0.hdu, subplot=[0.05,0.05,0.4,0.4], figure=fig) F13.show_grayscale() pl.matplotlib.rc_file('pubfiguresrc')