DbQuery¶
- class lsst.analysis.ap.DbQuery¶
Bases:
ABC
Abstract interface for APDB queries.
Notes
APDB interface used by AP pipeline is defined by
lsst.dax.apdb.Apdb
class. Methods in this class are for non-pipeline tools that can analyse data produced by pipeline. APDB schema is not designed for analysis queries and performance of these methods can be non-optimal, especially for Cassandra backend. It is expected that these analysis queries should not be executed on production Cassandra service.Methods Summary
Load one diaForcedSource.
load_forced_sources
([limit])Load all diaForcedSources.
load_forced_sources_for_object
(dia_object_id)Load diaForcedSources for a single diaObject.
load_object
(id)Load the most-recently updated version of one diaObject.
load_objects
([limit, latest])Load all diaObjects.
load_source
(id)Load one diaSource.
load_sources
([exclude_flagged, limit])Load diaSources.
load_sources_for_object
(dia_object_id[, ...])Load diaSources for a single diaObject.
set_excluded_diaSource_flags
(flag_list)Set flags of diaSources to exclude when loading diaSources.
Methods Documentation
- load_forced_source(id: int) Series ¶
Load one diaForcedSource.
- Parameters:
- id
int
The diaForcedSourceId to load data for.
- id
- Returns:
- data
pandas.Series
The requested forced source.
- data
- load_forced_sources(limit: int = 100000) DataFrame ¶
Load all diaForcedSources.
- Parameters:
- limit
int
Maximum number of rows to return.
- limit
- Returns:
- data
pandas.DataFrame
All available diaForcedSources.
- data
- load_forced_sources_for_object(dia_object_id: int, exclude_flagged: bool = False, limit: int = 100000) DataFrame ¶
Load diaForcedSources for a single diaObject.
- Parameters:
- dia_object_id
int
Id of object to load sources for.
- exclude_flagged
bool
, optional Exclude sources that have selected flags set. Use
set_excluded_diaSource_flags
to configure which flags are excluded.- limit
int
Maximum number of rows to return.
- dia_object_id
- Returns:
- data
pandas.DataFrame
A data frame of diaSources for the specified diaObject.
- data
- load_object(id: int) Series ¶
Load the most-recently updated version of one diaObject.
- Parameters:
- id
int
The diaObjectId to load data for.
- id
- Returns:
- data
pandas.Series
The requested object.
- data
- load_objects(limit: int = 100000, latest: bool = True) DataFrame ¶
Load all diaObjects.
- Parameters:
- Returns:
- data
pandas.DataFrame
All available diaObjects.
- data
- load_source(id: int) Series ¶
Load one diaSource.
- Parameters:
- id
int
The diaSourceId to load data for.
- id
- Returns:
- data
pandas.Series
The requested diaSource.
- data
- load_sources(exclude_flagged: bool = False, limit: int = 100000) DataFrame ¶
Load diaSources.
- Parameters:
- exclude_flagged
bool
, optional Exclude sources that have selected flags set. Use
set_excluded_diaSource_flags
to configure which flags are excluded.- limit
int
Maximum number of rows to return.
- exclude_flagged
- Returns:
- data
pandas.DataFrame
All available diaSources.
- data
- load_sources_for_object(dia_object_id: int, exclude_flagged: bool = False, limit: int = 100000) DataFrame ¶
Load diaSources for a single diaObject.
- Parameters:
- dia_object_id
int
Id of object to load sources for.
- exclude_flagged
bool
, optional Exclude sources that have selected flags set. Use
set_excluded_diaSource_flags
to configure which flags are excluded.- limit
int
Maximum number of rows to return.
- dia_object_id
- Returns:
- data
pandas.DataFrame
A data frame of diaSources for the specified diaObject.
- data
- set_excluded_diaSource_flags(flag_list: list[str]) None ¶
Set flags of diaSources to exclude when loading diaSources.
Any diaSources with configured flags are not returned when calling
load_sources_for_object
orload_sources
withexclude_flagged = True
.