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

SDVoigt Absorption Coefficient Repeatable Errors #32

Open
lidardoug opened this issue Feb 7, 2022 · 0 comments
Open

SDVoigt Absorption Coefficient Repeatable Errors #32

lidardoug opened this issue Feb 7, 2022 · 0 comments

Comments

@lidardoug
Copy link

Hello! I think I've found two reproducible issues with absorptionCoefficient_SDVoigt. These might be user error, but I want to put them in front of the community just in case. Any guidance would be greatly appreciated.

In this first example, an extremely low pressure value (1e-5 atm) throws an IndexError whereas a slightly higher pressure doesn't (1e-4 atm). Newer versions of Numpy throw errors on mismatches of shape/size when binary-indexing arrays - which appears to be what's happening here. Older versions didn't care. Don't know if that could be part of the issue? Also, if you use absorptionCoefficient_Voigt insetad of absorptionCoefficient_SDVoigt, it appears to work just fine.

from hapi import *
db_begin('data')

fetch('CO2', 2, 1, 6350, 6375, ParameterGroups=[
      '160-char', 'Voigt', 'SDVoigt'])

nu, coef = absorptionCoefficient_SDVoigt(
    SourceTables='CO2',
    Environment={'T':117,'p':1e-05},# THIS PRESSURE VALUE THROWS THE ERROR BELOW
    #Environment={'T': 117, 'p': 1e-04},  # THIS PRESSURE VALUE WORKS
    WavenumberRange=[6350, 6375],
    WavenumberStep=0.001,
    HITRAN_units=True)

#   File "C:\ProgramData\Anaconda3\lib\site-packages\hapi\hapi.py", line 33898, in pcqsdhc
#     WR1_PART4[index_CPF] = WR1

# IndexError: boolean index did not match indexed array along dimension 0; dimension is 371 but corresponding boolean dimension is 370

User elizamanelli also posted an issue with this same pcqsdhc (partially-Correlated quadratic-Speed-Dependent Hard-Collision Subroutine) ... I don't have the expertise to tell if it's related.

In this second example, the absorption coefficients returned are all zeros. Similarly to the previous example, if you use absorptionCoefficient_Voigt insetad of absorptionCoefficient_SDVoigt, it works just fine.

from hapi import *
db_begin('data')

wnlowbound = 6045
wnhighbound = 6070
fetch('CH4',6,1,wnlowbound,wnhighbound,ParameterGroups=['160-char','Voigt','SDVoigt'])

nu, coef = absorptionCoefficient_SDVoigt( #this works fine if I just do Voigt instead of SDVoigt
    SourceTables='CH4',
    #Environment={'T':Tnow,'p':Pnow},
    WavenumberRange=[wnlowbound, wnhighbound],
    WavenumberStep=0.001,
    HITRAN_units=True)

# coef
# Out[2]: array([0., 0., 0., ..., 0., 0., 0.])
#sum(coef>0)
#Out[3]: 0

Again, any guidance would be greatly appreciated.

~Doug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant