Skip to content

Commit

Permalink
Remove flux_err component for components with no error
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Jan 3, 2025
1 parent 6522156 commit 10999ce
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lcviz/components/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,13 @@ def _on_change_selected(self, *args):
# exporting back to a lightkurve object works as expected
self.app._jdaviz_helper._set_data_component(dc_item, 'flux', dc_item[self.selected])
if self.selected+"_err" in dc_item.component_ids():
self.app._jdaviz_helper._set_data_component(dc_item, 'flux_err',
dc_item[self.selected+"_err"]) # noqa
if "flux_err" in dc_item.component_ids():
self.app._jdaviz_helper._set_data_component(dc_item, 'flux_err',
dc_item[self.selected + "_err"])
else:
dc_item.add_component(dc_item[self.selected + "_err"], 'flux_err')
else:
nan_errs = np.empty(dc_item['flux'].shape)
nan_errs[:] = np.nan
self.app._jdaviz_helper._set_data_component(dc_item, 'flux_err', nan_errs)
dc_item.remove_component(dc_item.find_component_id('flux_err'))

dc_item.meta['FLUX_ORIGIN'] = self.selected

Expand Down

0 comments on commit 10999ce

Please sign in to comment.