coerce_range_list_param#

astropy.io.votable.util.coerce_range_list_param(p, frames=None, numeric=True)[source]#

Coerces and/or verifies the object p into a valid range-list-format parameter.

As defined in Section 8.7.2 of Simple Spectral Access Protocol.

Parameters:
pstr or sequence

May be a string as passed verbatim to the service expecting a range-list, or a sequence. If a sequence, each item must be either:

  • a numeric value

  • a named value, such as, for example, ā€˜Jā€™ for named spectrum (if the numeric kwarg is False)

  • a 2-tuple indicating a range

  • the last item my be a string indicating the frame of reference

framessequence of str, optional

A sequence of acceptable frame of reference keywords. If not provided, the default set in set_reference_frames will be used.

numericbool, optional

TODO

Returns:
partstuple
The result is a tuple:
  • a string suitable for passing to a service as a range-list argument

  • an integer counting the number of elements