Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not load energies if equilibrium calculation in calc_spectrum #298

Merged
merged 1 commit into from Jun 27, 2021

Conversation

erwanp
Copy link
Member

@erwanp erwanp commented Jun 26, 2021

Description

Fixes #297 ; directly from calc_spectrum
(was already fixed by #252 at the SpectrumFactory level by delaying the loading of rovibrational energies until a noneq calculation was triggered ; here we use the extra information we have with calc_spectrum (is it an eq or non eq calculation) to directly load rovibrational energies from the start.

@erwanp erwanp requested a review from anandxkumar June 26, 2021 11:34
@erwanp erwanp added this to the 0.9.30 milestone Jun 26, 2021
@erwanp erwanp added bug Something isn't working interface not related to the physics of the code labels Jun 26, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #298 (c449630) into develop (32fea0d) will increase coverage by 0.00%.
The diff coverage is 50.00%.

@@           Coverage Diff            @@
##           develop     #298   +/-   ##
========================================
  Coverage    75.22%   75.22%           
========================================
  Files          119      119           
  Lines        14274    14273    -1     
========================================
  Hits         10737    10737           
+ Misses        3537     3536    -1     

@anandxkumar
Copy link
Collaborator

anandxkumar commented Jun 26, 2021

Nice change! Ran it, works fine for the H20 case and CO2 equilibrium case using calc_spectrum!

Edit: I tried computing non_eq spectrum using calc_spectrum for CO2,:

opt = {
            "wavenum_min": 510,
            "wavenum_max": 600,
            "molecule": "CO2",
            "isotope": "1,2,3",
            "verbose": 3,
            "wstep": 0.01,
            "cutoff": 0,
            "broadening_max_width": 10,
            "databank": "/home/pipebomb/02_500-625_HITEMP2010.par",
            "Trot": 300,
            "Tvib":300,
            
        }

v =  calc_spectrum(**opt)

But got the error: Name: 3673, dtype: float64If using HITEMP2010 for CO2, some lines are unlabelled and therefore cannot be used at equilibrium. This is a known issue of the HITEMP database and will soon be fixed in the edition. In the meantime you can use: 'sf.df0.dropna(subset=['v1u'], inplace=True)' where 'sf' is SpectrumFactory object.

Worked for equilibrium cases. Can you share a working example for non_eq where we load the databank via path?

@erwanp
Copy link
Member Author

erwanp commented Jun 26, 2021

Thanks for the careful review!

Noneq CO2: we cannot do more than what's written. The database is missing some lines, and Radis shouldn't try to fix it alone without the user knowing. So the suggestion in the error message is the best we can do

@erwanp erwanp merged commit 6b2210d into radis:develop Jun 27, 2021
@erwanp erwanp mentioned this pull request Jul 6, 2021
@erwanp erwanp deleted the fix/do-not-load-energies-at-eq branch August 12, 2021 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working interface not related to the physics of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

H2O equilibrium calc with direct HITEMP file raises spectroscopic constants not found
3 participants