Context: It has been proposed that H$_2$ near-infrared lines may be excited by cosmic rays and allow for a determination of the cosmic-ray ionization rate in dense gas. One-dimensional models show that measuring both the H$_2$ gas column density and H$_2$ line intensity enables a constraint on the cosmic-ray ionization rate as well as the spectral slope of low-energy cosmic-ray protons in the interstellar medium (ISM). Aims: We aim to investigate the impact of certain assumptions regarding the H$_2$ chemical models and ISM density distributions on the emission of cosmic-ray induced H$_2$ emission lines. This is of particular importance for utilizing observations of these lines with the James Webb Space Telescope to constrain the cosmic-ray ionization rate. Methods: We compare the predicted emission from cosmic-ray induced, ro-vibrationally excited H$_2$ emission lines for different one- and three-dimensional models with varying assumptions on the gas chemistry and density distribution. Results: We find that the model predictions of the H$_2$ line intensities for the (1-0)S(0), (1-0)Q(2), (1-0)O(2) and (1-0)O(4) transitions at 2.22, 2.41, 2.63 and 3.00 $\mu$m, respectively, are relatively independent of the astro-chemical model and the gas density distribution when compared against the H$_2$ column density, making them robust tracer of the cosmic-ray ionization rate. Conclusions: We recommend the use of ro-vibrational H$_2$ line emission in combination with estimation of the cloud's H$_2$ column density, to constrain the ionization rate and the spectrum of low energy cosmic-rays.
Comment: Accepted by A&A