In [1]:
from benchmarkInstanceCatalogs.InstanceCatalogBenchMarks import QueryBenchMarks

In [2]:
%matplotlib inline
import matplotlib.pyplot as plt

In [3]:
import pandas as pd

In [4]:
from lsst.sims.catalogs.generation.db import CatalogDBObject
import lsst.sims.catUtils.baseCatalogModels as bcm
from lsst.sims.catalogs.measures.instance import InstanceCatalog

galDB = CatalogDBObject.from_objid('galaxyTiled')

# Create a child of the InstanceCatalog Class
class galCopy(InstanceCatalog):
    column_outputs = ['id', 'raJ2000', 'decJ2000', 'redshift']
    override_formats = {'raJ2000': '%8e', 'decJ2000': '%8e'}


/usr/local/manual/anaconda/lib/python2.7/site-packages/sqlalchemy/dialects/mssql/base.py:1294: SAWarning: Did not recognize type 'geography' of column 'geopoint'
  return fn(*arg, **kw)

In [5]:
boundLens = [0.1]
opsimDBHDF ='/Users/rbiswas/data/LSST/OpSimData/storage.h5'

fulldb = QueryBenchMarks.fromOpSimDF(instanceCatChild=galCopy, dbObject=galDB,
                                  opSimHDF=opsimDBHDF, boundLens=boundLens,
                                  numSamps=1, name='testingFullDB')

In [7]:
print fulldb.df


None

In [8]:
fulldb.aggregateResults()


boundLen used 0 0.1

In [10]:
rless24db = QueryBenchMarks.fromOpSimDF(instanceCatChild=galCopy, dbObject=galDB,
                                  opSimHDF=opsimDBHDF, boundLens=boundLens,
                                  numSamps=1, name='testingrless24DB', constraints='r_ab < 24')

In [12]:
rless24db.aggregateResults()


boundLen used 0 0.1

In [9]:
fulldb.df


Out[9]:
boundLen Ra Dec Mjd numObjects deltaT deltaTFull
0 0.1 -170.597132 -1.953156 57210 27010 5.524872 1691.99207

In [13]:
rless24db.df


Out[13]:
boundLen Ra Dec Mjd numObjects deltaT deltaTFull
0 0.1 -150.547735 -12.697604 57210 1632 24.738113 7576.047157

In [ ]: