TimeSeriesList

class gwpy.timeseries.TimeSeriesList(*items)[source]

Fancy list representing a list of TimeSeries

The TimeSeriesList provides an easy way to collect and organise TimeSeries for a single Channel over multiple segments.

Parameters
*items

any number of TimeSeries

Returns
list

a new TimeSeriesList

Raises
TypeError

if any elements are not TimeSeries

Attributes Summary

segments

The span of each series in this list

Methods Summary

append(item)

Append object to the end of the list.

clear(/)

Remove all items from list.

coalesce()

Merge contiguous elements of this list into single objects

copy()

Return a copy of this list with each element copied to new memory

count(value, /)

Return number of occurrences of value.

extend(item)

Extend list by appending elements from the iterable.

index(value[, start, stop])

Return first index of value.

insert(index, object, /)

Insert object before index.

join([pad, gap])

Concatenate all of the elements of this list into a single object

pop([index])

Remove and return item at index (default last).

remove(value, /)

Remove first occurrence of value.

reverse(/)

Reverse IN PLACE.

sort(*[, key, reverse])

Sort the list in ascending order and return None.

Attributes Documentation

segments

The span of each series in this list

Methods Documentation

append(item)[source]

Append object to the end of the list.

clear(/)

Remove all items from list.

coalesce()[source]

Merge contiguous elements of this list into single objects

This method implicitly sorts and potentially shortens this list.

copy()[source]

Return a copy of this list with each element copied to new memory

count(value, /)

Return number of occurrences of value.

extend(item)[source]

Extend list by appending elements from the iterable.

index(value, start=0, stop=sys.maxsize, /)

Return first index of value.

Raises ValueError if the value is not present.

insert(index, object, /)

Insert object before index.

join(pad=None, gap=None)[source]

Concatenate all of the elements of this list into a single object

Parameters
padfloat, optional

value with which to fill gaps in the source data, by default gaps will result in a ValueError.

gapstr, optional, default: 'raise'

what to do if there are gaps in the data, one of

  • 'raise' - raise a ValueError

  • 'ignore' - remove gap and join data

  • 'pad' - pad gap with zeros

If pad is given and is not None, the default is 'pad', otherwise 'raise'.

Returns
seriesgwpy.types.TimeSeriesBase subclass

a single series containing all data from each entry in this list

See also

TimeSeries.append

for details on how the individual series are concatenated together

pop(index=- 1, /)

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(value, /)

Remove first occurrence of value.

Raises ValueError if the value is not present.

reverse(/)

Reverse IN PLACE.

sort(*, key=None, reverse=False)

Sort the list in ascending order and return None.

The sort is in-place (i.e. the list itself is modified) and stable (i.e. the order of two equal elements is maintained).

If a key function is given, apply it once to each list item and sort them, ascending or descending, according to their function values.

The reverse flag can be set to sort in descending order.