Welcome to hscquery’s documentation!¶
hscquery is a Python 2/3 module for querying the
Hyper Suprime-Cam Subaru Strategic Program database. HSC-SSP
Based on the python script developed by michitaro, NAOJ / HSC Collaboration. Source
hscquery depends on
hscquery can be easily installed using
pip install hscquery
A simple example of using
from hscquery import HSC from astropy import units as u from astropy.coordinates import SkyCoord coords = SkyCoord(34.0, -5.0, unit='deg') radius = 5.0 * u.arcsec h = HSC(survey='wide') data = h.query_region(coords, radius) print data
Module for accessing the Hyper Suprime-Cam Subaru Strategic Program database.
A valid account for the HSC Archive is needed to use this module. See HSC Online Registration.
Based on the python script developed by michitaro, NAOJ / HSC Collaboration. [Source]
HSC(survey='wide', release_version='pdr1', columns='object_id, ra, dec', user=None, password_env='HSCPASSW')¶
Main class for accessing the HSC-SSP database.
- survey (str, optional) – Available surveys: ‘wide’, ‘deep’, ‘udeep’. By default is ‘wide’.
- release_version (str, optional) – For the moment, only ‘pdr1’ is available (Public Data Release 1)
- columns (str, optional) – List of selected columns for query results. See the HSP-SSP schema for details. By default is ‘object_id, ra, dec’.
- user (str or None, optional) – Account name in the HSC-SSP database. If None, when an
HSCobject is initiated, the user can introduced the account name.
- password_env (str, optional) – The account’s password can be stored in a system enviroment variable.
By default the password is searched at
HSCPASSW. If this environment variable doesn’t exist, the user is asked to introduce his password. Use the password_env option with caution, since your password can be easily exposed!
query_region(coords, radius, catalog='forced')¶
Returns an astropy
Tableobject with all sources from catalog catalog within radius radius around sky position coords.
- coords (
SkyCoord) – Search around this position.
- radius (
Quantity) – Search radius (angular units)
- catalog (str, optional) –
Available options: ‘forced’, ‘meas’, ‘specz’, or ‘random’. See the HSP-SSP schema for details. By default is ‘forced’.
- coords (
send_query(sql, output_format='csv', output_file=None, delete_job=True)¶
Send an SQL query sql.
If output_file is
None, a preview of the results is shown. Otherwise, results are saved in a file with name output_file and in the format defined by output_format.
- sql (str) – SQL query.
- output_format (str, optional) – Available formats: ‘csv’, ‘csv.gz’, ‘sqlite3’, or ‘fits’.
- output_file (str or
None) – Name of the file for storing the query results. If
None, a preview of the results is shown.
- delete_job (bool) – Delete job and results from the user space. By default is
Query error class.