NedClass

class astroquery.ipac.ned.NedClass[source]

Bases: BaseQuery

Class for querying the NED (NASA/IPAC Extragalactic Database) system

https://ned.ipac.caltech.edu/

Attributes Summary

ALL_SKY_URL

BASE_URL

DATA_SEARCH_URL

IMG_DATA_URL

OBJ_SEARCH_URL

PHOTOMETRY_OUT

SPECTRA_URL

TIMEOUT

Methods Summary

get_image_list(object_name, *[, item, ...])

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

get_images(object_name, *[, ...])

Query function to fetch FITS images for a given identifier.

get_images_async(object_name, *[, ...])

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

get_spectra(object_name, *[, ...])

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

get_spectra_async(object_name, *[, ...])

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

get_table(object_name, *[, table, ...])

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

get_table_async(object_name, *[, table, ...])

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

query_object(object_name, *[, ...])

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

query_object_async(object_name, *[, ...])

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

query_refcode(refcode, *[, ...])

Used to retrieve all objects contained in a particular reference.

query_refcode_async(refcode, *[, ...])

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

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

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

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

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

query_region_iau(iau_name, *[, frame, ...])

Used to query the Ned service via the IAU name.

query_region_iau_async(iau_name, *[, frame, ...])

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

Attributes Documentation

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

Methods Documentation

get_image_list(object_name, *, item='image', file_format='fits', get_query_payload=False)[source]

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

Parameters:
object_namestr

name of the identifier to query.

get_query_payloadbool, optional

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

itemstr, optional

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

file_formatstr, optional

Format of images/spectra to return. Defaults to ‘fits’. Other options available: ‘author-ascii’, ‘NED-ascii’, ‘VO-table’.

Returns:
list of image urls
get_images(object_name, *, get_query_payload=False, show_progress=True)[source]

Query function to fetch FITS images for a given identifier.

Parameters:
object_namestr

name of the identifier to query.

get_query_payloadbool, optional

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

Returns:
A list of HDUList objects
get_images_async(object_name, *, get_query_payload=False, show_progress=True)[source]

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

Parameters:
object_namestr

name of the identifier to query.

get_query_payloadbool, 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
get_spectra(object_name, *, get_query_payload=False, show_progress=True)[source]

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

Parameters:
object_namestr

name of the identifier to query.

get_query_payloadbool, optional

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

Returns:
A list of HDUList objects
get_spectra_async(object_name, *, get_query_payload=False, show_progress=True)[source]

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

Parameters:
object_namestr

name of the identifier to query.

get_query_payloadbool, 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
get_table(object_name, *, table='photometry', get_query_payload=False, verbose=False, **kwargs)[source]

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

Parameters:
object_namestr

name of the identifier to query.

tablestr, 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_formatint, [optional for photometry]

specifies the 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_yearint, [optional for references]

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

to_yearint, [optional for references]

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

extended_searchbool, [optional for references]

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

get_query_payloadbool, optional

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

verbosebool, optional.

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

Returns:
resultastropy.table.Table

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

get_table_async(object_name, *, table='photometry', get_query_payload=False, **kwargs)[source]

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

Parameters:
object_namestr

name of the identifier to query.

tablestr, 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_yearint, [optional for references]

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

to_yearint, [optional for references]

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

extended_searchbool, [optional for references]

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

get_query_payloadbool, optional

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

Returns:
responserequests.Response

The HTTP response returned from the service.

query_object(object_name, *, get_query_payload=False, verbose=False)[source]

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

Parameters:
object_namestr

name of the identifier to query.

get_query_payloadbool, optional

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

verbosebool, optional.

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

Returns:
resultastropy.table.Table

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

query_object_async(object_name, *, get_query_payload=False)[source]

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

Parameters:
object_namestr

name of the identifier to query.

get_query_payloadbool, optional

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

Returns:
responserequests.Response

The HTTP response returned from the service

query_refcode(refcode, *, get_query_payload=False, verbose=False)[source]

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

Parameters:
refcodestr

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

get_query_payloadbool, optional

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

verbosebool, optional.

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

Returns:
resultastropy.table.Table

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

query_refcode_async(refcode, *, get_query_payload=False)[source]

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

Parameters:
refcodestr

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

get_query_payloadbool, optional

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

Returns:
responserequests.Response

The HTTP response returned from the service.

query_region(coordinates, *, radius=<Quantity 1. arcmin>, equinox='J2000.0', get_query_payload=False, verbose=False)[source]

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:
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. Defaults to 1 arcmin.

equinoxstr, optional

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

get_query_payloadbool, optional

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

verbosebool, optional.

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

Returns:
resultastropy.table.Table

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

query_region_async(coordinates, *, radius=<Quantity 1. arcmin>, equinox='J2000.0', get_query_payload=False)[source]

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

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 astropy.coordinates.Angle. The appropriate Quantity object from astropy.units may also be used. Defaults to 1 arcmin.

equinoxstr, optional

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

get_query_payloadbool, optional

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

Returns:
responserequests.Response

The HTTP response returned from the service

query_region_iau(iau_name, *, frame='Equatorial', equinox='B1950.0', get_query_payload=False, verbose=False)[source]

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

Parameters:
iau_namestr

IAU coordinate-based name of target on which search is centered. Definition of IAU coordinates at https://cds.unistra.fr/Dic/iau-spec.html.

framestr, optional

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

equinoxstr, optional

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

get_query_payloadbool, optional

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

verbosebool, optional.

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

Returns:
resultastropy.table.Table

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

query_region_iau_async(iau_name, *, frame='Equatorial', equinox='B1950.0', get_query_payload=False)[source]

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

Parameters:
iau_namestr

IAU coordinate-based name of target on which search is centered. Definition of IAU coordinates at https://cds.unistra.fr/Dic/iau-spec.html.

framestr, optional

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

equinoxstr, optional

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

get_query_payloadbool, optional

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

Returns:
responserequests.Response

The HTTP response returned from the service.