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

Extend Trace/Background/Extract to support specutils.Spectrum1D objects as inputs #130

Closed
kecnry opened this issue Aug 30, 2022 · 1 comment · Fixed by #144
Closed

Extend Trace/Background/Extract to support specutils.Spectrum1D objects as inputs #130

kecnry opened this issue Aug 30, 2022 · 1 comment · Fixed by #144

Comments

@kecnry
Copy link
Member

kecnry commented Aug 30, 2022

this would be useful, especially for tracking units and so that wavelength solutions can be propagated to the returned objects.

@pllim
Copy link
Member

pllim commented Sep 12, 2022

Back in spacetelescope/jdaviz#1608 , I tried doing this but it turned flux unit from MJy into MJy2. But without this (current behavior), it turns MJy into DN.

--- a/jdaviz/configs/specviz2d/plugins/spectral_extraction/spectral_extraction.py
+++ b/jdaviz/configs/specviz2d/plugins/spectral_extraction/spectral_extraction.py
@@ -644,7 +644,9 @@ class SpectralExtraction(PluginTemplateMixin):
             self.update_marks(step='ext')

         trace = self._get_ext_trace()
-        inp_sp2d = self._get_ext_input_spectrum()
+
+        # FIXME: Passing in Quantity turns MJy into MJy2. But not passing it in gives DN.
+        inp_sp2d = self._get_ext_input_spectrum().flux

         if self.ext_type_selected == 'Boxcar':
             ext = extract.BoxcarExtract(inp_sp2d.data, trace, width=self.ext_width)

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 a pull request may close this issue.

2 participants