You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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.
Again, any guidance would be greatly appreciated.
~Doug
The text was updated successfully, but these errors were encountered: