IndexedFilteredEssFieldWrapper

class lsst.ts.watcher.IndexedFilteredEssFieldWrapper(model, topic, sensor_name, field_name, indices)

Bases: FilteredEssFieldWrapper

A filtered field wrapper for an array field, with metadata indicating indices of interest.

FieldWrapperList provides a useful way to extract the elements of interest.

Parameters:
modelModel

Watcher model.

topiclsst.ts.salobj.ReadTopic

Topic to read.

sensor_namestr

Required value of the sensorName field.

field_namestr

Name of field to read. The field must be an array.

scalar_descrstr

Brief description of the field.

indiceslist [int]

Indices of interest. Negative indices are not supported, so each index must be in range 0 <= index < self.nelts. This is metadata, for use by FieldWrapperList; the value attribute contains all elements, just like FilteredEssFieldWrapper.

Notes

If you specify indices that are not actually connected to sensors then the value will always be nan and so never used. There is no warning because the number of connected sensors is not known when the wrapper is constructed.

Methods Summary

get_value_descr(index)

Get a description for a value.

update_value(data)

Set value from DDS data.

Methods Documentation

get_value_descr(index)

Get a description for a value.

Parameters:
indexint or None

The index of the value; must be None for a scalar, and an int for an array.

Raises:
ValueError

If the field is indexed and the index is None or out of range. If the field is not indexed and the index is not None.

update_value(data)

Set value from DDS data.

Do not set the timestamp field, and do not check that getattr(data, filter_field) == self.filter_value; both of these are done by the caller: FilteredTopicWrapper.__call__.