NOIRLabClass#
- class astroquery.noirlab.NOIRLabClass[source]#
Bases:
BaseQuerySearch functionality for the NSF NOIRLab Astro Data Archive.
Attributes Summary
Return version of REST API used by this module.
Methods Summary
get_file(fileid)Simply fetch a file by MD5 ID.
get_token(email, password[, cache])Get an access token to use with proprietary data.
list_fields(*[, aux, instrument, proctype, ...])List the available fields for searches using
query_metadata().query_metadata([qspec, sort, limit, hdu, cache])Query the archive database for details on available files.
query_region(coordinate, *[, radius, hdu, ...])Query for NOIRLab observations by region of the sky.
sia_url([hdu])Return the URL for SIA queries.
Attributes Documentation
- NAT_URL = 'https://astroarchive.noirlab.edu'#
- TIMEOUT = 30#
- api_version#
Return version of REST API used by this module.
If the REST API changes such that the major version increases, a new version of this module will likely need to be used.
Methods Documentation
- list_fields(*, aux=False, instrument=None, proctype=None, hdu=False, categorical=False, cache=True)[source]#
List the available fields for searches using
query_metadata().The default is to return core fields for file-based queries.
- Parameters:
- aux
bool, optional If
True, return aux fields.instrumentandproctypemust also be specified.- instrument
str, optional The specific instrument, e.g. ‘90prime’ or ‘decam’.
- proctype
str, optional A description of the type of image, e.g. ‘raw’ or ‘instcal’.
- hdu
bool, optional If
Truereturn the fields for HDU-based queries.- categorical
bool, optional If
Truereturn the categorical fields and their allowed values.- cache
bool, optional If
Truecache the result locally.
- aux
- Returns:
- Raises:
- ValueError
If
aux=Trueandinstrumentorproctypeare not specified.
Notes
Core fields are faster to search than Aux fields.
The available fields depend on whether a File or a HDU query is requested.
Categorical fields can only take on one of a set of values.
- query_metadata(qspec=None, sort=None, limit=1000, hdu=False, cache=True)[source]#
Query the archive database for details on available files.
qspecshould minimally contain a list of output columns and a list of search parameters, which could be empty. For example:qspec = {"outfields": ["md5sum", ], "search": []}
There are more details in the NOIRLab overview document.
- Parameters:
- qspec
dict, optional The query that will be passed to the API.
- sort
str, optional Sort the results on one of the columns in
qspec.- limit
int, optional The number of results to return, default 1000.
- hdu
bool, optional If
Truereturn the URL for HDU-based queries.- cache
bool, optional If
Truecache the result locally.
- qspec
- Returns:
TableA Table containing the results.
- query_region(coordinate, *, radius=0.1, hdu=False, cache=True, async_=False)[source]#
Query for NOIRLab observations by region of the sky.
Given a sky coordinate and radius, returns a
Tableof NOIRLab observations.- Parameters:
- coordinate
strorcoordinatesobject The target region which to search. It may be specified as a string or as the appropriate
coordinatesobject.- radius
floatorstrorQuantityobject, optional Default 0.1 degrees. The string must be parsable by
Angle. The appropriateQuantityobject fromunitsmay also be used.- hdu
bool, optional If
True, perform the query on HDUs.- cache
bool, optional If
True, cache the result locally.- async_
bool, optional If
True, return the raw query response instead of a Table.
- coordinate
- Returns:
TableA table containing the results.
- sia_url(hdu=False)[source]#
Return the URL for SIA queries.
- Parameters:
- hdu
bool, optional If
Truereturn the URL for HDU-based queries.
- hdu
- Returns:
strThe query URL.
Notes
In other modules this is an attribute or property. However, NOIRLab has two separate SIA URLs for File-based and HDU-based queries, thus a method is needed here.