Skip to content
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

New spectral quantities (transmittance & absorption) #179

Closed
erwanp opened this issue Jan 9, 2021 · 4 comments · Fixed by #449
Closed

New spectral quantities (transmittance & absorption) #179

erwanp opened this issue Jan 9, 2021 · 4 comments · Fixed by #449
Labels
🚀 enhancement New feature or request

Comments

@erwanp
Copy link
Collaborator

erwanp commented Jan 9, 2021

Current https://radis.app plots the spectrum emission ("radiance"). Many spectroscopists are also looking for spectrum absorption, with either "transmittance" and absorption coefficient / opacity ("abscoeff").

Suggested implementation :

A first version should be quite easy to implement as RADIS backend already computes all of these quantities.

  • We would need a button [dropdown listchoice ?] for "emission" / "transmittance" / "opacity" [which is shorter than "absorption coefficient"] that would feed a variable quantity [or whatever]

  • plot_spectrum should be modified to something along the lines of :

if quantity == 'emission':
    if request.query_params.simulate_slit:
        var = 'radiance'
   else:
       var = 'radiance_noslit'
elif quantity == 'transmittance':
    if request.query_params.simulate_slit:
        var = 'transmittance'
   else:
       var = 'transmittance_noslit'
elif quantity == '
    if request.query_params.simulate_slit:
        ## this is not implemented in radis because it makes little sense from an experimentalist perspective (this quantity is never measured directly), but could be if people want to use it to "filter" the spectrum. 
   else:
       var = 'transmittance_noslit'
else:
    raise ValueError

For the moment switching from emission to transmittance would require the users to recompute the spectrum (which would be quite fast as the bottleneck is the automatic download of the files, which would be cached on the 2nd try). If #153 is implemented and the Spectrum object is stored, then switching would not even require to recompute the spectrum at all and could be made instantaneous !

@erwanp erwanp added the 🚀 enhancement New feature or request label Jan 9, 2021
@erwanp
Copy link
Collaborator Author

erwanp commented Mar 18, 2021

Hello @suzil !

Have shown the app around to some people recently, and they were impressed : well done !

Many ask about absorption features. Do you think it's easy to add a simple component to choose between transmittance / absorption coefficient / radiance ?

@suzil
Copy link
Collaborator

suzil commented Mar 18, 2021

Yup! I can prioritize doing this.

@suzil
Copy link
Collaborator

suzil commented Mar 19, 2021

elif quantity == 'transmittance':
    if request.query_params.simulate_slit:
        var = 'transmittance'
   else:
       var = 'transmittance_noslit'
elif quantity == '
    if request.query_params.simulate_slit:
        ## this is not implemented in radis because it makes little sense from an experimentalist perspective (this quantity is never measured directly), but could be if people want to use it to "filter" the spectrum. 
   else:
       var = 'transmittance_noslit'

What's the point of having an opacity/absorption coefficient option if it's treated the same as transmittance?

this is not implemented in radis because it makes little sense from an experimentalist perspective (this quantity is never measured directly), but could be if people want to use it to "filter" the spectrum.

Would it make sense to leave it off for now if we don't treat opacity any difference than transmittance? @erwanp

@erwanp
Copy link
Collaborator Author

erwanp commented Apr 13, 2021

Hello, seems I never answered this, sorry !

"absorption coefficient" is never measured, so won't be used by experimentalists (people measure either radiance or transmittance spectra). However, it's of interest for people doing modeling.

Btw, transmittance (without slit function) is just :

T = exp(-k L)   

where k is the absorption coefficient I'm talking about. Then transmittance is convolved with a slit function to obtain the experimental transmittance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
2 participants