-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix SB/flux scale factor #2860
fix SB/flux scale factor #2860
Conversation
01f0da0
to
1c10f96
Compare
CHANGES.rst
Outdated
@@ -49,6 +51,8 @@ Cubeviz | |||
``wavelength_unit`` (use ``value_unit``), ``show_wavelength`` (use ``show_value``), | |||
``slice`` (use ``value``). [#2878] | |||
|
|||
- Spectral Extraction: renamed ``collapse_to_spectrum(...)`` to ``extract(...)``. [#2859] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a rebase conflict here, I kept this in (which it should be once background subtraction is merged). If I needs to be taken out, will do
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2860 +/- ##
=======================================
Coverage 88.69% 88.70%
=======================================
Files 111 111
Lines 17122 17132 +10
=======================================
+ Hits 15187 15197 +10
Misses 1935 1935 ☔ View full report in Codecov by Sentry. |
cd44f43
to
df4e848
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I've made a few suggestions to improve the comments since the unit conversion operations can be tricky even with perfect comments.
eqv = [] | ||
# if spectrum data collection item is in Surface Brightness units | ||
if u.sr in spec.unit.bases and len(values) != 2: | ||
# Data item in data collection does not update from conversion/translation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Data item in data collection does not update from conversion/translation. | |
# Data item in data collection will not be updated by conversion/translation. |
jdaviz/app.py
Outdated
# App wide orginal data units are used for conversion, orginal_units and | ||
# target_units dicate the conversion to take place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# App wide orginal data units are used for conversion, orginal_units and | |
# target_units dicate the conversion to take place. | |
# App wide original data units are used for conversion, original_units and | |
# target_units dictate the conversion to take place. |
jdaviz/app.py
Outdated
# Data item in data collection does not update from conversion/translation. | ||
# App wide orginal data units are used for conversion, orginal_units and | ||
# target_units dicate the conversion to take place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this comment like the earlier one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So many typos 😅
jdaviz/app.py
Outdated
pixel_scale_min = (Quantity(spec.meta['_pixel_scale_factor'][0])).value | ||
pixel_scale_max = (Quantity(spec.meta['_pixel_scale_factor'][-1])).value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anything guarantee that spec.meta['_pixel_scale_factor']
is sorted? If not, use min
and max
rather than [0]
and [-1]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following the convention used for getting the limits of the spectrum axis, and do agree ensuring that these 2 values used are actually the min and max of the scale factor array!
Don't forget to add a changelog entry. |
df4e848
to
119cfb9
Compare
…ectrum wide conversion condition
119cfb9
to
462df24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
Description
This pull request updates the scale-factor used for converting a spectrum between surface-brightness and flux units to use the wavelength-dependent aperture area (array) instead of the cone's scale factor at the current slice (float).
This should be rebased on top of main after #2859 is merged. See #2859 (comment) for more details.
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.