SqliteDBConverter¶
-
class
lsst.ap.association.
SqliteDBConverter
(schema, table_name)¶ Bases:
object
Class for defining conversions to and from an sqlite database and afw SourceRecord objects.
Parameters: - schema :
lsst.afw.table.Schema
Schema defining the SourceRecord objects to be converted.
- table_name :
str
Name of the sqlite table this converter is to be used for.
Attributes Summary
schema
Return the internal catalog schema. table_name
Return name of the sqlite table this catalog is for Methods Summary
make_table_from_afw_schema
(table_name)Convert the schema into a sqlite CREATE TABLE command. source_record_from_db_row
(db_row)Create a source record from the values stored in a database row. source_record_to_value_list
(source_record[, …])Convert a source record object into a list of its internal values. Attributes Documentation
-
schema
¶ Return the internal catalog schema.
-
table_name
¶ Return name of the sqlite table this catalog is for
Methods Documentation
-
make_table_from_afw_schema
(table_name)¶ Convert the schema into a sqlite CREATE TABLE command.
Parameters: - table_name :
str
Name of the new table to create
Returns: - sql_query :
str
A string of the query command to create the new table in sqlite.
- table_name :
-
source_record_from_db_row
(db_row)¶ Create a source record from the values stored in a database row.
Parameters: - db_row :
list
ofvalues
Retrieved values from the database to convert into a SourceRecord.
Returns: - record :
lsst.afw.table.SourceRecord
Converted source record.
- db_row :
-
source_record_to_value_list
(source_record, overwrite_dict={})¶ Convert a source record object into a list of its internal values.
Parameters: - source_record :
lsst.afw.table.SourceRecord
SourceRecord to convert.
- overwrite_dict :
dict
(optional) Mapping specifying the names of columns to overwrite with specified values.
Returns: - source_record :
- schema :