desihub / redrock

Redshift fitting for spectroperfectionism
BSD 3-Clause "New" or "Revised" License
21 stars 13 forks source link

Add support for NMF templates #268

Closed sbailey closed 5 months ago

sbailey commented 6 months ago

Add support for Non-negative Matrix Factorization (NMF) templates, whose coefficients should be solved with scipy.optimize.nnls (non-negative least squares) rather than numpy/cupy.linalg.solve.

Proposal: add new header keyword RRMETHOD which could be "PCA" or "NMF", and propagate that through Template.solve_matrices_algorithm to know which algorithm to use. Include legacy support for existing templates to default to "PCA" if the header keyword is missing. Perhaps only do that for specific versions, while requiring this keyword for all future templates.

I'm working on this, but am adding this as a ticket for tracking.

sbailey commented 5 months ago

Added in PR #271. Closing.