Coverage for python/lsst/sims/alertsim/catsim_utils.py : 12%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Query catsim """
""" Pass arguments to a function which handles specifics of the stack version """
if stack_version < 10: return catsim_query_stack8(**kwargs) else: return catsim_query_stack10(**kwargs)
""" Query catsim and make a catalog for stack 8
@param [in] objid of the catsim table
@param [in] constraint is sql constraint for the catsim table
@param [in] obs_metadata is the metadata for the visit
@param [in] dia is boolean which determines the catalog class i.e if full diasource will be emitted """
from lsst.sims.catalogs.generation.db import DBObject
dbobj = DBObject.from_objid(objid)
if dia: catalog = 'variable_stars_dia' else: catalog = 'variable_stars'
obs_data = dbobj.getCatalog(catalog, obs_metadata=obs_metadata, constraint=constraint)
# filename = 'test_reference.dat' # t.write_catalog(filename, chunk_size=10) return obs_data
""" Query catsim and make a catalog for stack 10+
@param [in] objid of the catsim table
@param [in] constraint is sql constraint for the catsim table
@param [in] obs_metadata is the metadata for the visit
@param [in] dia is boolean which determines the catalog class i.e if full diasource will be emitted
"""
from lsst.sims.catalogs.db import CatalogDBObject
dbobj = CatalogDBObject.from_objid(objid)
if dia: catalog = 'variable_stars_dia' else: catalog = 'variable_stars'
obs_data = dbobj.getCatalog(catalog, obs_metadata=obs_metadata, constraint=constraint) #column_outputs=VariableStars.get_column_outputs(obs_metadata.bandpass))
# dbobj.show_db_columns() # dbobj.show_mapped_columns() # filename = 'test_reference.dat' # t.write_catalog(filename, chunk_size=10) return obs_data |