CasdaClass¶
- class astroquery.casda.CasdaClass[source]¶
Bases:
QueryWithLogin
Class for accessing ASKAP data through the CSIRO ASKAP Science Data Archive (CASDA). Typical usage:
result = Casda.query_region(‘22h15m38.2s -45d50m30.5s’, radius=0.5 * u.deg)
Attributes Summary
Methods Summary
cutout
(table, *[, coordinates, radius, ...])Produce a cutout from each selected file.
download_files
(urls, *[, savedir])Download a series of files
filter_out_unreleased
(table)Return a subset of the table which only includes released (public) data.
login
(*[, username, store_password, ...])login to non-public data as a known user
query_region
(*args, **kwargs)Queries the service and returns a table object.
query_region_async
(coordinates, *[, radius, ...])Queries a region around the specified coordinates.
stage_data
(table, *[, verbose])Request access to a set of data files.
Attributes Documentation
- POLL_INTERVAL = 20¶
- TIMEOUT = 30¶
- URL = 'https://casda.csiro.au/casda_vo_tools/sia2/query'¶
- USERNAME = ''¶
Methods Documentation
- cutout(table, *, coordinates=None, radius=<Quantity 1. arcmin>, height=None, width=None, band=None, channel=None, verbose=False)[source]¶
Produce a cutout from each selected file. All requests for data must use authentication. If you have access to the data, the requested files will be brought online, a cutout produced from each file and a set of URLs to download the cutouts will be returned.
If a set of coordinates is provided along with either a radius or a box height and width, then CASDA will produce a spatial cutout at that location from each data file specified in the table. If a band or channel pair is provided then CASDA will produce a spectral cutout of that range from each data file. These can be combined to produce subcubes with restrictions in both spectral and spatial axes.
- Parameters:
- table: `astropy.table.Table`
A table describing the files to be staged, such as produced by query_region. It must include an access_url column.
- coordinatesstr or
astropy.coordinates
, optional coordinates around which to produce a cutout, the radius will be 1 arcmin if no radius, height or width is provided.
- radiusstr or
astropy.units.Quantity
, optional the radius of the cutout
- heightstr or
astropy.units.Quantity
, optional the height for a box cutout
- widthstr or
astropy.units.Quantity
, optional the width for a box cutout
- bandlist of
astropy.units.Quantity
with two elements, optional the spectral range to be included, may be low and high wavelengths in metres or low and high frequencies in Hertz. Use None for an open bound.
- channellist of int with two elements, optional
the spectral range to be included, the low and high channels (i.e. planes of a cube) inclusive
- verbose: bool, optional
Should status messages be logged periodically, defaults to False
- Returns:
- A list of urls of both the requested files/cutouts and the checksums for the files/cutouts
- download_files(urls, *, savedir='')[source]¶
Download a series of files
- Parameters:
- urls: list of strings
The list of URLs of the files to be downloaded.
- savedir: str, optional
The directory in which to save the files.
- Returns:
- A list of the full filenames of the downloaded files.
- filter_out_unreleased(table)[source]¶
Return a subset of the table which only includes released (public) data.
- Parameters:
- table: `astropy.table.Table`
A table of results as returned by query_region. Must include an obs_release_date column.
- Returns:
- table
astropy.table.Table
The table with all unreleased (non public) data products filtered out.
- table
- login(*, username=None, store_password=False, reenter_password=False)¶
login to non-public data as a known user
- Parameters:
- usernamestr, optional
Username to the CASDA archive, uses ATNF OPAL credentials. If not given, it should be specified in the config file.
- store_passwordbool, optional
Stores the password securely in your keyring. Default is False.
- reenter_passwordbool, optional
Asks for the password even if it is already stored in the keyring. This is the way to overwrite an already stored passwork on the keyring. Default is False.
- query_region(*args, **kwargs)¶
Queries the service and returns a table object.
Queries a region around the specified coordinates. Either a radius or both a height and a width must be provided.
- Parameters:
- coordinatesstr or
astropy.coordinates
. coordinates around which to query
- radiusstr or
astropy.units.Quantity
, optional the radius of the cone search
- heightstr or
astropy.units.Quantity
, optional the height for a box region
- widthstr or
astropy.units.Quantity
, optional the width for a box region
- get_query_payloadbool, optional
Just return the dict of HTTP request parameters.
- cachebool
Defaults to True. If set overrides global caching behavior. See caching documentation.
- coordinatesstr or
- Returns:
- tableA
Table
object.
- tableA
- query_region_async(coordinates, *, radius=<Quantity 1. arcmin>, height=None, width=None, get_query_payload=False, cache=True)[source]¶
Queries a region around the specified coordinates. Either a radius or both a height and a width must be provided.
- Parameters:
- coordinatesstr or
astropy.coordinates
. coordinates around which to query
- radiusstr or
astropy.units.Quantity
, optional the radius of the cone search
- heightstr or
astropy.units.Quantity
, optional the height for a box region
- widthstr or
astropy.units.Quantity
, optional the width for a box region
- get_query_payloadbool, optional
Just return the dict of HTTP request parameters.
- cachebool
Defaults to True. If set overrides global caching behavior. See caching documentation.
- coordinatesstr or
- Returns:
- response
requests.Response
The HTTP response returned from the service. All async methods should return the raw HTTP response.
- response
- stage_data(table, *, verbose=False)[source]¶
Request access to a set of data files. All requests for data must use authentication. If you have access to the data, the requested files will be brought online and a set of URLs to download the files will be returned.
- Parameters:
- table: `astropy.table.Table`
A table describing the files to be staged, such as produced by query_region. It must include an access_url column.
- verbose: bool, optional
Should status message be logged periodically, defaults to False
- Returns:
- A list of urls of both the requested files/cutouts and the checksums for the files/cutouts