Skip to content

Commit

Permalink
use random forest qso selection in sv1
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Jun 4, 2019
1 parent 9a9bb58 commit 8dc67a1
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions py/desitarget/mock/mockmaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3132,9 +3132,14 @@ def select_targets(self, targets, truth, targetname='QSO'):
Target selection cuts to apply.
"""
if self.survey == 'sv1':
qso_selection = 'randomforest'
else:
qso_selection = 'colorcuts'

if self.use_simqso:
desi_target, bgs_target, mws_target = cuts.apply_cuts(targets, tcnames=targetname,
qso_selection='colorcuts',
qso_selection=qso_selection,
survey=self.survey)
else:
desi_target, bgs_target, mws_target = cuts.apply_cuts(
Expand Down Expand Up @@ -3457,9 +3462,14 @@ def select_targets(self, targets, truth, targetname='QSO'):
tcnames = 'QSO'
else:
tcnames = targetname

if self.survey == 'sv1':
qso_selection = 'randomforest'
else:
qso_selection = 'colorcuts'

desi_target, bgs_target, mws_target = cuts.apply_cuts(targets, tcnames=tcnames,
qso_selection='colorcuts',
qso_selection=qso_selection,
survey=self.survey)

self.remove_north_south_bits(desi_target, bgs_target, mws_target)
Expand Down Expand Up @@ -4486,10 +4496,15 @@ def select_targets(self, targets, truth, targetname='MWS_MAIN'):
else:
tcnames = targetname

if self.survey == 'sv1':
qso_selection = 'randomforest'
else:
qso_selection = 'colorcuts'

# Note: We pass qso_selection to cuts.apply_cuts because MWS_MAIN
# targets can be used as QSO contaminants.
desi_target, bgs_target, mws_target = cuts.apply_cuts(targets, tcnames=tcnames,
qso_selection='colorcuts',
qso_selection=qso_selection,
survey=self.survey)

# Subtract out the MWS_NEARBY and MWS_WD/STD_WD targeting bits, since
Expand Down Expand Up @@ -5495,9 +5510,13 @@ def select_targets(self, targets, truth, targetname='BGS'):
"""
# There's an inconsistency here if use_simqso=False in the configuration
# file...we should be setting optical=True.

if self.survey == 'sv1':
qso_selection = 'randomforest'
else:
qso_selection = 'colorcuts'

desi_target, bgs_target, mws_target = cuts.apply_cuts(targets, tcnames=targetname,
qso_selection='colorcuts',
qso_selection=qso_selection,
survey=self.survey)

self.remove_north_south_bits(desi_target, bgs_target, mws_target)
Expand Down

0 comments on commit 8dc67a1

Please sign in to comment.