In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
from desitarget import io, targetmask
from desitarget.cuts import C, LRG


/home/yfeng1/.local/lib/python2.7/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated. You should import from ipykernel or jupyter_client instead.
  "You should import from ipykernel or jupyter_client instead.", ShimWarning)

In [3]:
numpy.seterr(all='ignore')


Out[3]:
{'divide': 'warn', 'invalid': 'warn', 'over': 'warn', 'under': 'ignore'}

In [4]:
print targetmask


targetmask:
    - [LRG,              0, "LRG"]
    - [ELG,              1, "ELG"]
    - [BGS,              2, "BGS"]
    - [QSO,              3, "QSO"]

In [5]:
data = io.read_tractor('../tractor-2437p082.fits')

In [6]:
NOBS  = (C('DECAM_NOBS').T[1] > 0)
NOBS &= (C('DECAM_NOBS').T[2] > 0)
NOBS &= (C('DECAM_NOBS').T[4] > 0)

In [7]:
LRG_NOBS = LRG & NOBS

In [8]:
print LRG.apply(data).sum()


27

In [9]:
print NOBS.apply(data).sum()


6001

In [10]:
print LRG_NOBS.apply(data).sum()


27

In [ ]: