Skip to content

Commit c371981

Browse files
committed
re-introduce uncertainty fallbacks for HorneExtract
1 parent 9e2aedc commit c371981

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jdaviz/configs/specviz2d/plugins/spectral_extraction/spectral_extraction.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from jdaviz.core.marks import PluginLine
1515

1616
from astropy.modeling import models
17-
from astropy.nddata import UnknownUncertainty
17+
from astropy.nddata import NDData, StdDevUncertainty, VarianceUncertainty, UnknownUncertainty
1818
from astropy import units
1919
from specreduce import tracing
2020
from specreduce import background
@@ -884,6 +884,10 @@ def export_extract(self, **kwargs):
884884
if self.ext_type_selected == 'Boxcar':
885885
ext = extract.BoxcarExtract(inp_sp2d, trace, width=self.ext_width)
886886
elif self.ext_type_selected == 'Horne':
887+
if inp_sp2d.uncertainty is None:
888+
inp_sp2d.uncertainty = VarianceUncertainty(np.ones_like(inp_sp2d.data))
889+
if not hasattr(inp_sp2d.uncertainty, 'uncertainty_type'):
890+
inp_sp2d.uncertainty = StdDevUncertainty(inp_sp2d.uncert)
887891
ext = extract.HorneExtract(inp_sp2d, trace)
888892
else:
889893
raise NotImplementedError(f"extraction type '{self.ext_type_selected}' not supported") # noqa

0 commit comments

Comments
 (0)