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

Methods Summary

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

Return 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, *[, ...])

Query function to fetch FITS images for a given identifier.

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

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

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

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

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

Fetch the specified data table for the object from NED DBR service.

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

Fetch the specified data table for the object from NED DBR service.

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

Query object by name from the NED DBR Service and returns the Main Source Table.

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

Query objects by name from the NED DBR Service and returns the raw HTTP response.

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

Query to retrieve all objects contained in a particular reference.

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

Query to retrieve all objects contained in a particular reference.

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

Query the objects in a region around a known identifier or given coordinates.

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

Query the objects in a region around a known identifier or given coordinates.

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

Query the Ned service to do cone search via the IAU name in the equatorial coordinate system.

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

Query the NED services to do cone search via the IAU name in the equatorial coordinate system.

Attributes Documentation

BASE_URL = 'https://ned.ipac.caltech.edu/cgi-bin/'#
CONESEARCH_IAU = 'ConeSearchByIAUstyle'#
CONESEARCH_POSITION = 'ConeSearchByPosition'#
CONESEARCH_TARGET = 'ConeSearchByTarget'#
DBR_BASE_URL = 'https://ned.ipac.caltech.edu/NED::API/'#
DBR_CSYS = 'CSYS'#
DBR_EQUINOX = 'EQUINOX'#
DBR_IAU = 'IAU_NAME'#
DBR_ISLINE = 'SPECLINES'#
DBR_LAT = 'LAT'#
DBR_LON = 'LON'#
DBR_MAXREC = 'MAXREC'#
DBR_RADIUS = 'RADIUS'#
DBR_REFCODE = 'REFCODE'#
DBR_TARGET = 'TARGET'#
IMG_DATA_URL = 'https://ned.ipac.caltech.edu/cgi-bin/imgdata'#
OBJSEARCH_CROSSIDS = 'CrossidsOfObject'#
OBJSEARCH_DIAMETERS = 'DiametersOfObject'#
OBJSEARCH_DISTANCES = 'DistancesOfObject'#
OBJSEARCH_EXTINCTION = 'ExtinctionAtTarget'#
OBJSEARCH_INREFCODE = 'ObjectsInRefcode'#
OBJSEARCH_NOTES = 'NotesOfObject'#
OBJSEARCH_PHOTOMETRY = 'PhotometryOfObject'#
OBJSEARCH_POSITIONS = 'PositionsOfObject'#
OBJSEARCH_REDSHIFTS = 'RedshiftsOfObject'#
OBJSEARCH_REFERENCES = 'ReferencesOfObject'#
SEARCH_TYPE = ''#
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]#

Return 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

show_progressbool

display the progress.

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

Query function to fetch FITS images for a given identifier.

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

show_progressbool

display the progress

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

show_progressbool

display the progress.

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

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

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

show_progressbool

display the progress.

Returns:
A list of context-managers that yield readable file-like objects
get_table(object_name, *, table='photometry', get_query_payload=False, verbose=False, maxrec=None, is_line=False, output_table_format=None, from_year=None, to_year=None, extended_search=None)[source]#

Fetch the specified data table for the object from NED DBR service.

The returned table is in the form of Table.

Parameters:
object_namestr

name of the identifier to query.

tablestr, optional

Must be one of crossids, positions, redshifts, distances, photometry, extinctions, notes (or object_notes), diameters, and references. Specifies the type of data-table that must be fetched for the given object. Defaults to photometry.

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.

maxrec: int, optional

Maximum records to return from the query.

is_line: bool, optional for photometry service

If set to True then gets photometry data of line component. Defaults to False.

Returns:
responsedict, if get_query_payload is True.

The service query key/value set.

resultTable

The result of the query as an Table object, or None if an error occurs.

get_table_async(object_name, *, table='photometry', get_query_payload=False, maxrec=None, is_line=False, output_table_format=None, from_year=None, to_year=None, extended_search=None)[source]#

Fetch the specified data table for the object from NED DBR service.

Serves the same purpose as get_table but returns the raw HTTP response rather than the Table object.

Parameters:
object_namestr

name of the identifier to query.

tablestr, optional

Must be one of crossids, positions, redshifts, distances, photometry, extinctions, notes (or object_notes), diameters, and references. Specifies the type of data-table that must be fetched for the given object. Defaults to photometry.

get_query_payloadbool, optional

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

maxrec: int, optional

Maximum records to return from the query.

is_line: bool, optional for photometry service

If set to True then gets photometry data of line component. Defaults to False.

Returns:
dict, if get_query_payload is True.

The service query key/value set.

Response

The HTTP response returned from the table service.

Raises:
InvalidQueryErrorif there is error in the specified table service.
query_object(object_name, *, get_query_payload=False, verbose=False)[source]#

Query object by name from the NED DBR 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:
responsedict, if get_query_payload is True.

The service query key/value set.

resultTable

The result of the query as an Table object, or None if an error occurs.

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

Query objects by name from the NED DBR Service and returns the raw HTTP response.

Serves the same purpose as query_object but returns the raw HTTP response rather than the 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:
dict, if get_query_payload is True.

The service query key/value set.

Response

The HTTP response returned from the service.

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

Query 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.

maxrec: int, optional

Maximum records to return from the query. Defaults to all records if not specified.

Returns:
responsedict, if get_query_payload is True.

The service query key/value set.

resultTable

The result of the query as an Table object, or None if an error occurs.

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

Query to retrieve all objects contained in a particular reference.

Serves the same purpose as query_refcode but returns the raw HTTP response rather than the 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.

maxrec: int, optional

Maximum records to return from the query. Defaults to all records if not specified.

Returns:
dict, if get_query_payload is True

The service query key/value set.

Response

The HTTP response returned from the service.

query_region(coordinates, *, radius=<Quantity 1. arcmin>, get_query_payload=False, verbose=False, equinox='J2000.0', z_constraint=None, z_value1=None, z_value2=None, z_unit=None, maxrec=None)[source]#

Query the objects in 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 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 coordinates object. ICRS coordinates may also be entered as strings as specified in the coordinates module.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from units may also be used. Defaults to 1 arcmin. ex: “3.0 arcmin” (str) or 2.0 * u.arcmin (Quantity)

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.

equinoxstr, optional

The equinox may be either J2000.0 or B1950.0. Defaults to J2000.0. For string-formatted coordinates (for example, “12h30m00s +12d30m00s”), this value is used to determine the request equinox. If the value is not recognized as J2000/B1950, the query raises an input error. For coordinate-object inputs, this argument is ignored and the equinox is derived from the coordinate frame. Accepted NED equatorial pairs are FK4/B1950 and FK5/J2000; otherwise, the coordinate is normalized to FK5/J2000.

z_constraint: str, optional

The redshift constraint may be Unconstrained, Available, Unavailable, Larger Than, Less Than or Between.

z_value1, z_value2: float, optional.

z_value1 is the redshift bound for the constraint Larger Than, Less Than, or the minimum value within a range for Between. z_value2 is the maximum value within a range for Between.

z_unit: str, optional

The redshift value unit may be z or km/s. Defaults to None, in which case the NED service treats it as z.

maxrec: int, optional

Maximum records to return from the query. Defaults to all records if not specified.

Returns:
responsedict, if get_query_payload is True.

The service query key/value set, or None if an error occurs.

resultTable

The result of the query as an Table object or None if an error occurs.

query_region_async(coordinates, *, radius=<Quantity 1. arcmin>, get_query_payload=False, equinox='J2000.0', z_constraint=None, z_value1=None, z_value2=None, z_unit=None, maxrec=None)[source]#

Query the objects in a region around a known identifier or given coordinates.

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

Parameters:
coordinatesstr or 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 coordinates object. ICRS coordinates may also be entered as strings as specified in the coordinates module.

radiusstr or Quantity object, optional

The string must be parsable by Angle. The appropriate Quantity object from units may also be used. Defaults to 1 arcmin. ex: “3.0 arcmin” (str) or 2.0 * u.arcmin (Quantity)

get_query_payloadbool, optional

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

equinoxstr, optional

The equinox may be either J2000.0 or B1950.0. Defaults to J2000.0. For string-formatted coordinates (for example, “12h30m00s +12d30m00s”), this value is used to determine the request equinox. If the value is not recognized as J2000/B1950, the query raises an input error. For coordinate-object inputs, this argument is ignored and the equinox is derived from the coordinate frame. Accepted NED equatorial pairs are FK4/B1950 and FK5/J2000; otherwise, the coordinate is normalized to FK5/J2000.

z_constraint: str, optional

The redshift constraint may be Unconstrained, Available, Unavailable, Larger Than, Less Than or Between.

z_value1, z_value2: float, optional.

z_value1 is the redshift bound for the constraint Larger Than, Less Than, or the minimum value within a range for Between. z_value2 is the maximum value within a range for Between.

z_unit: str, optional

The redshift value unit may be z or km/s. Defaults to None, in which case the NED service treats it as z.

maxrec: int, optional

Maximum records to return from the query. Defaults to all records if not specified.

Returns:
dict, if get_query_payload is True.

The service query key/value set.

Response

The HTTP response returned from the service.

Raises:
TypeErrorif there is type error in the coordinate.
InvalidQueryErrorif there is error in the redshift constraint.
query_region_iau(iau_name, *, equinox='B1950.0', get_query_payload=False, verbose=False, z_constraint=None, z_value1=None, z_value2=None, z_unit=None, maxrec=None)[source]#

Query the Ned service to do cone search via the IAU name in the equatorial coordinate system.

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.

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.

z_constraint: str, optional

redshift constraint may be Unconstrained, Available, Unavailable, Larger Than, Less Than or Between.

z_value1, z_value2: float, optional.

The redshift values for the constraint. z_value1 is for Larger Than, Less Than, or the minimum of Between. z_value2 is for the maximum of Between.

z_unit: str, optional

The redshift value unit may be z or km/s. Defaults to None, in which case the NED service treats it as z.

maxrec: int, optional

Maximum records to return from the query.

Returns:
responsedict, if get_query_payload is True.

The service query key/value set, or None if an error occurs.

resultTable

The result of the query as an Table object, or None if an error occurs.

query_region_iau_async(iau_name, *, equinox='B1950.0', get_query_payload=False, z_constraint=None, z_value1=None, z_value2=None, z_unit=None, maxrec=None)[source]#

Query the NED services to do cone search via the IAU name in the equatorial coordinate system.

Serves the same purpose as query_region_iau but returns the raw HTTP response rather than the 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.

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

z_constraint: str, optional

redshift constraint may be Unconstrained, Available, Unavailable, Larger Than, Less Than or Between.

z_value1, z_value2: float, optional.

The redshift values for the constraint. z_value1 is for Larger Than, Less Than, or the minimum of Between. z_value2 is for the maximum of Between.

z_unit: str, optional

The redshift value unit may be z or km/s. Defaults to None, in which case the NED service treats it as z.

maxrec: int, optional

Maximum records to return from the query. Defaults to all records if not specified.

Returns:
dict, if get_query_payload is True.

The service query key/value set.

Response

The HTTP response returned from the service, or None if an error occurs.

Raises:
InvalidQueryErrorif there is error in redshift constraint.