charlesll / rampy

Python software for spectral data processing (IR, Raman, XAS...)
GNU General Public License v2.0
222 stars 61 forks source link

synergies with infrared emission code? #13

Open erwanp opened 5 years ago

erwanp commented 5 years ago

Hello,

I see that rampy is used to process IR spectra, but I do not know the needs of the geophysicist community : I've developed a high-resolution infrared emission code for gases, called RADIS. Do you ever need to calculate such spectra?

In that case, I'm considering updating my code (https://github.com/radis/radis) to make the output compatible with the rampy analysis tools

charlesll commented 5 years ago

Hi,

Well, it could be useful for some of us for treatment of spectra acquired on gas inclusions for instance!

Rampy is not limited for use in geosciences, but aimed at providing help for treatment of spectral data in general. It is built with a KISS principle in mind: data are numpy arrays, most of the processing remains low level (functions allow to fit baselines, smooth spectra, etc., but you have to chain them yourself) except the machine learning stuffs that are high level API to scikit-learn algorithms. This is to actually allow easy interfacing of rampy with the other libraries like scipy, numpy, pandas or scikit-learn.

So as long as you can enter x-y spectra as numpy arrays, interfacing with rampy should be easy!

Now, your project is interesting and I think I will add a comment on Rampy README referring to it, so users are guided toward it if they need to do this kind of processing. We could also consider adding a API toward RADIS in Rampy if you want.

erwanp commented 5 years ago

Thanks for your answer and your interest! I'm glad there may be some use case: I guess gas inclusion experiments return transmittance spectra?

In that case everything could be done on the user side and be as simple as:

from radis import calc_spectrum
s = calc_spectrum(....)    # species, pressure, temperature, mole fraction etc.
s.apply_slit(...)                # apply spectrometer broadening function
spectrum = np.array(s.get('transmittance'))
# And then use rampy magics on the spectrum object

We could simply suggest that in the docs and there is no real need for an interface.

To start with, I referenced rampy in the new version of the radis readme and website.