radis
radis copied to clipboard
Automatically cache noneq params (Evib, Erot, etc.) to line database cache file
🎯 Describe what you'd like
- [ ] Automatically add Evib and Erot to the .h5 line cache.
Good issue to understand how RADIS work, because it touches most files of the Line-by-line module !
This and #45 will make noneq calculations practically as fast as equilibrium, and ~10-100 times faster than now !
💡 Possible implementations
Modifications could be done to SpectrumFactory.non_eq_spectrum, in particular here check_noneq_parameters which does the job of fetching the molecule Evib/Erot, and assign to each line of the line database the corresponding Evib, Erot.
Attention points :
-
Make sure the spectroscopic constants are stored in metadata : Evib/Erot will change if user change the set of spectroscopic constants used : cache files should be regenerated automatically. See check_cache_file and how metadata is used. Add a test on that.
-
When these parameters are computed some lines may already have been discarded from the database. For instance, isotope selection is done during the loading of each database file. If modifications are done at calculation time as suggested above, the cache file would not contain all the lines of the database. Two options : also store the isotopes in metadata. Same goes for the waverange computed (again : store it in the metadata, and recompute if needed?). 2nd option : cache everything initally, at loading, for all files, so whenever a database is first initialized. Problem : people running equilibrium computations only (most users!) would end up caching all their databases. Or : have a "nonequilibrium=True/False" boolean for each database ? (could be infered from the presence of "levelsfmt" already today.
💡 a very limited H5 file for each calculation could totally replace the current mechanism where the SpectrumFactory.df0
Pandas dataframe containing all lines loaded, is copied at calculation time to SpectrumFactory.df1
(where populations will be computed based on temperature, etc.). Using a .h5 file may induce a (limited ?) performance overhead, but we could also divide the memory usage by up to 2 (see #118 ). Major refactor, though !
- Same for the "nonequiliibrum model" used for 2T approximation in polyatomic molecules (ex CO2 : a single Tvib can be defined as T1=T2=T3 or T3 only). See
group_energy_modes
in partfunc.py
Also :
- [ ] fetch_molecular_parameters can be improved & cached similarly (even for equilibrum calculations).
Tip : you can vote for New Features on https://feathub.com/radis/radis
Just so you know, I'm looking into this but I'm in the process of figuring all the code out...
Amazing. I think the starting point is the RovibParFuncCalculator class.