astroquery:docs

Ned

class astroquery.ned.core.Ned[source] [edit on github]

Bases: astroquery.query.BaseQuery

Attributes Summary

ALL_SKY_URL str(object=’‘) -> string
BASE_URL str(object=’‘) -> string
DATA_SEARCH_URL str(object=’‘) -> string
IMG_DATA_URL str(object=’‘) -> string
OBJ_SEARCH_URL str(object=’‘) -> string
PHOTOMETRY_OUT
SPECTRA_URL str(object=’‘) -> string
TIMEOUT int(x=0) -> int or long

Methods Summary

extract_image_urls(*args, **kwds) Helper function that uses reges to extract the image urls from the given HTML.
get_image_list(*args, **kwds) Helper function that returns a list of urls from which to download the FITS images.
get_images(*args, **kwds) Query function to fetch FITS images for a given identifier.
get_images_async(*args, **kwds) Serves the same purpose as Ned.get_images but returns file-handlers to the remote files rather than downloading them.
get_spectra(*args, **kwds) Query function to fetch FITS files of spectra for a given identifier.
get_spectra_async(*args, **kwds) Serves the same purpose as Ned.get_spectra but returns file-handlers to the remote files rather than downloading them.
get_table(*args, **kwds) Fetches the specified data table for the object from NED and returns it as an astropy.table.Table.
get_table_async(*args, **kwds) Serves the same purpose as Ned.query_region but returns the raw HTTP response rather than the astropy.table.Table object.
query_object(*args, **kwds) Queries objects by name from the NED Service and returns the Main Source Table.
query_object_async(*args, **kwds) Serves the same purpose as Ned.query_object but returns the raw HTTP response rather than the astropy.table.Table object.
query_refcode(*args, **kwds) Used to retrieve all objects contained in a particular reference.
query_refcode_async(*args, **kwds) Serves the same purpose as Ned.query_region but returns the raw HTTP response rather than the astropy.table.Table object.
query_region(*args, **kwds) Used to query a region around a known identifier or given coordinates.
query_region_async(*args, **kwds) Serves the same purpose as Ned.query_region but returns the raw HTTP response rather than the astropy.table.Table object.
query_region_iau(*args, **kwds) Used to query the Ned service via the IAU name.
query_region_iau_async(*args, **kwds) Serves the same purpose as Ned.query_region_iau but returns the raw HTTP response rather than the astropy.table.Table object.

Attributes Documentation

ALL_SKY_URL = 'http://ned.ipac.caltech.edu/cgi-bin/nph-allsky'
BASE_URL = 'http://ned.ipac.caltech.edu/cgi-bin/'
DATA_SEARCH_URL = 'http://ned.ipac.caltech.edu/cgi-bin/nph-datasearch'
IMG_DATA_URL = 'http://ned.ipac.caltech.edu/cgi-bin/imgdata'
OBJ_SEARCH_URL = 'http://ned.ipac.caltech.edu/cgi-bin/nph-objsearch'
PHOTOMETRY_OUT = {1: Options(display_name='Data as Published and Homogenized (mJy)', cgi_name='bot'), 2: Options(display_name='Data as Published', cgi_name='pub'), 3: Options(display_name='Homogenized Units (mJy)', cgi_name='mjy')}
SPECTRA_URL = 'http://ned.ipac.caltech.edu/cgi-bin/NEDspectra'
TIMEOUT = 60

Methods Documentation

static extract_image_urls(*args, **kwds)[source] [edit on github]

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

Parameters :

html_in : str

source from which the urls are to be extracted

static get_image_list(*args, **kwds)[source] [edit on github]

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

Parameters :

object_name : str

name of the identifier to query.

get_query_payload : bool, optional

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

item : str, optional

Can be either ‘image’ or ‘spectra’. Defaults to ‘image’. Required to decide the right URL to query.

Returns :

list of image urls :

static get_images(*args, **kwds)[source] [edit on github]

Query function to fetch FITS images for a given identifier.

Parameters :

object_name : str

name of the identifier to query.

get_query_payload : bool, optional

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

Returns :

A list of `astropy.fits.HDUList` objects :

static get_images_async(*args, **kwds)[source] [edit on github]

Serves the same purpose as Ned.get_images but returns file-handlers to the remote files rather than downloading them.

Parameters :

object_name : str

name of the identifier to query.

get_query_payload : bool, optional

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

Returns :

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

static get_spectra(*args, **kwds)[source] [edit on github]

Query function to fetch FITS files of spectra for a given identifier.

Parameters :

object_name : str

name of the identifier to query.

get_query_payload : bool, optional

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

Returns :

A list of `astropy.fits.HDUList` objects :

static get_spectra_async(*args, **kwds)[source] [edit on github]

Serves the same purpose as Ned.get_spectra but returns file-handlers to the remote files rather than downloading them.

Parameters :

object_name : str

name of the identifier to query.

get_query_payload : bool, optional

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

Returns :

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

static get_table(*args, **kwds)[source] [edit on github]

Fetches the specified data table for the object from NED and returns it as an astropy.table.Table.

Parameters :

object_name : str

name of the identifier to query.

table : str, optional

Must be one of [‘photometry’|’positions’|’diameters’|’redshifts’|’references’|’object_notes’]. Specifies the type of data-table that must be fetched for the given object. Defaults to ‘photometry’.

output_table_format : int, [optional for photometry]

specifies teh format of the output table. Must be 1, 2 or 3. Defaults to 1. These options stand for: (1) Data as Published and Homogenized (mJy) (2) Data as Published (3) Homogenized Units (mJy)

from_year : int, [optional for references]

4 digit year from which to get the references. Defaults to 1800

to_year : int, [optional for references]

4 digit year upto which to fetch the references. Defaults to the current year.

extended_search : bool, [optional for references]

If set to True, returns all objects beginning with the same identifier name. Defaults to False.

get_query_payload : bool, optional

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

verbose : bool, optional.

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

Returns :

result : astropy.table.Table

The result of the query as an astropy.table.Table object.

Notes

Warning

table=references does not work correctly astroquery issue #141

static get_table_async(*args, **kwds)[source] [edit on github]

Serves the same purpose as Ned.query_region but returns the raw HTTP response rather than the astropy.table.Table object.

Parameters :

object_name : str

name of the identifier to query.

table : str, optional

Must be one of [‘photometry’|’positions’|’diameters’|’redshifts’|’references’|’object_notes’]. Specifies the type of data-table that must be fetched for the given object. Defaults to ‘photometry’.

from_year : int, [optional for references]

4 digit year from which to get the references. Defaults to 1800

to_year : int, [optional for references]

4 digit year upto which to fetch the references. Defaults to the current year.

extended_search : bool, [optional for references]

If set to True, returns all objects beginning with the same identifier name. Defaults to False.

get_query_payload : bool, optional

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

Returns :

response : requests.Response

The HTTP response returned from the service.

static query_object(*args, **kwds)[source] [edit on github]

Queries objects by name from the NED Service and returns the Main Source Table.

Parameters :

object_name : str

name of the identifier to query.

get_query_payload : bool, optional

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

verbose : bool, optional.

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

Returns :

result : astropy.table.Table

The result of the query as an astropy.table.Table object.

static query_object_async(*args, **kwds)[source] [edit on github]

Serves the same purpose as Ned.query_object but returns the raw HTTP response rather than the astropy.table.Table object.

Parameters :

object_name : str

name of the identifier to query.

get_query_payload : bool, optional

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

Returns :

response : requests.Response

The HTTP response returned from the service

static query_refcode(*args, **kwds)[source] [edit on github]

Used to retrieve all objects contained in a particular reference. Equivalent to by refcode queries of the web interface.

Parameters :

refcode : str

19 digit reference code. Example: 1997A&A...323...31K.

get_query_payload : bool, optional

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

verbose : bool, optional.

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

Returns :

result : astropy.table.Table

The result of the query as an astropy.table.Table object.

static query_refcode_async(*args, **kwds)[source] [edit on github]

Serves the same purpose as Ned.query_region but returns the raw HTTP response rather than the astropy.table.Table object.

Parameters :

refcode : str

19 digit reference code. Example: 1997A&A...323...31K.

get_query_payload : bool, optional

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

Returns :

response : requests.Response

The HTTP response returned from the service.

static query_region(*args, **kwds)[source] [edit on github]

Used to query a region around a known identifier or given coordinates. Equivalent to the near position and near name queries from the Ned web interface.

Parameters :

coordinates : str 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.

radius : str or astropy.units.Quantity object, optional

The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 1 arcmin.

equinox : str, optional

The equinox may be either J2000.0 or B1950.0. Defaults to J2000.0

get_query_payload : bool, optional

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

verbose : bool, optional.

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

Returns :

result : astropy.table.Table

The result of the query as an astropy.table.Table object.

static query_region_async(*args, **kwds)[source] [edit on github]

Serves the same purpose as Ned.query_region but returns the raw HTTP response rather than the astropy.table.Table object.

Parameters :

coordinates : str 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.

radius : str or astropy.units.Quantity object, optional

The string must be parsable by astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 1 arcmin.

equinox : str, optional

The equinox may be either J2000.0 or B1950.0. Defaults to J2000.0

get_query_payload : bool, optional

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

Returns :

response : requests.Response

The HTTP response returned from the service

static query_region_iau(*args, **kwds)[source] [edit on github]

Used to query the Ned service via the IAU name. Equivalent to the IAU format queries of the Web interface.

Parameters :

iau_name : str

IAU coordinate-based name of target on which search is centered. Definition of IAU coordinates at http://cdsweb.u-strasbg.fr/Dic/iau-spec.html.

frame : str, optional

May be one of ‘Equatorial’, ‘Ecliptic’, ‘Galactic’, ‘SuperGalactic’. Defaults to ‘Equatorial’.

equinox : str, optional

The equinox may be one of J2000.0 or B1950.0. Defaults to B1950.0

get_query_payload : bool, optional

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

verbose : bool, optional.

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

Returns :

result : astropy.table.Table

The result of the query as an astropy.table.Table object.

static query_region_iau_async(*args, **kwds)[source] [edit on github]

Serves the same purpose as Ned.query_region_iau but returns the raw HTTP response rather than the astropy.table.Table object.

Parameters :

iau_name : str

IAU coordinate-based name of target on which search is centered. Definition of IAU coordinates at http://cdsweb.u-strasbg.fr/Dic/iau-spec.html.

frame : str, optional

May be one of ‘Equatorial’, ‘Ecliptic’, ‘Galactic’, ‘SuperGalactic’. Defaults to ‘Equatorial’.

equinox : str, optional

The equinox may be one of J2000.0 or B1950.0. Defaults to B1950.0

get_query_payload : bool, optional

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

Returns :

response : requests.Response

The HTTP response returned from the service.

Page Contents