AssociationDBSqliteTask

class lsst.ap.association.AssociationDBSqliteTask(**kwargs)

Bases: lsst.pipe.base.Task

Enable storage of and reading of DIAObjects and DIASources from a sqlite database.

Create a simple sqlite database and implement wrappers to store and retrieve DIAObjects and DIASources from within that database. This task functions as a testing ground for the L1 database and should mimic this database’s eventual functionality. This specific database implementation is useful for the verification packages which may not be run with access to L1 database.

Attributes Summary

dia_object_afw_schema Retrieve the Schema of the DIAObjects in this database.
dia_source_afw_schema Retrieve the Schema of the DIASources in this database.

Methods Summary

close() Close the connection to the sqlite database.
compute_indexer_id(sphere_point) Compute the pixel index of the given point.
create_tables() If no sqlite database with the correct tables exists we can create one using this method.
load_dia_objects(exposure) Load all DIAObjects within the exposure.
load_dia_sources(dia_obj_ids) Retrieve all DIASources associated with this collection of DIAObject ids.
store_ccd_visit_info(exposure) Store information describing the exposure for this ccd, visit.
store_dia_objects(dia_objects[, …]) Store all DIAObjects in this SourceCatalog.
store_dia_sources(dia_sources[, …]) Store all DIASources in this SourceCatalog.

Attributes Documentation

dia_object_afw_schema

Retrieve the Schema of the DIAObjects in this database.

Returns:
schema : lsst.afw.table.Schema

Schema of the DIAObjects in this database.

dia_source_afw_schema

Retrieve the Schema of the DIASources in this database.

Returns:
schema : lsst.afw.table.Schema

Schema of the DIASources in this database.

Methods Documentation

close()

Close the connection to the sqlite database.

compute_indexer_id(sphere_point)

Compute the pixel index of the given point.

Parameters:
sphere_point : lsst.afw.geom.SpherePoint

Point to compute pixel index for.

Returns:
index : int

Index of the pixel the point is contained in.

create_tables()

If no sqlite database with the correct tables exists we can create one using this method.

Returns:
succeeded : bool

Successfully created a new database with specified tables.

load_dia_objects(exposure)

Load all DIAObjects within the exposure.

Parameters:
exposure : lsst.afw.image.Exposure

An exposure with a solved WCS representing the area on the sky to load DIAObjects.

Returns:
dia_objects : lsst.afw.table.SourceCatalog

Catalog of DIAObjects that are contained with the the bounding box defined by expMd.

load_dia_sources(dia_obj_ids)

Retrieve all DIASources associated with this collection of DIAObject ids.

Parameters:
dia_obj_ids : array-like of int

Id of the DIAObject that is associated with the DIASources of interest.

Returns:
dia_sources : lsst.afw.table.SourceCatalog

SourceCatalog of DIASources

store_ccd_visit_info(exposure)

Store information describing the exposure for this ccd, visit.

Parameters:
exposure : lsst.afw.image.Exposure

Exposure to store information from.

store_dia_objects(dia_objects, compute_spatial_index=False, exposure=None)

Store all DIAObjects in this SourceCatalog.

Parameters:
dia_objects : lsst.afw.table.SourceCatalog

Catalog of DIAObjects to store.

compute_spatial_index : bool

If True, compute the spatial search indices using the indexer specified at class instantiation.

exposure: `lsst.afw.image.Exposure` (optional)

CcdExposure associated with these DIAObjects being inserted. Inserts the CcdVisitInfo for this exposure in the CcdVisitTable.

store_dia_sources(dia_sources, associated_ids=None, exposure=None)

Store all DIASources in this SourceCatalog.

Parameters:
dia_sources : lsst.afw.table.SourceCatalog

Catalog of DIASources to store.

associated_ids : array-like of int (optional)

DIAObject ids that have been associated with these DIASources

exposure : lsst.afw.image.Exposure

Exposure object the DIASources were detected in.