-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add predict_time(), make broadening_method = "voigt" as default , add default truncation of 50 cm-1 #343
Conversation
radis/lbl/calc.py
Outdated
broadening_max_width = 300 | ||
if (wavenum_max - wavenum_min) < 300: | ||
broadening_method = "fft" | ||
else: | ||
broadening_method = "voigt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually, as discussed in #340 ; we'll just use voigt
all the time.
Can you
- change
broadening_max_width
totruncation=Default("300")
;neighbour_lines=0
- keep broadening_method everywhere, it's a good addition and can be used to easily switch/commpare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erwanp in case if the user gives all values that are broadening_max_width
and truncation
should we use the truncation
value and neighbour_lines
?
Also what will be the value of neighbour_lines
based on different spectral range
, optimization
and broadening_method
or we keep it manual and set it to 0 as default for every case?
Codecov Report
@@ Coverage Diff @@
## develop #343 +/- ##
===========================================
+ Coverage 75.50% 76.01% +0.50%
===========================================
Files 152 152
Lines 16769 16954 +185
===========================================
+ Hits 12662 12888 +226
+ Misses 4107 4066 -41 |
Is the calculation mode set to DIT/Voigt by default? |
Yes with a broadening_max_width =300 and a broadening_max_width = 10 for LBL. |
@@ -19,6 +19,7 @@ | |||
Tgas=1000, # K | |||
mole_fraction=0.1, | |||
path_length=1, # cm | |||
broadening_method="fft", # @ dev: Doesn't work with 'voigt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know what fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AttributeError: 'DataFrame' object has no attribute 'selbrd'
Basically voigt
uses df.selbrd
to calculate the voigt_broadening_HWHM
. Seems like the exomol
data doesn't have this particular column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@minouHub you'll be interested
Normally, the other broadening (i.e. airbrd in HITRAN, may be different in ExoMol) is used when selbrd is missing.
radis/lbl/factory.py
Outdated
if optimization is None: | ||
if self.verbose >= 3: | ||
printg( | ||
"LDM algorithm not used. Defaulting truncation from {0} to 10".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can actually keep 0 in any case.
Well add an a posteriori Accuracy warning if needed
…date wavenumber_calc
radis/lbl/factory.py
Outdated
@@ -529,38 +530,29 @@ def __init__( | |||
if optimization is None: | |||
if self.verbose >= 3: | |||
printg( | |||
"LDM algorithm not used. Defaulting truncation from {0} to 10".format( | |||
"LDM algorithm not used. Defaulting truncation from {0} to 0".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made an error here. Default truncation should be 300 cm-1. And default neighbor likes should be 0. Algorithm shouldn't matter (DIT /Voigt and LBL/Voigt have same truncation, only DIT/FFT should raise an error if truncation as its not implemented yet)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DIT/Voigt with 300 cm-1 truncation will be feasible, but I'm not sure about LBL/Voigt. As seen from the benchmarks before, LBL is independent of spectral range i.e. neighbour_lines, but is dependent on the truncation. And for a truncation=300cm-1, the calculation time and memory will be very expensive. So a default 300 cm-1 may not be feasible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point for the performance drop. But at least the physics remain the same, so it's a good reason to have 300 cm-1 always (similar to the remark of @dcmvdbekerom in #340 : we don't want to change the physical output without the user knowing / deciding)
Given DIT/Voigt is the default, it should be fine in most cases.
And anyway, if the predict_time() is given before the broadening step, the user will know.
We can add an extra PerformanceWarning (with suggestion to switch to DIT/Voigt) if predicted calculation time exceeds a few minutes.
…date wavenumber_calc
also minor refactor of register() function in HITEMPDatabaseMAnaager add note that all registred files will only be downloaded when required (as pointed out in radis#306)
works if truncation=None fix truncation being half-with and not lineshape full width (in docstrings and code)
with new offset, no need to distinguish between lines in the range and lines outside the range whose half-lineshape only needs to be summed. (performance ~ same on CO 2100-2200 cm-1 )
…ing_max_width (full width) fix truncation not appearing in Spectrum conditions if None
…idth' improve an error message
fix a warning
(refactor) do not store full woutrange array, just store a tuple add arange_len function, add tests
… but give a suggestion on what to replace it with
This pull request introduces 1 alert when merging de1f5e5 into 1241f08 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 00720e0 into 1241f08 - view on LGTM.com new alerts:
|
Description
This pull request adds the
predict_time()
method in SpectrumFactory to precompute the estimated time taken by Legacy>Voigt, LDM>Voigt, and LDM>FFT methods.Splits
broadening_max_width
into 2 parameters -neighbour_lines
andtruncation
.Sets DIT>Voigt as default method with a truncation=300 cm-1 and neighbour_lines = 0.
For LBL>Voigt, truncation=Spectral_range with neighbour_lines = None
Fixes #340
todo :