#!/usr/bin/env python """Sky map (Galactic Aitoff) of the FIR-flux revealed O stars, by high-resolution verdict, to show where the 73 high-res-UNCOVERED sources lie. Reads ostar_highres.csv.""" import numpy as np from astropy.table import Table import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt t = Table.read('ostar_highres.csv') gl = np.array(t['gl'], float) gb = np.array(t['gb'], float) gl_w = np.where(gl > 180, gl - 360, gl) # -180..180 for Aitoff matched = np.array([str(x) == 'True' for x in t['matched']]) covHG = np.array([str(x) == 'True' for x in t['cov_HiGAL']]) compact = matched cirrus = covHG & ~matched uncov = ~covHG & ~matched fig = plt.figure(figsize=(12, 6.4)) ax = fig.add_subplot(111, projection='aitoff') lam = -np.radians(gl_w) # flip so l increases left (Galactic convention) bet = np.radians(gb) # Hi-GAL |b|<1 footprint band bl = np.linspace(-np.pi, np.pi, 400) ax.fill_between(bl, np.radians(-1), np.radians(1), color='0.85', alpha=0.5, zorder=0, label=r'Hi-GAL footprint ($|b|<1^\circ$)') ax.scatter(lam[uncov], bet[uncov], marker='o', s=42, color='C0', edgecolor='k', linewidth=0.4, alpha=0.85, zorder=4, label=f'high-res UNCOVERED ($N={uncov.sum()}$)') ax.scatter(lam[cirrus], bet[cirrus], marker='s', s=30, color='C1', edgecolor='k', linewidth=0.3, alpha=0.7, zorder=3, label=f'cirrus-confirmed ($N={cirrus.sum()}$)') ax.scatter(lam[compact], bet[compact], marker='*', s=190, color='C3', edgecolor='k', linewidth=0.5, zorder=5, label=f'compact submm ($N={compact.sum()}$)') ax.grid(True, alpha=0.3) ax.set_xticklabels([f'{v}$^\\circ$' for v in [150, 120, 90, 60, 30, 0, 330, 300, 270, 240, 210]], fontsize=8) ax.set_xlabel('Galactic longitude $l$') ax.set_ylabel('Galactic latitude $b$') ax.legend(loc='upper right', bbox_to_anchor=(1.13, 1.12), fontsize=8) ax.set_title('FIR-flux revealed O stars by high-resolution verdict ' '(Galactic Aitoff)\n', fontsize=11) fig.tight_layout() fig.savefig('fig_ostar_skymap.png', dpi=140) print('wrote fig_ostar_skymap.png') # where are the 73? latitude/longitude/distance breakdown print(f'\nuncovered N={uncov.sum()}:') print(f' |b|>1 deg: {(np.abs(gb[uncov])>1).sum()} |b|>2: {(np.abs(gb[uncov])>2).sum()}') print(f' median |b|={np.median(np.abs(gb[uncov])):.2f}, median d={np.median(np.array(t["d"])[uncov]):.2f} kpc') d = np.array(t['d'], float) print(f' d<1kpc: {(d[uncov]<1).sum()}, 1-2: {((d[uncov]>=1)&(d[uncov]<2)).sum()}, ' f'>2: {(d[uncov]>=2).sum()}')