Dense Gas Toolbox

Read full text
Authors: Johannes Puschnig
Cited by: 5

Abstract

All versions DOI: 10.5281/zenodo.3686329Created by Johannes Puschnig (Quellcode 360 GmbH)www.jpuschnig.com Aim Calculate density, temperature and line optical depths from observed molecular emission lines, using radiative transfer model grids. Method The Dense Gas Toolbox is based on the assumption that molecular emission lines emerge from a multi-density medium rather than from gas at a single density alone. The gas density distribution is described either by a log-normal distribution or by a log-normal distribution with an additional power-law tail. The physical parameters are inferred by comparing observed molecular line intensities and line ratios to pre-computed radiative transfer model grids. The inferred parameters include the mass-weighted mean density, gas temperature, the width of the density distribution, and, starting with version 2, the optical depths of the observed molecular lines. The parameter inference can be performed using Bayesian statistics, i.e. Markov chain Monte Carlo (MCMC). Results Given an ASCII table of observed molecular intensities in units of K km/s, the Dense Gas Toolbox saves the inferred physical parameters to an output ASCII file. These include the mass-weighted mean density, gas temperature, width of the density distribution, and, for version 2 model grids, the line optical depths. Furthermore, diagnostic plots are created to assess the quality of the fit and the robustness of the derived parameters. Version History Version 2 series Jun 12, 2026 | Version 2.2 Added RAM-aware model-grid loading for large pickle files Model grids are now reduced earlier to the requested transitions, temperature, width, and tau constraints Temporary reduced chunks are written during loading to reduce peak memory usage Added clearer RAM and disk-space checks for large model files Improved robustness of model downloads Added optional SHA256 verification for downloaded model files tau_fiducial(type_of_models) now returns fiducial tau values matching the selected model grid Updated the example script to use fixed fiducial tau values by default. Improved compatibility with historical DGT v1.x fiducial-tau results Increased the initial MCMC burn-in phase for improved walker stability Disabled do_model_test by default in the example script Included updates to test input and example data Jun 11, 2026 | Version 2.1 Updated the code base for compatibility with Python 3.12 and Python 3.13. Updated the Python requirements to support the current Scientific Python stack, including NumPy 2.x. PTMCMCSampler and mpi4py are no longer imported unconditionally. They are only required when the optional parallel-tempered MCMC mode is used. Improved robustness of the model-grid loading procedure. Removed shell-dependent result formatting. Fixed several runtime issues exposed by newer Python versions. Added updated installation notes for Python >3.11. Dec 15, 2024 Updated model grids, including grids that cover selected transitions up to J=4-3. Added support for additional model configurations. MCMC bugfix to avoid walkers getting stuck in low-probability regions. Improved treatment of optical-depth parameters in the MCMC setup. See example.py for how to use the Dense Gas Toolbox. May 24, 2024 | Version 2.0 This is the first version 2 release of the Dense Gas Toolbox. Major changes compared to version 1.x: Updated radiative transfer model grids. The new model grids allow the line optical depths to be varied. The user may either fix optical depths to specific values or leave them as free parameters to be inferred. The inferred parameters are now: mass-weighted mean density, gas temperature, width of the density distribution, line optical depths. Models are available for log-normal and log-normal plus power-law density distributions. The model grids are stored as large pickle files and are downloaded upon usage. Molecular transitions covered by the standard version 2 grids include: 12CO up to J=3-2 HCN up to J=3-2 HCO+ up to J=3-2 13CO up to J=3-2 C18O up to J=3-2 Additional version 2 model grids include selected transitions up to J=4-3. The temperatures range from 10 to 30 K in steps of 5 K. The widths of the density distributions range from 0.2 to 0.8 dex. Available optical-depth values include: Low optical depth: 0.1, 0.2, 0.3Used for optically thinner species such as 13CO and C18O. Intermediate optical depth: 0.8, 1.1, 1.5Used for molecules such as HCN and HCO+. High optical depth: 5.0, 6.5, 8.0Used for 12CO. See example.py for how to use the Dense Gas Toolbox. Version 1 series May 22, 2024 | Version 1.7 This is the latest release that is based on the fixed optical-depth models used since version 1.3. Updated code to account for deprecation, future and syntax warnings. The following molecular transitions are covered: CO (1-0), CO (2-1), CO (3-2) HCN (1-0), HCN (2-1), HCN (3-2) HCO+ (1-0), HCO+ (2-1), HCO+ (3-2) HNC (1-0), HNC (2-1), HNC (3-2) 13CO (1-0), 13CO (2-1), 13CO (3-2) C18O (1-0), C18O (2-1), C18O (3-2) C17O (1-0), C17O (2-1), C17O (3-2) CS (1-0), CS (2-1), CS (3-2) Temperatures range from 10 to 50 K in steps of 5 K. The widths of the density distributions range from 0.2 to 0.9 dex in steps of 0.1 dex. See example.py for how to use the Dense Gas Toolbox. May 21, 2024 | Version 1.6 Bugfixed corner plot axes limits. Added debugging statements. Added INSTALL file. May 23, 2022 | Version 1.5 User may now also enter/change the number of MCMC simulations to run. Bugfix: In cases where the sampler did not converge, previous versions crashed with ValueError: cannot convert float NaN to integer when trying to produce corner plots. The program now continues execution and shows one of the following warnings: Warning: Tau is NaN, corner plot cannot be created! Warning: MCMC did not converge, you may try to increase the number of simulations (nsims)! Feb 27, 2021 | Version 1.4 Bugfix: fixed import of the CS model grid. Code updated to remove deprecation warnings. Feb 26, 2021 | Version 1.3 The user may optionally infer the parameters density, temperature and width of the density distribution using MCMC. Diagnostic corner plots are produced when MCMC is used. Code updated to Python 3.x. Re-calculation of models, including: 12CO up to J=3 13CO up to J=3 C18O up to J=3 C17O up to J=3 HCN up to J=3 HCO+ up to J=3 HNC up to J=3 CS up to J=3 Mar 31, 2020 | Version 1.2 An online version became available at: http://www.densegastoolbox.com The models can be explored using an interactive application at: http://www.densegastoolbox.com/explorer Model fit parameters are: mass-weighted density, temperature, width of the density distribution. The temperature and width can be fixed. Re-calculation of models, including: 12CO up to J=3 13CO up to J=3 C18O up to J=3 C17O up to J=3 HCN up to J=3 HCO+ up to J=3 HNC up to J=3 The one-zone model grids are more extended, with H2 densities between 10^-2 and 10^8 cm^-3. Diagnostic plots improved: n,T versus chi2 and n,width versus chi2. See example.py for how to use the Dense Gas Toolbox. This version still requires Python 2.7. Feb 28, 2020 | Version 1.1 This release includes the data table ascii_galaxy.txt used by example.py. Feb 25, 2020 | Version 1.0 Initial release. Models are included for the following lines: 12CO (1-0) 12CO (2-1) 12CO (3-2) 13CO (1-0) HCN (1-0) HNC (1-0) HCO+ (1-0) Abundances and optical depths are fixed based on observations of the EMPIRE survey. Two density distributions are available: log-normal, log-normal plus power-law tail. Model fit parameters are: mass-weighted density, temperature, width of the density distribution. The temperature can be fixed. Emissivities per density bin are calculated using RADEX, i.e. the LVG method for an expanding sphere. The one-zone model grids are limited to H2 densities between 10 and 10^8 cm^-3. The total line intensity is calculated by summing the emissivities per H2 molecule along the gas density distribution and multiplying by column density per linewidth and molecular abundance. For some models, at the very low and very high density ends, the extent of the density PDF exceeds the one-zone density grid limits. In these regimes, where emissivities are very low for the molecules under consideration, the emissivities are set constant to the grid-limit value. See example.py for how to use the Dense Gas Toolbox. This version requires Python 2.7. Dependencies include: NumPy, Matplotlib, pylab and SciPy.

Fields of Study & Subjects

Catalysis and Oxidation Reactions Spectroscopy and Laser Applications Advanced Chemical Physics Studies

Publication details

Volume
36
Pages
34964
Publication date
12 June 2026
Language
EN