Skip to content

Commit

Permalink
re-introduce uncertainty fallbacks for HorneExtract
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Dec 8, 2022
1 parent 9e2aedc commit c371981
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from jdaviz.core.marks import PluginLine

from astropy.modeling import models
from astropy.nddata import UnknownUncertainty
from astropy.nddata import NDData, StdDevUncertainty, VarianceUncertainty, UnknownUncertainty
from astropy import units
from specreduce import tracing
from specreduce import background
Expand Down Expand Up @@ -884,6 +884,10 @@ def export_extract(self, **kwargs):
if self.ext_type_selected == 'Boxcar':
ext = extract.BoxcarExtract(inp_sp2d, trace, width=self.ext_width)
elif self.ext_type_selected == 'Horne':
if inp_sp2d.uncertainty is None:
inp_sp2d.uncertainty = VarianceUncertainty(np.ones_like(inp_sp2d.data))
if not hasattr(inp_sp2d.uncertainty, 'uncertainty_type'):
inp_sp2d.uncertainty = StdDevUncertainty(inp_sp2d.uncert)
ext = extract.HorneExtract(inp_sp2d, trace)
else:
raise NotImplementedError(f"extraction type '{self.ext_type_selected}' not supported") # noqa
Expand Down

0 comments on commit c371981

Please sign in to comment.