Autostronomy / AstroPhot

A fast, flexible, automated, and differentiable astronomical image 2D forward modelling tool for precise parallel multi-wavelength photometry
https://astrophot.readthedocs.io
GNU General Public License v3.0
79 stars 9 forks source link

Uncertainties don't get updated by ap.lm.fit.update_uncertainty #130

Closed wmwv closed 8 months ago

wmwv commented 8 months ago

Describe the bug result.update_uncertainty() doesn't actually update the uncertainties for two reasons:

  1. There's an error in the code itself in ap.lm.fit.update_uncertainty where vector_set_uncertainty is set to the value rather than being called.
  2. vector_set_uncertainty doesn't clearly work at processing uncertainties that can be scalars or vectors. center being the relevant quantity here.

I've started a branch that adds a test that compares the uncertainties from the sersic galaxy fit test and making sure the fit model gets updated with them.

To Reproduce

git checkout u/wmwv/test-parameter-uncertainty-set cd astrophot pytest tests/test_fit.py -k test_sersic_fit_lm