spacetelescope / jdaviz

JWST astronomical data analysis tools in the Jupyter platform
https://jdaviz.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
134 stars 71 forks source link

composite models with degeneracy fail to expose uncertainties #2098

Open Jdaviz-Triage-Bot opened 1 year ago

Jdaviz-Triage-Bot commented 1 year ago

Reporter: Kyle Conroy

running a model on linear+polynomial does run and expose values, but does not expose uncertainties.  Should this combination (and other combinations of constant, linear, polynomial of various orders) even be allowed?  If so, we should at least expose a warning as its confusing as a user that uncertainties suddenly disappear.

script to reproduce:

from jdaviz import Specviz
specviz = Specviz(verbosity='error', history_verbosity='debug')

import tempfile
from astroquery.mast import Observations
data_dir = tempfile.gettempdir()
fn = "jw02732-o004_t004_miri_ch1-shortmediumlong_x1d.fits"
result = Observations.download_file(f"mast:JWST/product/\{fn}", local_path=f'\{data_dir}/\{fn}')
specviz.load_spectrum(f'\{data_dir}/\{fn}', "myfile")

specviz.get_data('myfile').uncertainty # are populated and non-zero

mf = specviz.plugins['Model Fitting']

mf.create_model_component('Linear1D')
mf.create_model_component('Polynomial1D')
model = mf.calculate_fit(add_data=True)

specviz.get_models()['model'].stds # is None

DISCLAIMER: This issue was autocreated by the Jdaviz Issue Creation Bot on behalf of the reporter. If any information is incorrect, please contact Duy Nguyen

pllim commented 1 year ago

specviz.get_models()['model'].stds. -> specviz.get_models()['model'].stds?

kecnry commented 1 year ago

that's just jira auto-formatting being annoying, fixed in the description, thanks