#!/usr/bin/env python """ALMA archival readiness of the RMS HII sample — can a large-sample dust-vs- free-free study be done now, or does it need a new ALMA program? Data from alma_readiness.log (hardcoded).""" import numpy as np import matplotlib; matplotlib.use('Agg'); import matplotlib.pyplot as plt N=800 fig,ax=plt.subplots(1,3,figsize=(15,5)) # funnel labels=['RMS HII\nsample','observed\n(any ALMA)','dust/ff\nseparable\n(2band|cm)','resolves\n0.1pc','READY NOW\n(all)'] vals=[800,353,448,314,249] ax[0].bar(range(5),vals,color=['#34495e','#5dade2','#48c9b0','#f5b041','#27ae60']) for i,v in enumerate(vals): ax[0].text(i,v+10,f'{v}\n{100*v/N:.0f}%',ha='center',fontsize=9) ax[0].set_xticks(range(5)); ax[0].set_xticklabels(labels,fontsize=8) ax[0].set_ylabel('# RMS HII regions'); ax[0].set_ylim(0,860) ax[0].set_title('Readiness funnel: only 31% archive-ready\n(upper bound)') # by class cls=['UC HII','compact','classical','no-CORNISH']; rdy=[53,97,17,82]; tot=[89,217,60,434] x=np.arange(4) ax[1].bar(x,tot,color='#d5d8dc',label='total') ax[1].bar(x,rdy,color='#27ae60',label='ready now') for i in range(4): ax[1].text(i,tot[i]+5,f'{100*rdy[i]/tot[i]:.0f}%',ha='center',fontsize=9) ax[1].set_xticks(x); ax[1].set_xticklabels(cls,fontsize=9); ax[1].legend() ax[1].set_ylabel('# HII regions'); ax[1].set_title('Ready fraction by class\n(UC HII best: 60%)') # by distance db=['0-4','4-8','8-12','12-20']; df=[36,39,25,11] ax[2].bar(range(4),df,color='#e67e22') for i,v in enumerate(df): ax[2].text(i,v+1,f'{v}%',ha='center',fontsize=9) ax[2].set_xticks(range(4)); ax[2].set_xticklabels([f'{d}\nkpc' for d in db]); ax[2].set_ylim(0,55) ax[2].set_ylabel('% ready now'); ax[2].set_title('Readiness vs distance\n(0.1pc unresolvable when far)') fig.suptitle('ALMA archive cannot deliver a definitive large RMS-HII sample now: 69% (551/800) need new data ' '(447 unobserved, 79 need 2nd band, 25 need higher res) → a new ALMA program is required',fontsize=11) plt.tight_layout(rect=[0,0,1,0.94]); plt.savefig('fig_alma_readiness.png',dpi=130) print('wrote fig_alma_readiness.png')