Skip to content

Commit

Permalink
only penalize negative [OII] when fitting with GALAXY+PCA
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Apr 25, 2024
1 parent 708c6ef commit c0971b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions py/redrock/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def __init__(self, filename=None, spectype=None, redshifts=None,
raise ValueError(f'Template method {self._method} unrecognized; '
f'should be one of {valid_template_methods}')

#- Special case for GALAXY templates: cache subset of template that
#- covers [OII] but only for GALAXY templates and fitting methods which
#- can include negative templates or coefficients.
if self._rrtype == 'GALAXY' and not self._method in ("NMF", "NNLS"):
# Special case for GALAXY templates and PCA fitting, which can include
# negative templates or coefficients: Cache a template that covers just
# [OII].
if self._rrtype == 'GALAXY' and self._method == "PCA":
isOII = (3724 <= self.wave) & (self.wave <= 3733)
self.OIItemplate = self.flux[:,isOII]

Expand Down

0 comments on commit c0971b9

Please sign in to comment.