ufo-kit/concert — pull request #336 by tomago (2014-10-13 12:19:23+00:00)
Title: Improve scan

Summary
-------------
* `Selection` parameter is scannable
* User has full control of what the x-values look like in a scan
* User can attach callbacks executed after certain parameter is changed in a scan (this was an actual user request) - helpful e.g. in long scans when one wants a flat field after some time and so on
* Travis is happy again

Example
-----------
Running this

```python
exp_region = Region(camera['exposure_time'], np.linspace(1, 100, 2) * q.ms)
pos_region = Region(motor['position'], np.linspace(2, 4, 3) * q.mm)

def feedback():
pass

def callback_exp():
print 'Exposure callback: {}'.format(camera.exposure_time)

def callback_pos():
print 'Position callback: {}'.format(motor.position)

callbacks = {exp_region: callback_exp, pos_region: callback_pos}
for future in scan(feedback, [exp_region, pos_region], callbacks=callbacks):
pass
```

gives you
```
Exposure callback: 0.001 second
Position callback: 2.0 millimeter
Position callback: 3.0 millimeter
Position callback: 4.0 millimeter
Exposure callback: 0.1 second
Position callback: 2.0 millimeter
Position callback: 3.0 millimeter
Position callback: 4.0 millimeter
```