coerce_range_list_param, frames=None, numeric=True)[source] [edit on github]

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.

p : str 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
frames : sequence of str, optional

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

numeric : bool, optional


parts : tuple
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