Galaxy gas as obscurer: I. GRBs x-ray galaxies and find a N_H ~ M* relation
An important constraint for galaxy evolution models is how much gas resides in galaxies, in particular at the peak of star formation z=1-3. We attempt a novel approach by letting long-duration Gamma Ray Bursts (LGRBs) x-ray their host galaxies and deliver column densities to us. This requires a good understanding of the obscurer and biases introduced by incomplete follow-up observations. We analyse the X-ray afterglow of all 844 Swift LGRBs to date for their column density $N_H$. To derive the population properties we propagate all uncertainties in a consistent Bayesian methodology. The $N_H$ distribution covers the $10^{20-23}\mathrm{cm}^{-2}$ range and shows no evolutionary effect. Higher obscurations, e.g. Compton-thick columns, could have been detected but are not observed. The $N_H$ distribution is consistent with sources randomly populating a ellipsoidal gas cloud of major axis $N_H^\text{major}=10^{23}\mathrm{cm}^{-2}$ with 0.22 dex intrinsic scatter between objects. The unbiased SHOALS survey of afterglows and hosts allows us to constrain the relation between Spitzer-derived stellar masses and X-ray derived column densities $N_H$. We find a well-constrained powerlaw relation of $N_H=10^{21.7}\mathrm{cm}^{-2}\times\left(M_{\star}/10^{9.5}M_{\odot}\right)^{1/3}$, with 0.5 dex intrinsic scatter between objects. The Milky Way and the Magellanic clouds also follow this relation. From the geometry of the obscurer, its stellar mass dependence and comparison with local galaxies we conclude that LGRBs are primarily obscured by galaxy-scale gas. Ray tracing of simulated Illustris galaxies reveals a relation of the same normalisation, but a steeper stellar-mass dependence and mild redshift evolution. Our new approach provides valuable insight into the gas residing in high-redshift galaxies.