Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0000d66e7c+4a51730b0a,g0485b4d2cb+be65c9c1d7,g0fba68d861+f95c35e0c3,g1ec0fe41b4+3ea9d11450,g1fd858c14a+41d169aaf2,g2440f9efcc+8c5ae1fdc5,g35bb328faa+8c5ae1fdc5,g4d2262a081+30937b6477,g53246c7159+8c5ae1fdc5,g55585698de+c657de43f9,g56a49b3a55+7eddd92ad8,g60b5630c4e+c657de43f9,g67b6fd64d1+97cc007aa2,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g7ac00fbb6c+9304e3655a,g8352419a5c+8c5ae1fdc5,g8852436030+3f3bba821f,g89139ef638+97cc007aa2,g94187f82dc+c657de43f9,g989de1cb63+97cc007aa2,g9d31334357+c657de43f9,g9f33ca652e+06d39d8afb,ga815be3f0b+8e7c4d07ad,gabe3b4be73+8856018cbb,gabf8522325+977d9fabaf,gb1101e3267+12c96a40b1,gb89ab40317+97cc007aa2,gc91f06edcd+2ffb87f22b,gcf25f946ba+3f3bba821f,gd6cbbdb0b4+1cc2750d2e,gde0f65d7ad+bbe98f05bf,ge278dab8ac+6b863515ed,ge410e46f29+97cc007aa2,gf35d7ec915+97dd712d81,gf5e32f922b+8c5ae1fdc5,gf67bdafdda+97cc007aa2,gf6800124b1+bb7d8e732a,w.2025.19
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
lsst.dax.apdb.sql.apdbSql Namespace Reference

Classes

class  ApdbSql
 

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__)
 
 _MON = MonAgent(__name__)
 
 VERSION = VersionTuple(0, 1, 2)
 

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 78 of file apdbSql.py.

78def _coerce_uint64(df: pandas.DataFrame) -> pandas.DataFrame:
79 """Change the type of uint64 columns to int64, and return copy of data
80 frame.
81 """
82 names = [c[0] for c in df.dtypes.items() if c[1] == np.uint64]
83 return df.astype({name: np.int64 for name in names})
84
85

◆ _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 86 of file apdbSql.py.

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

◆ _onSqlite3Connect()

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

Definition at line 106 of file apdbSql.py.

108) -> None:
109 # Enable foreign keys
110 with closing(dbapiConnection.cursor()) as cursor:
111 cursor.execute("PRAGMA foreign_keys=ON;")
112
113

Variable Documentation

◆ _LOG

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

Definition at line 67 of file apdbSql.py.

◆ _MON

lsst.dax.apdb.sql.apdbSql._MON = MonAgent(__name__)
protected

Definition at line 69 of file apdbSql.py.

◆ VERSION

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

Definition at line 71 of file apdbSql.py.