Spectral

class pyvo.registry.Spectral(spec)[source]

Bases: pyvo.registry.rtcons.Constraint

A RegTAP constraint on the spectral coverage of resources.

This is a RegTAP 1.2 extension not yet available on all Registries (in 2022). Worse, not too many resources bother declaring this at this point. For robustness, it might be preferable to use the Waveband constraint for the time being..

This constraint accepts quantities, i.e., values with units, and will convert them to RegTAP’s representation (which is Joule of particle energy) if it can. This ought to work for wavelengths, frequencies, and energies. Plain numbers are interpreted as particle energies in Joule.

RegTAP uses the observer frame at the solar system barycenter, but it is probably wise to use constraints suitably relaxed such that frame and reference position (within reason) do not matter.

To find resources covering the messenger particle energy 5 eV:

>>> registry.Spectral(5*units.eV)

To find resources overlapping the band between 5000 and 6000 Ångström:

>>> registry.Spectral((5000*units.Angstrom, 6000*units.Angstrom))

To find resources having data in the FM band:

>>> registry.Spectral((88*units.MHz, 102*units.MHz))
Parameters
specastropy.Quantity or a 2-tuple of astropy.Quantity-s

A spectral point or interval to cover. This must be a wavelength, a frequency, or an energy, or a pair of such quantities, in which case the argument is interpreted as an interval. All resources overlapping the interval are returned.

Attributes Summary

takes_sequence

Attributes Documentation

takes_sequence = True