SpatialBounds

class rubin_sim.utils.SpatialBounds(*args)

Bases: object

Classes inheriting from this class define spatial bounds on the objects contained within a catalog. They also translate those bounds into constraints on SQL queries made by the query_columns method in CatalogDBobject (see dbConnnection.py)

Daughter classes of this class need the following:

self.bound_type = a string by which the class is identified in the registry of FieldOfView classes

__init__() that accepts (in this order) RA, Dec, and characteristic length. Init should then construct the parameters defining the bound however is appropriate (e.g. setting self.RAmax and self.RAmin for a box)

to_sql() = a method that accepts RAcolname and DECcolname (strings denoting the names of the database columns containing RA and DEc) and which returns a string that characterizes the bound as an SQL ‘WHERE’ statement.

Attributes Summary

sb_registry

Methods Summary

get_spatial_bounds(name, *args, **kwargs)

to_sql(*args)

Accepts the names of the columns referring to RA and Dec in the database.

Attributes Documentation

sb_registry = {'box': <class 'rubin_sim.utils.spatial_bounds.BoxBounds'>, 'circle': <class 'rubin_sim.utils.spatial_bounds.CircleBounds'>}

Methods Documentation

classmethod get_spatial_bounds(name, *args, **kwargs)
to_sql(*args)

Accepts the names of the columns referring to RA and Dec in the database. Uses the stored RA, Dec, and length for this object to return an SQL query that only selects the region of RA and Dec desired

@param[in] RAname a string; the name of the RA column in the database

@param[in] DECname a string; the name of the Dec column in the database

@returns a string; an SQL query that only selects the desired region in RA, Dec