LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions | Variables
lsst.dax.apdb.sql.apdbSql Namespace Reference

Classes

class  ApdbSql
 
class  ApdbSqlConfig
 

Functions

pandas.DataFrame _coerce_uint64 (pandas.DataFrame df)
 
float _make_midpointMjdTai_start (astropy.time.Time visit_time, int months)
 
None _onSqlite3Connect (sqlite3.Connection dbapiConnection, sqlalchemy.pool._ConnectionRecord connectionRecord)
 

Variables

 _LOG = logging.getLogger(__name__)
 
 VERSION = VersionTuple(0, 1, 0)
 

Detailed Description

Module defining Apdb class and related methods.

Function Documentation

◆ _coerce_uint64()

pandas.DataFrame lsst.dax.apdb.sql.apdbSql._coerce_uint64 ( pandas.DataFrame df)
protected
Change the type of uint64 columns to int64, and return copy of data
frame.

Definition at line 71 of file apdbSql.py.

71def _coerce_uint64(df: pandas.DataFrame) -> pandas.DataFrame:
72 """Change the type of uint64 columns to int64, and return copy of data
73 frame.
74 """
75 names = [c[0] for c in df.dtypes.items() if c[1] == np.uint64]
76 return df.astype({name: np.int64 for name in names})
77
78

◆ _make_midpointMjdTai_start()

float lsst.dax.apdb.sql.apdbSql._make_midpointMjdTai_start ( astropy.time.Time visit_time,
int months )
protected
Calculate starting point for time-based source search.

Parameters
----------
visit_time : `astropy.time.Time`
    Time of current visit.
months : `int`
    Number of months in the sources history.

Returns
-------
time : `float`
    A ``midpointMjdTai`` starting point, MJD time.

Definition at line 79 of file apdbSql.py.

79def _make_midpointMjdTai_start(visit_time: astropy.time.Time, months: int) -> float:
80 """Calculate starting point for time-based source search.
81
82 Parameters
83 ----------
84 visit_time : `astropy.time.Time`
85 Time of current visit.
86 months : `int`
87 Number of months in the sources history.
88
89 Returns
90 -------
91 time : `float`
92 A ``midpointMjdTai`` starting point, MJD time.
93 """
94 # TODO: Use of MJD must be consistent with the code in ap_association
95 # (see DM-31996)
96 return visit_time.mjd - months * 30
97
98

◆ _onSqlite3Connect()

None lsst.dax.apdb.sql.apdbSql._onSqlite3Connect ( sqlite3.Connection dbapiConnection,
sqlalchemy.pool._ConnectionRecord connectionRecord )
protected

Definition at line 99 of file apdbSql.py.

101) -> None:
102 # Enable foreign keys
103 with closing(dbapiConnection.cursor()) as cursor:
104 cursor.execute("PRAGMA foreign_keys=ON;")
105
106

Variable Documentation

◆ _LOG

lsst.dax.apdb.sql.apdbSql._LOG = logging.getLogger(__name__)
protected

Definition at line 62 of file apdbSql.py.

◆ VERSION

lsst.dax.apdb.sql.apdbSql.VERSION = VersionTuple(0, 1, 0)

Definition at line 64 of file apdbSql.py.