-
Notifications
You must be signed in to change notification settings - Fork 115
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 consistent units #467
Merged
Merged
Add consistent units #467
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erwanp
force-pushed
the
add/consistent-units
branch
from
May 16, 2022 07:50
c8a945d
to
9018745
Compare
…m with consistent radiance & emission coefficient (mW/cm2/sr/nm, mW/cm3/sr/nm) updated eq_spectrum, non_eq_spectrum, eq_bands, non_eq_bands add tests
apply_slit always check Spectrum is evenly distributed (fast version) new method Spectrum.resample_even()
… initially computed in wavenumber & exported in wavelength. This maintains Radis<=0.12 output
…in wavenumber, but a "default_output_unit" condition is written ; and later read by Spectrum.get() and Spectrum.plot() --> .get() and .plot() give Iunits consistent with wunit (i.e. "mW/cm2/sr/nm" if wunit~"nm" and "mW/cm2/sr/cm-1" if wunit~"cm-1" update all internal functions that used .get() to enforce Iunit - add Spectrum.get(return_units=True) option, which returns Astropy arrays - make Radiance(s), Transmittance(s) deprecated in favor of s.take("radiance") etc
…in wavenumber, but a "default_output_unit" condition is written ; and later read by Spectrum.get() and Spectrum.plot() --> .get() and .plot() give Iunits consistent with wunit (i.e. "mW/cm2/sr/nm" if wunit~"nm" and "mW/cm2/sr/cm-1" if wunit~"cm-1" update all internal functions that used .get() to enforce Iunit - add Spectrum.get(return_units=True) option, which returns Astropy arrays - make Radiance(s), Transmittance(s) deprecated in favor of s.take("radiance") etc
…rent from initial arrays (due to Iunit not specified) add exhaustive tests, testing every possible recalculation pathway (test_rescale.py) also: - show units in print(Spectrum)
erwanp
force-pushed
the
add/consistent-units
branch
from
May 16, 2022 20:27
9018745
to
5c02161
Compare
Codecov Report
@@ Coverage Diff @@
## develop #467 +/- ##
===========================================
- Coverage 77.04% 73.09% -3.96%
===========================================
Files 164 137 -27
Lines 18927 18831 -96
===========================================
- Hits 14583 13764 -819
- Misses 4344 5067 +723 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Main change, suggested by @AllanHOlesenBW : if using
default
Spectrum.get()
andSpectrum.plot()
return Iunits consistent with wunit (i.e. "mW/cm2/sr/nm" if wunit~"nm" and "mW/cm2/sr/cm-1" if wunit~"cm-1"Implementation :
Minor changes :
Radiance(s), Transmittance(s)
deprecated in favor ofs.take("radiance")
etcSpectrum.resample_even()
Spectrum.get(return_units=True)
option, which returns Astropy arrays (to make sure we always know which units are used)Fixes #456