コード例 #1
0
# Just fit ratio (intercept is 0)
pars_ratio, pars_ratio_ci, sampler_ratio = \
    bayes_linear(tab['sigma_HI'][good_pts], tab['sigma_CO'][good_pts],
                 tab['sigma_stderr_HI'][good_pts],
                 tab['sigma_stderr_CO'][good_pts],
                 nBurn=500, nSample=5000, nThin=1,
                 fix_intercept=True)

slope_ratio = pars_ratio[0]
slope_ratio_ci = pars_ratio_ci[0]

add_stddev_ratio = pars_ratio[1]
add_stddev_ratio_ci = pars_ratio_ci[1]

onecolumn_figure()
hist2d(tab['sigma_HI'][good_pts] / 1000.,
       np.array(tab['sigma_CO'])[good_pts] / 1000.,
       bins=13,
       data_kwargs={"alpha": 0.5})
plt.xlabel(r"$\sigma_{\rm HI}$ (km/s)")
plt.ylabel(r"$\sigma_{\rm CO}$ (km/s)")

# slope = params[0]
# inter = params[1] / 1000.
# slope_ci = cis[0]
# inter_cis = cis[1] / 1000.
# plt.plot([4, 12], [4. * slope + inter, 12. * slope + inter],
#          label='Linear Fit')
# plt.fill_between([4, 12], [4. * slope_ci[0] + inter_cis[0],
#                            12. * slope_ci[0] + inter_cis[0]],
コード例 #2
0
    iram_co21_14B088_data_path(
        "m33.co21_iram.14B-088_HI.peakvels.fits"))[0].data / 1000.
co_peaktemp = fits.open(
    iram_co21_14B088_data_path(
        "m33.co21_iram.14B-088_HI.peaktemps.fits"))[0].data

co_mask = fits.open(
    iram_co21_14B088_data_path("m33.co21_iram.14B-088_HI_source_mask.fits"))[0]

good_co_pts = co_mask.data.sum(0) >= 2

good_pts = np.logical_and(np.isfinite(hi_mom1), good_co_pts)
# Impose 3 sigma cut on the CO peaks
good_pts = np.logical_and(good_pts, co_peaktemp > 0.06)

onecolumn_figure(font_scale=1.1)

# Mom1 comparisons
hist2d(np.abs((co_mom1 - hi_mom1)[good_pts]),
       co_peaktemp[good_pts],
       bins=16,
       data_kwargs={"alpha": 0.6},
       range=[(0.0, 25.0), (0.0, 1.05 * np.max(co_peaktemp[good_pts]))])
plt.axhline(0.06, color=cpal[1], linestyle='--', linewidth=3)
plt.axvline(2.6, color=cpal[2], linestyle=':', linewidth=3)
plt.ylabel(r"T$_\mathrm{peak, CO}$ (K)")
plt.xlabel(r"$|V_{\rm cent, CO} - V_{\rm cent, HI}|$ (km/s)")
plt.grid()
plt.tight_layout()

plt.savefig(