VsaClass

class astroquery.vsa.VsaClass(username=None, password=None, community=None, database='VVVDR4', programme_id='all')[source]

Bases: BaseWFAUClass

The VsaQuery class. Must instantiate this class in order to make any queries. Allows registered users to login, but defaults to using the public Vsa data sets.

The BaseWFAUClass __init__ is meant to be overwritten

Attributes Summary

ARCHIVE_URL

BASE_URL

CROSSID_FORM

CROSSID_URL

IMAGE_FORM

IMAGE_URL

LOGIN_URL

REGION_URL

TIMEOUT

all_databases

archive

filters

frame_types

programmes_long

programmes_short

Methods Summary

__call__(*args, **kwargs)

init a fresh copy of self

authenticated()

extract_urls(html_in)

Helper function that uses regexps to extract the image urls from the given HTML.

get_image_list(coordinates[, waveband, ...])

Function that returns a list of urls from which to download the FITS images.

get_images(coordinates[, waveband, ...])

Get an image around a target/ coordinates from a WFAU catalog.

get_images_async(coordinates[, waveband, ...])

Serves the same purpose as get_images but returns a list of file handlers to remote files.

list_catalogs([style])

Returns a list of available catalogs in WFAU.

list_databases()

List the databases available from the WFAU archive.

logged_in()

Determine whether currently logged in.

login(username, password, community)

Login to non-public data as a known user.

query_cross_id(*args, **kwargs)

See query_cross_id_async

query_cross_id_async(coordinates[, radius, ...])

Query the crossID server

query_region(coordinates[, radius, ...])

Used to query a region around a known identifier or given coordinates from the catalog.

query_region_async(coordinates[, radius, ...])

Serves the same purpose as query_region.

Attributes Documentation

ARCHIVE_URL = 'http://horus.roe.ac.uk:8080/vdfs/ImageList'
BASE_URL = 'http://horus.roe.ac.uk:8080/vdfs/'
CROSSID_FORM = 'VcrossID_form.jsp'
CROSSID_URL = 'http://horus.roe.ac.uk:8080/vdfs/CrossID'
IMAGE_FORM = 'VgetImage_form.jsp'
IMAGE_URL = 'http://horus.roe.ac.uk:8080/vdfs/GetImage'
LOGIN_URL = 'http://horus.roe.ac.uk:8080/vdfs/DBLogin'
REGION_URL = 'http://horus.roe.ac.uk:8080/vdfs/WSASQL'
TIMEOUT = 30
all_databases = ('VHSDR4', 'VHSDR3', 'VHSDR2', 'VHSDR1', 'VVVDR4', 'VVVDR2', 'VVVDR1', 'VMCDR4', 'VMCDR3', 'VMCDR2', 'VMCDR1', 'VIKINGDR4', 'VIKINGDR3', 'VIKINGDR2', 'VIDEODR5', 'VIDEODR4', 'VIDEODR3', 'VIDEODR2', 'VISTAOPENTIME')
archive = 'VSA'
filters = {'H': 4, 'J': 3, 'Ks': 5, 'NB118': 9, 'NB980': 10, 'Y': 2, 'Z': 1, 'all': 'all'}
frame_types = {'all': 'all', 'confidence': 'conf', 'deep_stack': 'deep%stack', 'difference': 'diff', 'normal': 'normal', 'stack': 'stack', 'tilestack': 'tilestack'}
programmes_long = {'An ultra-deep survey with VISTA': 160, 'Calibration data': 200, 'VISTA Deep Extragalactic Observations': 150, 'VISTA Hemisphere Survey': 110, 'VISTA Kilo-degree Infrared Galaxy Survey': 140, 'VISTA Magellanic Clouds Survey': 130, 'VISTA Variables in the Via Lactea': 120}
programmes_short = {'Calibration': 200, 'UltraVISTA': 160, 'VHS': 110, 'VIDEO': 150, 'VIKING': 140, 'VMC': 130, 'VVV': 120}

Methods Documentation

__call__(*args, **kwargs)

init a fresh copy of self

authenticated()
extract_urls(html_in)

Helper function that uses regexps to extract the image urls from the given HTML.

Parameters:
html_instr

source from which the urls are to be extracted.

Returns:
linkslist

The list of URLS extracted from the input.

get_image_list(coordinates, waveband='all', frame_type='stack', image_width=<Quantity 1. arcmin>, image_height=None, radius=None, database=None, programme_id=None, get_query_payload=False)

Function that returns a list of urls from which to download the FITS images.

Parameters:
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string in which case it is resolved using online services or as the appropriate astropy.coordinates object. ICRS coordinates may also be entered as strings as specified in the astropy.coordinates module.

wavebandstr

The color filter to download. Must be one of 'all', 'J', 'H', 'K', 'H2', 'Z', 'Y', 'Br'].

frame_typestr

The type of image. Must be one of 'stack', 'normal', 'interleave', 'deep_stack', 'confidence', 'difference', 'leavstack', 'all']

image_widthstr or Quantity object, optional

The image size (along X). Cannot exceed 15 arcmin. If missing, defaults to 1 arcmin.

image_heightstr or Quantity object, optional

The image size (along Y). Cannot exceed 90 arcmin. If missing, same as image_width.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used. When missing only image around the given position rather than multi-frames are retrieved.

programme_idstr

The survey or programme in which to search for. See list_catalogs.

databasestr

The WFAU database to use.

verbosebool

Defaults to True. When True prints additional messages.

get_query_payloadbool, optional

If True then returns the dictionary sent as the HTTP request. Defaults to False.

Returns:
url_listlist of image urls
get_images(coordinates, waveband='all', frame_type='stack', image_width=<Quantity 1. arcmin>, image_height=None, radius=None, database=None, programme_id=None, verbose=True, get_query_payload=False, show_progress=True)

Get an image around a target/ coordinates from a WFAU catalog.

Parameters:
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string in which case it is resolved using online services or as the appropriate astropy.coordinates object. ICRS coordinates may also be entered as strings as specified in the astropy.coordinates module.

wavebandstr

The color filter to download. Must be one of 'all', 'J', 'H', 'K', 'H2', 'Z', 'Y', 'Br'].

frame_typestr

The type of image. Must be one of 'stack', 'normal', 'interleave', 'deep_stack', 'confidence', 'difference', 'leavstack', 'all']

image_widthstr or Quantity object, optional

The image size (along X). Cannot exceed 15 arcmin. If missing, defaults to 1 arcmin.

image_heightstr or Quantity object, optional

The image size (along Y). Cannot exceed 90 arcmin. If missing, same as image_width.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used. When missing only image around the given position rather than multi-frames are retrieved.

programme_idstr

The survey or programme in which to search for.

databasestr

The WFAU database to use.

verbosebool

Defaults to True. When True prints additional messages.

get_query_payloadbool, optional

If True then returns the dictionary sent as the HTTP request. Defaults to False.

Returns:
listA list of HDUList objects.
get_images_async(coordinates, waveband='all', frame_type='stack', image_width=<Quantity 1. arcmin>, image_height=None, radius=None, database=None, programme_id=None, verbose=True, get_query_payload=False, show_progress=True)

Serves the same purpose as get_images but returns a list of file handlers to remote files.

Parameters:
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string in which case it is resolved using online services or as the appropriate astropy.coordinates object. ICRS coordinates may also be entered as strings as specified in the astropy.coordinates module.

wavebandstr

The color filter to download. Must be one of 'all', 'J', 'H', 'K', 'H2', 'Z', 'Y', 'Br'].

frame_typestr

The type of image. Must be one of 'stack', 'normal', 'interleave', 'deep_stack', 'confidence', 'difference', 'leavstack', 'all']

image_widthstr or Quantity object, optional

The image size (along X). Cannot exceed 15 arcmin. If missing, defaults to 1 arcmin.

image_heightstr or Quantity object, optional

The image size (along Y). Cannot exceed 90 arcmin. If missing, same as image_width.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used. When missing only image around the given position rather than multi-frames are retrieved.

programme_idstr

The survey or programme in which to search for. See list_catalogs.

databasestr

The WFAU database to use.

verbosebool

Defaults to True. When True prints additional messages.

get_query_payloadbool, optional

If True then returns the dictionary sent as the HTTP request. Defaults to False.

Returns:
listlist

A list of context-managers that yield readable file-like objects.

list_catalogs(style='short')

Returns a list of available catalogs in WFAU. These can be used as programme_id in queries.

Parameters:
stylestr, optional

Must be one of 'short', 'long'. Defaults to 'short'. Determines whether to print long names or abbreviations for catalogs.

Returns:
listlist containing catalog name strings in long or short style.
list_databases()

List the databases available from the WFAU archive.

logged_in()

Determine whether currently logged in.

login(username, password, community)

Login to non-public data as a known user.

Parameters:
usernamestr
passwordstr
communitystr
query_cross_id(*args, **kwargs)

See query_cross_id_async

query_cross_id_async(coordinates, radius=<Quantity 1. arcsec>, programme_id=None, database=None, table='source', constraints='', attributes='default', pairing='all', system='J2000', get_query_payload=False)

Query the crossID server

Parameters:
coordinatesastropy.SkyCoord

An array of one or more astropy SkyCoord objects specifying the objects to crossmatch against.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used. When missing defaults to 1 arcsec.

programme_idstr

The survey or programme in which to search for. See list_catalogs.

databasestr

The WFAU database to use.

tablestr

The table ID, one of: “source”, “detection”, “synopticSource”

constraintsstr

SQL constraints. If ‘source’ is selected, this will be expanded automatically

attributesstr

Additional attributes to select from the table. See, e.g., http://horus.roe.ac.uk/vsa/crossID_notes.html

system‘J2000’ or ‘Galactic’

The system in which to perform the query. Can affect the output data columns.

get_query_payloadbool, optional

If True then returns the dictionary sent as the HTTP request. Defaults to False.

query_region(coordinates, radius=<Quantity 1. arcmin>, programme_id=None, database=None, verbose=False, get_query_payload=False, system='J2000', attributes=['default'], constraints='')

Used to query a region around a known identifier or given coordinates from the catalog.

Parameters:
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string in which case it is resolved using online services or as the appropriate astropy.coordinates object. ICRS coordinates may also be entered as strings as specified in the astropy.coordinates module.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used. When missing defaults to 1 arcmin. Cannot exceed 90 arcmin.

programme_idstr

The survey or programme in which to search for. See list_catalogs.

databasestr

The WFAU database to use.

verbosebool, optional.

When set to True displays warnings if the returned VOTable does not conform to the standard. Defaults to False.

get_query_payloadbool, optional

If True then returns the dictionary sent as the HTTP request. Defaults to False.

system‘J2000’ or ‘Galactic’

The system in which to perform the query. Can affect the output data columns.

attributeslist, optional.

Attributes to select from the table. See, e.g., http://horus.roe.ac.uk/vsa/crossID_notes.html

constraintsstr, optional

SQL constraints to the search. Default is empty (no constrains applied).

Returns:
resultTable

Query result table.

query_region_async(coordinates, radius=<Quantity 1. arcmin>, programme_id=None, database=None, get_query_payload=False, system='J2000', attributes=['default'], constraints='')

Serves the same purpose as query_region. But returns the raw HTTP response rather than the parsed result.

Parameters:
coordinatesstr or astropy.coordinates object

The target around which to search. It may be specified as a string in which case it is resolved using online services or as the appropriate astropy.coordinates object. ICRS coordinates may also be entered as strings as specified in the astropy.coordinates module.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from astropy.units may also be used. When missing defaults to 1 arcmin. Cannot exceed 90 arcmin.

programme_idstr

The survey or programme in which to search for. See list_catalogs.

databasestr

The WFAU database to use.

get_query_payloadbool, optional

If True then returns the dictionary sent as the HTTP request. Defaults to False.

attributeslist, optional.

Attributes to select from the table. See, e.g., http://horus.roe.ac.uk/vsa/crossID_notes.html

constraintsstr, optional

SQL constraints to the search. Default is empty (no constrains applied).

Returns:
responserequests.Response

The HTTP response returned from the service.