ax = plt.subplot(111, projection=WCS(moment0.header)) im = ax.imshow(moment0_Kkm_s, origin='lower', interpolation='nearest', norm=ImageNormalize(vmin=-0.001, vmax=np.nanmax(moment0_Kkm_s), stretch=AsinhStretch())) ax.set_ylabel("DEC (J2000)") ax.set_xlabel("RA (J2000)") cbar = plt.colorbar(im) cbar.set_label(r"Intensity (K km s$^{-1}$)") # raw_input("?") plt.savefig(paper1_figures_path("zeroth_moment_map_14B088.pdf")) plt.savefig(paper1_figures_path("zeroth_moment_map_14B088.png")) p.clf() moment1 = fits.open(fourteenB_HI_data_path(moment1_name))[0] ax = plt.subplot(111, projection=WCS(moment1.header)) im = ax.imshow(moment1.data / 1000., origin='lower', vmin=-300, vmax=-70, interpolation='nearest', cmap='viridis') ax.set_ylabel("DEC (J2000)") ax.set_xlabel("RA (J2000)") cbar = plt.colorbar(im)
rs, sd, sd_sigma = radial_profile(gal, lwidth_co, max_rad=6 * u.kpc, dr=dr) sd = sd.to(u.km / u.s) sd_sigma = sd_sigma.to(u.km / u.s) p.errorbar(rs.value, sd.value, yerr=sd_sigma.value, fmt="-", color="b", drawstyle='steps-mid') p.xlabel("R (kpc)") p.ylabel("CO Velocity Dispersion (km/s)") p.grid() p.draw() p.savefig(paper1_figures_path("co_veldisp_profile_{}pc.pdf".format(dr.value))) p.savefig(paper1_figures_path("co_veldisp_profile_{}pc.png".format(dr.value))) p.close() # raw_input("Next plot?") # Create the North and South portions. rs_n, sd_n, sd_sigma_n = \ radial_profile(gal, lwidth_co, max_rad=6 * u.kpc, pa_bounds=Angle([0.5 * np.pi * u.rad, -0.5 * np.pi * u.rad])) sd_n = sd_n.to(u.km / u.s) sd_sigma_n = sd_sigma_n.to(u.km / u.s) rs_s, sd_s, sd_sigma_s = \ radial_profile(gal, lwidth_co, max_rad=6 * u.kpc, pa_bounds=Angle([-0.5 * np.pi * u.rad,
# Beyond 8 kpc, noise is dominant. It may be some reflection of the # warp, but I don't trust it right now. rs, sd, sd_sigma = radial_profile(gal, lwidth, max_rad=8 * u.kpc) sd = sd.to(u.km / u.s) sd_sigma = sd_sigma.to(u.km / u.s) p.errorbar(rs.value, sd.value, yerr=sd_sigma.value, fmt="-", color="b", drawstyle='steps-mid') p.xlabel("R (kpc)") p.ylabel("HI Velocity Dispersion (km/s)") p.grid() p.draw() p.savefig(paper1_figures_path("hi_veldisp_profile.png")) p.savefig(paper1_figures_path("hi_veldisp_profile.pdf")) # raw_input("Next plot?") p.clf() # Create the North and South portions. rs_n, sd_n, sd_sigma_n = \ radial_profile(gal, lwidth, max_rad=8 * u.kpc, pa_bounds=Angle([0.5 * np.pi * u.rad, -0.5 * np.pi * u.rad])) sd_n = sd_n.to(u.km / u.s) sd_sigma_n = sd_sigma_n.to(u.km / u.s) rs_s, sd_s, sd_sigma_s = \ radial_profile(gal, lwidth, max_rad=8 * u.kpc, pa_bounds=Angle([-0.5 * np.pi * u.rad,
p.ioff() # Show the total radial profile VLA and Arecibo p.errorbar(rs.value, sd.value / scale_factor, yerr=sd_sigma.value / scale_factor, fmt="-", color="b", label="VLA", drawstyle='steps-mid') p.plot(rs_arec.value, sd_arec.value, "g--", drawstyle='steps-mid', label="Arecibo") # p.errorbar(rs_arec.value, sd_arec.value, yerr=sd_sigma_arec.value, # fmt="o--", color="g", label="Arecibo", drawstyle='steps-mid') p.ylabel(r"$\Sigma$ (M$_{\odot}$ pc$^{-2}$)") p.xlabel(r"R (kpc)") p.legend(loc='best') p.grid("on") p.savefig(paper1_figures_path("M33_Sigma_profile_w_Arecibo.pdf")) p.savefig(paper1_figures_path("M33_Sigma_profile_w_Arecibo.png")) p.clf() # W/ archival VLA p.errorbar(rs.value, sd.value / scale_factor, yerr=sd_sigma.value / scale_factor, fmt="-", color="b", label="VLA", drawstyle='steps-mid') p.plot(rs_arec.value, sd_arec.value, "g--", drawstyle='steps-mid', label="Arecibo") p.errorbar(rs_arch.value, sd_arch.value, yerr=sd_sigma_arec.value, color="r", fmt="-.", drawstyle='steps-mid', label="Archival VLA") # p.errorbar(rs_arec.value, sd_arec.value, yerr=sd_sigma_arec.value, # fmt="o--", color="g", label="Arecibo", drawstyle='steps-mid') p.ylabel(r"$\Sigma$ (M$_{\odot}$ pc$^{-2}$)")
pa_bounds=Angle([-0.5 * np.pi * u.rad, 0.5 * np.pi * u.rad]), max_rad=6 * u.kpc, dr=dr) sd_n /= beam_eff sd_sigma_n /= beam_eff p.ioff() p.errorbar(rs.value, np.log10(sd.value), yerr=0.434 * sd_sigma.value / sd.value, fmt="-", color="b", label=r"H$_2$", drawstyle='steps-mid') p.ylabel(r" log $\Sigma$ (M$_{\odot}$ pc$^{-2}$)") p.xlabel(r"R (kpc)") # p.legend(loc='best') p.grid("on") p.savefig(paper1_figures_path("M33_Sigma_profile_co21_dr_{}pc.pdf".format(dr.value))) p.savefig(paper1_figures_path("M33_Sigma_profile_co21_dr_{}pc.png".format(dr.value))) p.close() # p.show() # Show the north vs south profiles p.plot(rs.value, np.log10(sd.value), "k-.", drawstyle='steps-mid', label="Total") p.errorbar(rs_n.value, np.log10(sd_n.value), yerr=0.434 * sd_sigma_n.value / sd_n.value, fmt="-", color="b", label="North", drawstyle='steps-mid') p.errorbar(rs_s.value, np.log10(sd_s.value), yerr=0.434 * sd_sigma_s.value / sd_s.value, fmt="--", color="g", label="South", drawstyle='steps-mid') # p.plot(rs_n.value, sd_n.value, "bD-", label="North")
# VLA needs to be corrected by a 1.45 factor. See arecibo_match_props.py total_spectrum = total_spectrum * u.Jy total_spectrum_arecibo = total_spectrum_arecibo * u.Jy p.plot(cube.spectral_axis.to(u.km / u.s).value, total_spectrum.value, 'b-', label="VLA", drawstyle='steps-mid') p.plot(arecibo.spectral_axis.to(u.km / u.s).value, total_spectrum_arecibo.value, 'g--', label='Arecibo', drawstyle='steps-mid') p.ylabel("Total Intensity (Jy)") p.xlabel("Velocity (km/s)") p.legend(loc='upper left') p.grid() p.savefig(paper1_figures_path("total_profile.pdf")) p.savefig(paper1_figures_path("total_profile.png")) p.close() # Now we can get the total mass # Disregard outside this velocity range vmax = -100 * u.km / u.s vmin = -300 * u.km / u.s spec_axis = cube.spectral_axis.to(u.km / u.s) good_chans = np.logical_and(spec_axis <= vmax, spec_axis >= vmin) # Same channel width in both chan_width = \
mom1_wcs = wcs.WCS(mom1[0].header) scale = wcs.utils.proj_plane_pixel_scales(mom1_wcs)[0] # Distance scaling (1" ~ 4 pc). Conversion is deg to kpc dist_scale = (np.pi / 180.) * gal.distance.to(u.kpc).value # Plot the rotation curves plt.errorbar(cent_tab["r"] * scale * dist_scale, cent_tab["Vt"], yerr=cent_tab["eVt"], markersize=7, label='Centroid', fmt='D-', alpha=0.8) plt.errorbar(peak_tab["r"] * scale * dist_scale, peak_tab["Vt"], yerr=peak_tab["eVt"], markersize=7, label='Peak Velocity', fmt='o-', alpha=0.8) plt.errorbar(gh_tab["r"] * scale * dist_scale, gh_tab["Vt"], yerr=gh_tab["eVt"], markersize=7, label='Gauss-Hermite Fit', fmt='+-', alpha=0.8) plt.legend(loc='lower right') plt.grid() plt.ylabel(r"V$_{\rm circ}$ (km/s)") plt.xlabel("Radius (kpc)") plt.savefig(paper1_figures_path("HI_rotation_curve_comparisons.png")) plt.savefig(paper1_figures_path("HI_rotation_curve_comparisons.pdf")) plt.close()