From aa1bd90cfa941b5cae73e241835b71abf4c8fada Mon Sep 17 00:00:00 2001 From: Stephen Bailey Date: Sun, 14 Feb 2016 14:30:43 -0800 Subject: [PATCH] rename isFSTD -> isFSTD_colors --- py/desitarget/cuts.py | 11 +++++++---- py/desitarget/test/test_cuts.py | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/py/desitarget/cuts.py b/py/desitarget/cuts.py index ca53eefce..60128f764 100644 --- a/py/desitarget/cuts.py +++ b/py/desitarget/cuts.py @@ -75,7 +75,7 @@ def isELG(gflux, rflux, zflux, primary=None): return elg -def isFSTD(gflux, rflux, zflux, primary=None): +def isFSTD_colors(gflux, rflux, zflux, primary=None): """Select FSTD targets just based on color cuts. Returns a boolean array. Args: @@ -85,8 +85,11 @@ def isFSTD(gflux, rflux, zflux, primary=None): If given, the BRICK_PRIMARY column of the catalogue. Returns: - mask : array_like. True if and only the object is an FSTD - target. + mask : boolean array, True if the object has colors like an FSTD + + Notes: + The full FSTD target selection also includes PSF-like and fracflux + cuts; this function is only cuts on the colors. """ #----- F-type standard stars @@ -287,7 +290,7 @@ def apply_cuts(objects): wflux=wflux) #----- Standard stars - fstd = isFSTD(primary=primary, zflux=zflux, rflux=rflux, gflux=gflux) + fstd = isFSTD_colors(primary=primary, zflux=zflux, rflux=rflux, gflux=gflux) fstd &= psflike(objects['TYPE']) fracflux = objects['DECAM_FRACFLUX'].T diff --git a/py/desitarget/test/test_cuts.py b/py/desitarget/test/test_cuts.py index d59ae4b3e..0d13310b8 100644 --- a/py/desitarget/test/test_cuts.py +++ b/py/desitarget/test/test_cuts.py @@ -81,6 +81,10 @@ def test_single_cuts(self): qso2 = cuts.isQSO(gflux, rflux, zflux, wflux, type=None, primary=None) self.assertTrue(np.all(qso1==qso2)) + fstd1 = cuts.isFSTD_colors(gflux, rflux, zflux, primary=None) + fstd2 = cuts.isFSTD_colors(gflux, rflux, zflux, primary=primary) + self.assertTrue(np.all(fstd1==fstd2)) + #- cuts should work with tables from several I/O libraries def _test_table_row(self, targets): self.assertFalse(cuts._is_row(targets))