arunavabasucom / radis-app

A web app for high-resolution infrared molecular spectra using RADIS
https://radis.app
GNU Lesser General Public License v3.0
11 stars 15 forks source link

Save latest spectra #631

Open erwanp opened 2 years ago

erwanp commented 2 years ago

Save N latest computed spectra to improve performances when computing the same one twice


The SpectrumFactory (machinery behind calc_spectrum) can be connected to a SpecDatabase, which is really only a local folder, to automatically retrieve a Spectrum if it's already there; and store it if it's not.

This is not implemented at the calc_spectrum level, but it could be done quite easily (already asked for a few years ago in https://github.com/radis/radis/issues/135 ). The api would be something like :

s = calc_spectrum(..., local_folder="~/radis_spectra")  # automatically retrieve spectra if needed, computes and stores then if not  

Advantages :

_Originally posted by @erwanp in https://github.com/suzil/radis-app/pull/619#discussion_r942676770_