HII-CHI-mistry-UV is a python program that calculates, for gaseous nebulae ionized by massive stars or active galactic nuclei, the oxygen abundance in terms of 12+log(O/H), the carbon-to-oxygen ratio as log(C/O) and the ionisation parameter as log U, consistently with the direct method. This is done from the bayesian-like comparison between large grids of photoionization models and observed emission-line intensities in the ultraviolet and optical spectral ranges. The methodology and the results are described in Pérez-Montero & Amorín (2017) for star-forming galaxies and in Pérez-Montero et al (2023b) for the Narrow -Line Region in AGN.
MOST RECENT VERSION
The most recent version for HII-CHI-mistry-UV is version 5.0. The link leads to a compressed tar.gz file containing the python file of the code, the libraries of the models and the constrains, and a file with instructions. Previous versions of the program can be obtained in the History and Downloads section. They can also be found in GitHub.
How to run it
HII-CHI-mistry-UV has been originally written in python v. 2.7, but from version 5 is only compatible with python 3. It requires the library numpy (versions previous to v2.0 use the library asciidata).
The program also requires the files of the emission line intensities predicted by the models, calculated assuming different sets of input conditions. All were calculated with Cloudy v.17. These libraries are stored in the folder Library_UV and include models for star-forming galaxies using spectral energy distributions from POPSTAR and from BPASS v.2.1.
For the NLR in AGNs, the libraries include results from models calculated using a double composite power-law with parameter alpha(UV) = -1.0 and for two possible values of alpha(OX) = -0.8 and -1.2, or assuming different criteria for the stopping of calculations in the models (2% or 98% fraction of free electrons), or the presence or absence of dust. Nevertheless, in addition the codee also admits grids of models defined by the user.
The code also requires files to constrain the model grids when a limited set of emission-lines are given as input. These are stored in the folder Constrains and can also be edited by the user. These files represent the set of models, limiting the values of log U at each Z , and limiting also the values of C/O as a function of O/H.
To run the program, just type (for v5.0, in other versions use the name of the corresponding python script:
Alternatively, from version 3.2 it is possible to specify in the prompt the input file and the number of iterations for the Monte Carlo simulation (e.g. python HCm-UV_v5.0.py input.dat 100).Once the input file has been specified in the prompt or by direct question, the code will ask about what SED of models is going to be used:
(1) Young POPSTAR massive cluster
(2) BPASS cluster models atmospheres with binaries
(3) double composite power-law AGN.
If AGN is selected, the code will also ask for the value of alpha(OX). considered in the models, the stopping criterion and the presence of dust. Later, once selected the model SED, the program will ask for the template files used to constrain the models and for the possible use of a interpolated high-resolution grid (0: non-interpolated or 1: interpolated). This will increase the resolution of the grid in O/H, C/O and log U in a factor 10, but it will slow down the calculation.
The input file
It is a separated file written in text format with the information organised as a table whose first row contains the labels for the different columns, corresponding to the identification of each row and the emission line fluxes and their errors. The table can contain columns for other quantities, but the code will only read the following
ID for the identification name of the row
eLya_1216: Ly alpha HI 1216 and its error
eNV_1239: nV] 1239 and its error
eCIV_1549: CIV] 1549 and
eHeII_1640: HeII 1640
and its error
eOIII_1665: OIII] 1665 and its error
eCIII_1909: CIII 1909 and its
eHb_4861: Hb HI 4861 and its error
eOIII_5007: [OIII] 5007 and its error
all of them reddening corrected. It is not mandatory to introduce all lines but, if a line is included in the file and no information exists about it or its error, it must be typed as zero. Notice that contrary to HII-CHI-mistry for the optical the lines do not have to be relative to Hß flux.
If the input file is correct, the program will ask for the chosen SED and the use of
interpolations and it will begin to calculate the wanted
quantities and their corresponding errors.
The information will be displayed on the screen for each object, along with the ratio of completeness of the task. It will be also added an index indicating if a specific constrain has been used, where
1: the complete grid is used (only if [OIII] 5007/1665 > 0)
2: the log U limited grid is used (when [OIII] 1665/5007 = 0)
3: the log U and C/O limited grid is used (if, besides, CIII]/OIII] cannot be obtained).
At the end, the program will create a file called using the name of the input file + "_hcm-output.dat with the information of the used models, the identification of each row, the input emission line fluxes and their errors, and seven columns with the solutions corresponding to the following information:
error of 12+log(O/H)
log(C/O) (-10 if grid 3 is used)
error of log(C/O)
error of log(U) (take with care if constrains 2 or 3 are used)
History and Downloads
Here we list the different versions of the program with links to download them.
- Version 5.0 (2022/10). Now SEDs for AGNs have been incorporated, using the same models and methodology as described for the optical version of the code in Pérez-Montero et al (2019). Two different values for the parameter alpha(OX) or for the stopping criterion in the models, and the presence or absence of dust are considered. More details can be found in Pérez-Montero et al (2023b).
- Version 4.23 (2022/06). The code treats now as an observable for C/O derivation both C3O3 and C34O3, and going back to the linear form of these ratios, as in version 3 and previous, instead taking the logarithm. This implies lower values of C/O around the uncertainty, but in better agreement with the model predictions.
- Version 4.22 (2022/04). The code automatically sorts the grid of models to perform the interpolation. A bug related with the output file when additional columns are introduced in the input file has been fixed.
- Version 4.2 (2022/01). The user can now select the constraints to generate limited grids for the code. Libraries with models and constraints are stored in particular folders. Changes in the code to optimize the reading of the files. The output file no longer shows columns with emission lines that were not introduced as inputs.
- Version 4.11 (2021/03) . New models for Extreme Emission Line Galaxies using BPASS model atmospheres have been added.
- Version 4.01 (2021/02) . The code admits now for the input labels and it is not mandatory to give all possible emission lines. An ID columns is now allowed. Now interpolation for the models are also possible multiplying by a factor 10 the resolution in O/H, C/O, and log U. The code now considers HeII 1640 in the calculations for O/H.A bug in relation to the calculation of C3O3 in version 3.3 and 4.0 has been fixed.
- Version 3.2 (2019/09) The code is now compatible with python 3 and some additional management of the errors has been added. The output file has now a header.
- Version 3.1 (2019/01) The models have been now calculated with Clooudy v.17. The range in metallicity has been extended down to 12+log(O/H) = 6.9.
- Version 3.02017/09) The errors of the intensity lines are now considered to take them into account in the calculation of the errors of the chemical abundances and log U using an iterative Monte-Carlo simulation.
- - Version 2.0 (2017/01)