correctly select both "bright" and "faint" BGS templates by default #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug identified by @akremin. Previously this snippet of code would fail to return any templates fainter than
r=19.5
:because the
BGS().colorcuts_function
was being set to justdesitarget.cuts.isBGS_bright
, which applies the magnitude cutr<19.5
(note no equals sign).In this PR I allow the option of the
colorcuts_function
attribute to be a tuple and the code checks whether any (using logical or) of the "color cuts" are satisfied. In the case of BGS these cuts are just magnitude cuts:r<19.5
for the bright sample and19.5<=r<20
for the faint sample.This bug does not affect the 2% sprint simulations because there the target selection cuts were applied outside of
desisim.templates
, but this is affecting @akremin's BGS-only bright-time simulations since the magnitude priors are being passed directly todesisim.templates
viadesisim.obs.new_exposure
.