YEP: | 311 |
---|---|
Title: | has-mapping |
Authors: | Blaise Thompson |
Status: | draft |
Tags: | trait |
Post-History: | 2020-10-29 |
This YEP defines the concept of "mapping" arrays. These arrays add additional "context" to the channel arrays defined by is-sensor (YEP-302). For example, a mapping might describe which wavelength of light falls upon each pixel of a spectrometer array detector.
Certain sensors contain important information beyond their raw values. Consider an array-sensor within an optical spectrometer. Such an array detector could be implemented according to the is-sensor trait (YEP-302), with a channel for the measured light intensity at each pixel. To use this information, however, clients must also know the relationship between pixel index and light wavelength: the "mapping" of the array detector. This YEP defines a trait which allows daemons to expose mapping information over a consistent interface.
This trait requires is-sensor (YEP-302).
This trait implements mappings as a collection of arrays completely separate from channels.
The principle feature of this trait is the new message get_mappings
.
response: {"type": "map", "values": {"type": "array", "items": "string"}}
Keys being channel names. Values array of keys from get_mappings. Can be many mappings per channel, or no mappings for a given channel (empty array).
Mappings must have the same dimensionality as their associated channel. Do not need to be the same size. They must broadcast into their associated channel.
response: int
Mapping ID. This integer increments every time the mapping is updated. Clients can safely check this id to verify that their cached mappings are correct, if desired.
response: {"type": "map", "values": ["null", "string"]}
Must return units for every mapping. Units can be null.
response: {"type": "map", "values": ["double", "ndarray", "int"]}
Keys used in get_channel_mappings
At one point in yaq development, mappings were included simply as additional channels. While elegantly simple, this idea proved insufficient.
This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive.
built 2023-10-10 23:52:42 CC0: no copyright