-
Notifications
You must be signed in to change notification settings - Fork 2
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
Include possibility to change input units #616
Comments
Yes, exactly. |
So I see it lke that: define available units with multiplier.
the first one is default one. |
But what about funtions where user can change particle ? |
Let us consider https://libamtrack.github.io/web/#Particlerangeandstoppingpower/Stoppingpowervsenergy Right now we specify energy in MeV/u. Ideally user should define energy start and stop numerical values, then set the unit (MeV or MeV/u). Then user selects particle (proton or other particle). Finally when user clicks "Submit" all values are recalculated to basic reference unit (here MeV/u). For plotting and output we should stay for now with fixed unit. We could add a dictionary like you mention, but they should include not only multipliers, but also "converter functions". The tricky part is how to pass also their parameters. |
Maybe let's consider some example: https://libamtrack.github.io/web/#Particlerangeandstoppingpower/Stoppingpowervsenergy User defines start/end Energy in MeV: start 1.0 end 500.0, then picks "He" from particles, and for further calculations we have to find out MeV/u. And it would be start: 1.0/4.0026 and end 500.0/4.0026 (4,0026 is a "He" weight? ) The second thing is a question: should we change user input after submit ? Maybe it would be better to display converted values in some table, because user will have to remeber that he inserted 500.0 and recalculated value is 124,918 MeV/u and the next end value he want 600 MeV so he have to change units and if he forgets the calculations will be performed for 600MeV/u and results will be really confusing |
@marwin1991 good point. Information what kind of units were used should not be lost. First a remark - user will probably need no more than 3-4 different units (most often only 2 be used). By default only main unit is presented to the user. But there is small "Show more units button" somewhere. The tricky part is when user is changing projectile. Then I'd keep fixed the value which was changed as last (green fields). Other fields would need to be recalculated. It seems that the logic behind would need to be somehow complex. |
1. Something like that? And chaning particle will recalculate MeV/u ? 2. I am also thinking about proposition #616 (comment) and it would be displaying conversion to default value. F.e. Stopping power has default MeV/u. User picks from dropdown MeV and inputs 1000 and below green validation info apears and displays "It is: XXX.XXX MeV/u" Then user picks diffrent particle and green validation now changes to "It is: YYYY.YYYY MeV/u" |
Maybe we should use https://docs.github.com/en/discussions/quickstart ? |
I.e. specify energy in MeV or in MeV/amu
The text was updated successfully, but these errors were encountered: