obiwan.db_tools

Query our PostgreSQL Databases at NERSC

Classes

PsqlWorker() Connects to and queries psql db

Functions

all_psqlcols_for_ids(ids[, …]) Returns all db columns in the db having the ids provided
getSrcsInBrick(brickname, objtype[, …]) Returns tuple: fits table, seed
class obiwan.db_tools.PsqlWorker[source]

Connects to and queries psql db

obiwan.db_tools.all_psqlcols_for_ids(ids, db_randoms_table='obiwan_elg_ra175', try_with_join=False)[source]

Returns all db columns in the db having the ids provided

Parameters:
  • ids – list or array, ids generally come from obiwan ‘simcat*.fits’ table, for example
  • db_table – table name in psql db ‘desi’ hosted at ‘scidb2.nersc.gov’
  • try_with_join – to use equivalent sql select that uses join
obiwan.db_tools.getSrcsInBrick(brickname, objtype, db_table='obiwan_elg', skipped_ids=None)[source]

Returns tuple: fits table, seed

Parameters:skipped_ids – array or list of strings of ids if not None, the db ids