hitranonline / hapi

HITRAN Application Programming Interface (HAPI)
Other
76 stars 35 forks source link

diluent #34

Open jyeonp opened 2 years ago

jyeonp commented 2 years ago

Hello,

I am a new user of HAPI, and I am having trouble understanding what the diluent parameter is. I have read the HAPI manual and tried to research articles online, and I understand what this does to the line function broadening in relation to gamma. However, I still don't understand what this actually means in relation to species I am considering

For example, if I am working with O2 (all isotopes), how much O2 is there in relation to the broadening mixture? In other words, what does it means to set diluent = {'self' : 1} or diluent = {'air' : 1} or diluent = {'O2': 1} in relation to the absorbing species? Note that I get different results for each of these. Why is the difference between 'O2' and 'self'? If I just have a reference cell filled with O2, do I need a broadening mixture? and If you look at the manual, you can enter volume mixing ratio as gas mixture composition, so I wonder if the concentration is reflected in the result of the spectrum simulation.

erwanp commented 2 years ago

33 as well as this answer https://github.com/hitranonline/hapi/issues/3#issuecomment-437848526 from the Hitran team may be helpful

jmmelko commented 2 years ago

I am sorry but I can't fully agree with the developer's answer.

Indeed, when using anything else than 'air' as a broadener the code will revert to default values for gamma silently

Proof of that: try with 'fkjdsfkk' as a key in the Diluent dictionary and see that no warnings are issued.

However, if you change the call to the ladder() function by adding 'flag_exception=True', you will see this Exception:

Exception: not found in DB: ['n_CO2', 'gamma_CO2', 'gamma_CO2']

It happens with the H2O molecule, meaning that broadening of water by CO2 is not known, and I say why not?

So we have two problems here:

1/ No warning is issued when a non existing diluent is used: this is VERY DANGEROUS! 2/ CO2 broadening coefs exists in the Hitran DB, but not for all molecules, there should be some indication of that