pmelchior / scarlet

hyperspectral galaxy modeling and deblending
MIT License
49 stars 22 forks source link

Init fixes #284

Closed pmelchior closed 2 months ago

pmelchior commented 2 months ago

This PR fixes problems identified in #282 and #283. The main change is that extended source initializations don't run the simple linear solver to get the best spectrum given their own morphology and the observation. Instead, we have been recommending using set_spectrum_to_match, which solves for the best-fit spectrum given all morphologies in the scene. So, it's entirely sufficient, and probably safer in case of close blends, to initialize with the peak pixel.

As for #282, the linear solver now masks redundant components and throws an errors message when the problem occurs, so that the user can e.g. remove that component. This is probably the best we can do without knowing why the problem occurred in the first place.