ObjectData¶
-
class
pyvo.nameresolver.sesame.
ObjectData
(etreeEl)[source]¶ Bases:
object
a container for the target metadata returned from a resolver. The success attribute will be true if the resolver successfully matched the target name and returned metadata for it.
The metadata that gets returned will depend on the resolver, the type of object (and what is known about it), and the input options given in the sesame query. The full set of possible metadata is given by the class attribute “metadata”, a dictionary where the keys are the metadata names and each value is a short definition of the corresponding metadatum.
A ObjectData instance follows dictionary semantics–i.e. metadata can be accessed via the bracket operator ([]) or the get() function. The key() function returns the metadata names that are present. For most of the metadata, the value will be either a string or a list of strings if more than one value is available (e.g. the alias metadatum). Exceptions are “Vel”, “z”, “mag”, and “plx”, which will be of a DocQuantity type, and “pm”, which will be of a VecQuantity type.
Some important metadata are made available as attributes. This includes “pos”, the decimal J2000 position converted to a 2-elment tuple of floats. It also includes “sexapos”, the sexagesimal-formatted J2000 position (as a single string), and “oname”, the primary name for the target. If aliases were requested, the “aliases” attribute will contain the list of names the object is also known as.
Wrap sn XML Target element
Attributes Summary
aliases
the list of other names the object is known as. This will be an fromcache
a boolean indicating as to whether this represents cached information metadata
oname
pos
the decimal J2000 position as a 2-element tuple giving resolver_name
the name of the resolver that produced this information sexapos
the sexagismal formatted position returned by the resolver success
a boolean whether the name was successfully matched (i.e. resolved). Methods Summary
get
(name[, defval])return the target metadata with the given name. The result will getpos
()return the decimal J2000 position as a 2-element tuple giving keys
()return the names of the target metadata that are available from Attributes Documentation
-
aliases
¶ the list of other names the object is known as. This will be an empty list if none were returned
-
fromcache
¶ a boolean indicating as to whether this represents cached information
-
metadata
= {'INFO': 'status message from resolver', 'ERROR': 'error message', 'oid': 'database-internal object identifier', 'otype': 'object type code', 'jpos': 'sexagesimal-formatted J2000 position', 'jradeg': 'J2000 decimal right ascension', 'jdedeg': 'J2000 decimal declination', 'refPos': 'bibcode of reference defining the position', 'errRAmas': 'milliarcsecond positional error in right ascension', 'errDEmas': 'milliarcsecond positional error in declination', 'pm': 'proper motion', 'MType': 'galaxy classification code', 'spType': '', 'spNum': '', 'Vel': 'recessional velocity', 'z': 'redshift', 'mag': '', 'plx': 'paralax', 'oname': 'primary name within the resolver database', 'alias': 'secondary name', 'nrefs': 'number of literature references consulted for target'}¶
-
oname
¶
-
pos
¶ the decimal J2000 position as a 2-element tuple giving right ascension and declination. If None, a valid position was not returned from the resolver. This differs form getpos() in that accessing will not raise an exception.
-
resolver_name
¶ the name of the resolver that produced this information
-
sexapos
¶ the sexagismal formatted position returned by the resolver
-
success
¶ a boolean whether the name was successfully matched (i.e. resolved). False indicates that the source name is not found in the resolver’s database.
Methods Documentation
-
get
(name, defval=None)[source]¶ return the target metadata with the given name. The result will either be a string or a list of strings, depending on whether multiple values were returned with that name. If the name is “alias”, the response will always be a list.
The possible names that can be returned are
-