Commit 0f891824 authored by Blaise Thompson's avatar Blaise Thompson

checkpoint

parent 1d2292cc
......@@ -4,16 +4,14 @@ title: has-mapping
author: Blaise Thompson <blaise@untzag.com>
status: draft
tags: trait
post-history: 2020-10-27
post-history: 2020-10-29
---
# Abstract
Certain sensors contain important information beyond their raw values.
Consider an array-sensor within an optical [spectrometer](https://en.wikipedia.org/wiki/Spectrometer).
Such an array detector could be implemented according to the is-sensor trait ([YEP-302](https://yeps.yaq.fyi/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.
This YEP defines the concept of "mapping" arrays.
These arrays add additional "context" to the channel arrays defined by is-sensor ([YEP-302](https://yeps.yaq.fyi/302/)).
For example, a mapping might describe which wavelength of light falls upon each pixel of a spectrometer array detector.
# Table of Contents
......@@ -21,10 +19,19 @@ This YEP defines a trait which allows daemons to expose mapping information.
# Motivation
Clients that wish to ensure that the mapping is correct should check mapping_params regularly.
Certain sensors contain important information beyond their raw values.
Consider an array-sensor within an optical [spectrometer](https://en.wikipedia.org/wiki/Spectrometer).
Such an array detector could be implemented according to the is-sensor trait ([YEP-302](https://yeps.yaq.fyi/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.
# Specification
This trait requires is-sensor ([YEP-302](https://yeps.yaq.fyi/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`.
## message: get_channel_mappings
response: {"type": "map", "values": {"type": "array", "items": "string"}}
......@@ -37,6 +44,12 @@ 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.
## message: get_mapping_id
response: int
Mapping ID.
## message: get_mapping_units
response: {"type": "map", "values": ["null", "string"]}
......@@ -45,7 +58,7 @@ Must return units for every mapping.
## message: get_mappings
response: {"type": "map", "values": ["double", "ndarray"]}
response: {"type": "map", "values": ["double", "ndarray", "int"]}
Keys used in get_channel_mappings
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment