{"action":"created","issue":{"url":"https://api.github.com/repos/NSLS-II/bluesky/issues/490","repository_url":"https://api.github.com/repos/NSLS-II/bluesky","labels_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/490/labels{/name}","comments_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/490/comments","events_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/490/events","html_url":"https://github.com/NSLS-II/bluesky/issues/490","id":160044279,"number":490,"title":"question: how to record a calculated data field/signal based on other signals in each event?","user":{"login":"imrealkaren","id":6539127,"avatar_url":"https://avatars.githubusercontent.com/u/6539127?v=3","gravatar_id":"","url":"https://api.github.com/users/imrealkaren","html_url":"https://github.com/imrealkaren","followers_url":"https://api.github.com/users/imrealkaren/followers","following_url":"https://api.github.com/users/imrealkaren/following{/other_user}","gists_url":"https://api.github.com/users/imrealkaren/gists{/gist_id}","starred_url":"https://api.github.com/users/imrealkaren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imrealkaren/subscriptions","organizations_url":"https://api.github.com/users/imrealkaren/orgs","repos_url":"https://api.github.com/users/imrealkaren/repos","events_url":"https://api.github.com/users/imrealkaren/events{/privacy}","received_events_url":"https://api.github.com/users/imrealkaren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-13T21:02:43Z","updated_at":"2016-06-13T22:45:19Z","closed_at":null,"body":"How do we record a data field/signal that is a calculated value based other signals (motor positions)?\r\n\r\nE.g. in our tomography, I'd like to record a field/signal called 'horizontal position', which is a combination of x and z motor positions, depending on the angle, something roughly look like:\r\nh_pos = x_pos\\*cos(theta_pos) + z_pos\\*sin(theta_pos) + .. (with some constant correction)\r\n\r\nThe goal is to be able to access the h_pos using get_table, get_event easily.\r\nAdditionally, can this h_pos be used as the horizontal axis in the live_raster callback?\r\n\r\nUltimately having a pseudo axis is ideal but being able to test it first is helpful."},"comment":{"url":"https://api.github.com/repos/NSLS-II/bluesky/issues/comments/225731027","html_url":"https://github.com/NSLS-II/bluesky/issues/490#issuecomment-225731027","issue_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/490","id":225731027,"user":{"login":"klauer","id":5139267,"avatar_url":"https://avatars.githubusercontent.com/u/5139267?v=3","gravatar_id":"","url":"https://api.github.com/users/klauer","html_url":"https://github.com/klauer","followers_url":"https://api.github.com/users/klauer/followers","following_url":"https://api.github.com/users/klauer/following{/other_user}","gists_url":"https://api.github.com/users/klauer/gists{/gist_id}","starred_url":"https://api.github.com/users/klauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klauer/subscriptions","organizations_url":"https://api.github.com/users/klauer/orgs","repos_url":"https://api.github.com/users/klauer/repos","events_url":"https://api.github.com/users/klauer/events{/privacy}","received_events_url":"https://api.github.com/users/klauer/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T22:45:19Z","updated_at":"2016-06-13T22:45:19Z","body":"Something similar to [this](https://github.com/NSLS-II-HXN/ipython_ophyd/blob/master/profile_collection/startup/15-zp.py#L106) could be implemented rather easily. It has x- and z- pseudo axes, which correspond to two real x- and z- axes with a rotary stage (`zpsth`) underneath. `theta0` is a soft signal - a user-configurable offset in case calibration is necessary.\r\n\r\nYou could then call `pos.forward()` and `pos.reverse()` to just run the calculations and not move any physical motors. Alternatively, a mock `PseudoPositioner` with `SoftPositioner`s in place of the real `EpicsMotors` could allow you to test it directly in scans.\r\n\r\nRecording those parameters is as easy as any other `Device` - adding either `configuration_attrs` or `read_attrs`."}}
{"actor":{"display_login":"klauer"}}