rubin_sim.maf.utils.get_sim_data(db_con, sqlconstraint, dbcols, stackers=None, table_name=None, full_sql_query=None)

Query an opsim database for the needed data columns and run any required stackers.

db_constr or SQLAlchemy connectable, or sqlite3 connection

Filename to a sqlite3 file, or a connection object that can be used by pandas.read_sql

sqlconstraintstr or None

SQL constraint to apply to query for observations. Ignored if full_sql_query is set.

dbcolslist [str]

Columns required from the database. Ignored if full_sql_query is set.

stackerslist [rubin_sim.maf.stackers], optional

Stackers to be used to generate additional columns. Default None.

table_namestr (None)

Name of the table to query. Default None will try “observations” and “SummaryAllProps”. Ignored if full_sql_query is set.


The full SQL query to use. Overrides sqlconstraint, dbcols, tablename.

sim_data: np.ndarray

A numpy structured array with columns resulting from dbcols + stackers, for observations matching the SQLconstraint.