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

Add support for different modes: transmittance, radiance, and absortion coefficient #449

Merged
merged 4 commits into from
Oct 13, 2021

Conversation

suzil
Copy link
Collaborator

@suzil suzil commented Oct 6, 2021

Screen.Recording.2021-10-05.at.8.39.57.PM.mov

Anything to change here? Should the default be radiance or something else? @erwanp @minouHub

@suzil suzil requested a review from erwanp October 6, 2021 00:41
@erwanp
Copy link
Collaborator

erwanp commented Oct 6, 2021

Very nice ! I'd add Absorption coefficient as the default. Are the units of the plot updated too ?

@minouHub
Copy link
Collaborator

minouHub commented Oct 6, 2021

Hello, tried to run the webpage with yarn during an hour, couldn't, but I'm very motivated to succeed and try the new version.

Comment from the video:

  • "Absorbance" is enough (and not "absorption coefficient") EDIT

@minouHub
Copy link
Collaborator

minouHub commented Oct 6, 2021

Just found the magic command to allow me to run it: export NODE_OPTIONS=--max-old-space-size=8192
Is it normal that I cannot run a calculation in local?

More comments:

  • the slit option should disappear (or be in grey) when using absorption coefficient (EDIT Erwan : transmittance can have a slit function)

@erwanp
Copy link
Collaborator

erwanp commented Oct 6, 2021

@minouHub do you think absrotpino coefficient or absorbance is more useful ?

@suzil
Copy link
Collaborator Author

suzil commented Oct 6, 2021

Is it normal that I cannot run a calculation in local?

I typically point the API to the production backend but I have it locally set up now. I want to set it up to run the local version of the API. I'll see if I can get it working today/tomorrow.

Should be able to run the Lambda locally with sam-beta-cdk local start-api (https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-cdk-testing.html) but I get some CORS issue that I need to resolve.

@minouHub
Copy link
Collaborator

minouHub commented Oct 6, 2021

@erwanp

@minouHub do you think absrotpino coefficient or absorbance is more useful

Sorry, you're right, absorbance.

Are the units of the plot updated too ?

I believe having the unit of absorbance "-ln(I/I0)" would be nice for the user. Just to be sure we talk about the same thing (like SpectraPlot).


@suzil

I want to set it up to run the local version of the API.

Thanks. Hope it is not too much work.

Copy link
Collaborator

@erwanp erwanp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Units are currently harcoded here, but they are stored in the spectrum.
Could be something like (mix Python / JS sorry :p ) :

text : payload["mode"].capitalize() + s.units[payload["mode"]]

@@ -13,6 +13,7 @@ export interface CalcSpectrumParams {
pressure: number;
path_length: number;
simulate_slit: boolean;
mode: "radiance_noslit" | "transmittance_noslit" | "abscoeff";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mode: "radiance_noslit" | "transmittance_noslit" | "abscoeff";
mode: "radiance_noslit" | "transmittance_noslit" | "absorbance";

to get what @minouHub 's wanted

mode: event.target.value as
| "radiance_noslit"
| "transmittance_noslit"
| "abscoeff",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| "abscoeff",
| "absorbance",

@erwanp erwanp linked an issue Oct 11, 2021 that may be closed by this pull request
@suzil
Copy link
Collaborator Author

suzil commented Oct 11, 2021

I typically point the API to the production backend but I have it locally set up now. I want to set it up to run the local version of the API. I'll see if I can get it working today/tomorrow.

Adjusted master + this branch to point to the prod API endpoint for development. It's this value here: https://github.com/suzil/radis-app/blob/9a55c4caf249768be0f3e619710e75e68eb55fb0/website/public/static/js/config.js#L2

Adjusted master and rebased with this branch to invoke the local backend API and added instructions on how to do that to the README: 478a8fc

@suzil
Copy link
Collaborator Author

suzil commented Oct 13, 2021

Currently how it looks, with Absorbance now as the default.
Screen Shot 2021-10-12 at 8 03 05 PM
Screen Shot 2021-10-12 at 8 03 29 PM
Screen Shot 2021-10-12 at 8 04 02 PM

I'm using units from RADIS backend (https://github.com/suzil/radis-app/pull/449/files#diff-d45d4bd564e4f103c9d2cd4900cde1e53632e1556d0e30b4a446bac394ea02e7R81), but for some reason "absorbance" and "transmittance_noslit" are not returning any units. Any idea there?

@minouHub
Copy link
Collaborator

minouHub commented Oct 13, 2021

I'm using units from RADIS backend (https://github.com/suzil/radis-app/pull/449/files#diff-d45d4bd564e4f103c9d2cd4900cde1e53632e1556d0e30b4a446bac394ea02e7R81), but for some reason "absorbance" and "transmittance_noslit" are not returning any units. Any idea there?

Simply because they have no units :)

That looks very good to me!

EDIT: Suggestions of Erwan have been implemented, so I think you're good to merge!!!

@erwanp
Copy link
Collaborator

erwanp commented Oct 13, 2021

Yes, they're both not dimensionned. Transmittance unit can be left as it is (nothing shown). For absorbance, you may want to display (-ln(I/I0)) just to make it very clear to the user what we're talking about !

@suzil suzil merged commit a696d89 into master Oct 13, 2021
@suzil suzil deleted the add-modes branch October 13, 2021 16:16
@minouHub
Copy link
Collaborator

Hello @suzil

You merged the branch, but the page did not update on https://www.radis.app/. Also, it does not compute the spectra anymore :(
image

@suzil
Copy link
Collaborator Author

suzil commented Oct 13, 2021

Aha yeah sorry I just need to invalidate the CDN cache. It was updated on mine so I made the bad assumption it had updated!

Will run a cache invalidation now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New spectral quantities (transmittance & absorption)
3 participants