|
LSST Applications g00274db5b6+edbf708997,g00d0e8bbd7+edbf708997,g199a45376c+5137f08352,g1fd858c14a+1d4b6db739,g262e1987ae+f4d9505c4f,g29ae962dfc+7156fb1a53,g2cef7863aa+73c82f25e4,g35bb328faa+edbf708997,g3e17d7035e+5b3adc59f5,g3fd5ace14f+852fa6fbcb,g47891489e3+6dc8069a4c,g53246c7159+edbf708997,g64539dfbff+9f17e571f4,g67b6fd64d1+6dc8069a4c,g74acd417e5+ae494d68d9,g786e29fd12+af89c03590,g7ae74a0b1c+a25e60b391,g7aefaa3e3d+536efcc10a,g7cc15d900a+d121454f8d,g87389fa792+a4172ec7da,g89139ef638+6dc8069a4c,g8d7436a09f+28c28d8d6d,g8ea07a8fe4+db21c37724,g92c671f44c+9f17e571f4,g98df359435+b2e6376b13,g99af87f6a8+b0f4ad7b8d,gac66b60396+966efe6077,gb88ae4c679+7dec8f19df,gbaa8f7a6c5+38b34f4976,gbf99507273+edbf708997,gc24b5d6ed1+9f17e571f4,gca7fc764a6+6dc8069a4c,gcc769fe2a4+97d0256649,gd7ef33dd92+6dc8069a4c,gdab6d2f7ff+ae494d68d9,gdbb4c4dda9+9f17e571f4,ge410e46f29+6dc8069a4c,geaed405ab2+e194be0d2b,w.2025.47
LSST Data Management Base Package
|
Public Member Functions | |
| __init__ (self, ApdbCassandraConfig config) | |
| int | pixel (self, sphgeom.UnitVector3d direction) |
| int | time_partition (self, float|astropy.time.Time time) |
| tuple[astropy.time.Time, astropy.time.Time] | partition_period (self, int time_partition) |
| tuple[list[tuple[str, tuple]], int] | spatial_where (self, sphgeom.Region|None region, *, bool use_ranges=False, bool for_prepare=False) |
| tuple[list[str], list[tuple[str, tuple]]] | temporal_where (self, ApdbTables table, float|astropy.time.Time start_time, float|astropy.time.Time end_time, *, bool|None query_per_time_part=None, bool for_prepare=False, ApdbCassandraTimePartitionRange|None partitons_range=None) |
Public Attributes | |
| pixelization | |
Static Public Attributes | |
| partition_zero_epoch = astropy.time.Time(0, format="unix_tai") | |
Protected Attributes | |
| _config = config | |
| _epoch = float(self.partition_zero_epoch.mjd) | |
Logic for temporal and spacial partitiong of APDB tables.
Parameters
----------
config : `ApdbCassandraConfig`
Configuration object.
Definition at line 36 of file partitioner.py.
| lsst.dax.apdb.cassandra.partitioner.Partitioner.__init__ | ( | self, | |
| ApdbCassandraConfig | config ) |
Definition at line 48 of file partitioner.py.
| tuple[astropy.time.Time, astropy.time.Time] lsst.dax.apdb.cassandra.partitioner.Partitioner.partition_period | ( | self, | |
| int | time_partition ) |
Return time period for specified taime partition.
Parameters
----------
time_partition : `int`
Time partition.
Returns
-------
start : `astropy.time.Time`
Start of the period, inclusive boundary.
end : `astropy.time.Time`
Start of the period, exclusive boundary.
Definition at line 94 of file partitioner.py.
| int lsst.dax.apdb.cassandra.partitioner.Partitioner.pixel | ( | self, | |
| sphgeom.UnitVector3d | direction ) |
Compute the index of the pixel for given direction.
Parameters
----------
direction : `lsst.sphgeom.UnitVector3d`
Spatial position.
Returns
-------
pixel : `int`
Pixel index.
Definition at line 57 of file partitioner.py.
| tuple[list[tuple[str, tuple]], int] lsst.dax.apdb.cassandra.partitioner.Partitioner.spatial_where | ( | self, | |
| sphgeom.Region | None | region, | ||
| * | , | ||
| bool | use_ranges = False, | ||
| bool | for_prepare = False ) |
Generate expressions for spatial part of WHERE clause.
Parameters
----------
region : `sphgeom.Region`
Spatial region for query results.
use_ranges : `bool`, optional
If True then use pixel ranges ("apdb_part >= p1 AND apdb_part <=
p2") instead of exact list of pixels. Should be set to True for
large regions covering very many pixels.
for_prepare : `bool`, optional
If True then use placeholders for prepared statement (?), otherwise
produce regulr statement placeholders (%s).
Returns
-------
expressions : `list` [ `tuple` ]
Empty list is returned if ``region`` is `None`, otherwise a list
of one or more ``(expression: str, parameters: tuple)`` tuples.
partition_count : `int`
Number of spatial partitions in the result.
Definition at line 116 of file partitioner.py.
| tuple[list[str], list[tuple[str, tuple]]] lsst.dax.apdb.cassandra.partitioner.Partitioner.temporal_where | ( | self, | |
| ApdbTables | table, | ||
| float | astropy.time.Time | start_time, | ||
| float | astropy.time.Time | end_time, | ||
| * | , | ||
| bool | None | query_per_time_part = None, | ||
| bool | for_prepare = False, | ||
| ApdbCassandraTimePartitionRange | None | partitons_range = None ) |
Generate table names and expressions for temporal part of WHERE
clauses.
Parameters
----------
table : `ApdbTables`
Table to select from.
start_time : `astropy.time.Time` or `float`
Starting Datetime of MJD value of the time range.
end_time : `astropy.time.Time` or `float`
Starting Datetime of MJD value of the time range.
query_per_time_part : `bool`, optional
If None then use ``query_per_time_part`` from configuration.
for_prepare : `bool`, optional
If True then use placeholders for prepared statement (?), otherwise
produce regulr statement placeholders (%s).
partitons_range : `ApdbCassandraTimePartitionRange` or `None`
Partitions range to further restrict time range.
Returns
-------
tables : `list` [ `str` ]
List of the table names to query. Empty list is returned when time
range does not overlap ``partitons_range``.
expressions : `list` [ `tuple` ]
A list of zero or more ``(expression: str, parameters: tuple)``
tuples.
Definition at line 173 of file partitioner.py.
| int lsst.dax.apdb.cassandra.partitioner.Partitioner.time_partition | ( | self, | |
| float | astropy.time.Time | time ) |
Calculate time partition number for a given time.
Parameters
----------
time : `float` or `astropy.time.Time`
Time for which to calculate partition number. Can be float to mean
MJD or `astropy.time.Time`
Returns
-------
partition : `int`
Partition number for a given time.
Definition at line 72 of file partitioner.py.
|
protected |
Definition at line 49 of file partitioner.py.
|
protected |
Definition at line 55 of file partitioner.py.
|
static |
Definition at line 45 of file partitioner.py.
| lsst.dax.apdb.cassandra.partitioner.Partitioner.pixelization |
Definition at line 50 of file partitioner.py.