# workaround for new regions API arbitrary_wcs = wcs.WCS( fits.getheader( paths.Fpath( 'merge/continuum/SgrB2_selfcal_full_TCTE7m_selfcal5_ampphase_taylorterms_multiscale_deeper_mask2.5mJy.image.tt0.pbcor.fits' ))) core_phot_tbl = Table.read(paths.tpath("continuum_photometry_withSIMBAD.ipac"), format='ascii.ipac') core_phot_tbl.add_column( Column(name='radius', data=np.zeros(len(core_phot_tbl)) + np.nan)) # measured from core_flux_distributions core_powerlaw_index = 1.94 kroupa = imf.Kroupa() o_mmin = 8 hii_cutoff = 20 mmax = 150 over8fraction150 = (kroupa.m_integrate(o_mmin, mmax)[0] / kroupa.m_integrate(kroupa.mmin, mmax)[0]) x = np.linspace(o_mmin, mmax, 50000) y = kroupa(x) over8mean150 = (x * y).sum() / y.sum() print("150mmax, >8 fraction: {0}, mean = {1}".format(over8fraction150, over8mean150)) mmax = 200 over8fraction = (kroupa.m_integrate(o_mmin, mmax)[0] /
pl.figure(3).clf() pl.loglog(list(map(float, max_masses.keys())), max_masses.values(), '.', alpha=0.1) pl.xlabel("Cluster Mass") pl.ylabel("Maximum stellar mass") pl.savefig(f"maxmass_vs_clustermass_{stop_crit}.png", bbox_inches='tight', dpi=200) pl.savefig(f"maxmass_vs_clustermass_{stop_crit}.pdf", bbox_inches='tight') m_to_ls = [] slopes = np.linspace(1.7, 2.9, 20) for slope in ProgressBar(slopes): Kroupa = imf.Kroupa(p3=slope) cluster = imf.make_cluster(1e5, Kroupa, mmax=120, silent=True, stop_criterion=stop_crit) lum = imf.lum_of_cluster(cluster) m_to_l = 1e5 / 10**lum m_to_ls.append(m_to_l) pl.figure(4).clf() pl.plot(slopes, m_to_ls) pl.xlabel("Upper-end power-law slope $\\alpha$") pl.ylabel("Mass-to-light ratio [M$_\odot$/L$_\odot$]") ax = pl.gca() tw = ax.twinx()