Back to main page


HII-CHI-mistry_UV is a python program that calculates, for gaseous nebulae ionised by massive stars, 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, from a set of emission-line UV and optical intensities consistently with the direct method.
The methodology and the results are described in Pérez-Montero & Amorín (2017)..


Each compressed file contains the python file of the code, the libraries of the models and a file with instructions. -


HII-CHI-mistry-UV has been written in python 2.7, but from version 3.2 it is compatible with python 3. It requires the library numpy. It also needs the files of the emission line fluxes predicted by the models, assuming a different
set of input conditions, including:


representing the whole set of models, the models with constrained values of O/H as a function of log U, and the models with constrained values of O/H as a function of C/O, respectively.

All were calculated with Cloudy v.17 and a POPSTAR SED with an age of 1Myr and using an IMF of Chabrier. -CO_adapted_emp_uv_v5.0.dat
To run the program, just type for version 5.0

> python HCm-UV_v5.0.py

The program will ask for the input file, but 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).


It must be written in text format. the first row must declare the labels for the introduced emission-line fluxes and errors. The next rows include the fluxes in arbitrary units of the emission lines and their errors using the following labels:

'ID': identification name
'Lya_1216' and 'eLya_1216': Lya HI 1216 and its error
'CIV_1549' and 'eCIV_1549': CIV]    1549 and its error
'HeII_1640' and 'eHeII_1640': HeII    1640 and its error
'OIII_1665' and 'eOIII_1665': OIII]  1665 and its error
'CIII_1909' and 'eCIII_1909': CIII   1909 and its error
'Hb_4861' and 'eHb_4861': Hb HI  4861 and its error
'OIII_5007' and 'eOIII_5007': [OIII] 5007 and its error

all of them reddening corrected. It is not mandatory to introduce all lines but, if no information exists about a certain line or its error, it must typed as zero. Notice that contrary to
HII-CHI-mistry for the optical the lines do not have to be relative to Hbeta flux.


If the input file is correctly introduced, the program will ask for the interpolation of the models and it will calculate the required quantities and their corresponding errors.
The information will be displayed in the screen for each object, along with the ratio of completeness of the task. It will be also added an index saying what grid was used, where

1: the complete grid is used (only if [OIII] 1665/5007 can be used).
2: the log U limited grid is used (when [OIII] 1665/5007 is not available)
3: the log U and C/O limited grid is used
(if, besides, CIII/OIII] cannot be obtained).

In addition the results will be saved on a file whose name is the name of the input file + "_hcm-uv-output.dat". The header of this file will contain all information about the chosen models. The first column will denote the assigned ID for each row and the next 14 columns of this file will be the input emission lines and their errors. Finally, it will add the following seven columns:

grid index
error of 12+log(O/H)
log(C/O) (-10 if grid 3 is used)
error of log(N/O)
log U
error of log(U) (tak

Enrique Pérez-Montero. IAA-CSIC
Last update: 2020,November

This program has been made thanks to the financial support from Spanish AYA project Estallidos