Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This script scans a simulated motor, aquiring one or more events at each equally spaced position.

Software Dependencies

As shown in the dependency graph below, bluesky scripts depend on four external Python packages: numpy, ophyd, bluesky, and zmq.

Image Added

Command Line Arguments

Code Block
languagetext
title'lab3_bluesky_scan.py -h' output
collapsetrue
$ python psdaq/psdaq/control/lab3_bluesky_scan.py -h

usage: lab3_bluesky_scan.py [-h] [-p {0,1,2,3,4,5,6,7}] [-C COLLECT_HOST]
                            [-t TIMEOUT] [-c READOUT_COUNT] [-g GROUP_MASK]
                            [--config ALIAS] [--detname DETNAME]
                            [--scantype SCANTYPE] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -p {0,1,2,3,4,5,6,7}  platform (default 1)
  -C COLLECT_HOST       collection host (default drp-tst-dev009)
  -t TIMEOUT            timeout msec (default 10000)
  -c READOUT_COUNT      # of events to aquire at each step (default 10)
  -g GROUP_MASK         bit mask of readout groups (default 2)
  --config ALIAS        configuration alias (default BEAM)
  --detname DETNAME     detector name (default 'scan')
  --scantype SCANTYPE   scan type (default 'scan')
  -v                    be verbose

Experiment

...

tstx0017 run

...

240

Code Block
languagetext
$ python psdaq/psdaq/control/lab3_bluesky_scan.py -c 2 --detname FishJetsam --scantype ChipsFlotsam

Transient Scan ID: 1     Time: 2021-0407-2015 1114:3601:5954
Persistent Unique Scan ID: '9139bc22a99547e3-680bfec5-46b94971-bc3f8bed-7a941a8ab7c412a1a3ec23f1'
New stream: 'primary'
+-----------+------------+------------+------------+
|   seq_num |       time |     motor1 | step_value |
+-----------+------------+------------+------------+
|         1 | 1114:3701:0359.03 |    -10.000 |      0.000 |
|         2 | 1114:3701:0359.36 |     -8.571 |      1.000 |
|         3 | 1114:3701:0359.69 |     -7.143 |      2.000 |
|         4 | 1114:3702:0300.92 |     -5.714 |      3.000 |
|         5 | 1114:3702:0400.25 |     -4.286 |      4.000 |
|         6 | 1114:3702:0400.58 |     -2.857 |      5.000 |
|         7 | 1114:3702:0401.81 |     -1.429 |      6.000 |
|         8 | 1114:3702:0501.14 |      0.000 |      7.000 |
|         9 | 1114:3702:0501.37 |      1.429 |      8.000 |
|        10 | 1114:3702:0502.60 |      2.857 |      9.000 |
|        11 | 1114:3702:0502.92 |      4.286 |     10.000 |
|        12 | 1114:3702:0602.25 |      5.714 |     11.000 |
|        13 | 1114:3702:0602.58 |      7.143 |     12.000 |
|        14 | 1114:3702:0603.81 |      8.571 |     13.000 |
|        15 | 1114:3702:0703.14 |     10.000 |     14.000 |
+-----------+------------+------------+------------+
generator scan ['9139bc22a99547e3'] (scan num: 1)
Code Block
languagetext
title'xtcreader -d' output
collapsetrue
$ xtcreader$ xtcreader -d -f /cds/home/c/caf/data/tst/tstx00217/xtc/tstx00217-r0208r0240-s001-c000.xtc2 | grep step_
Name: 'step_value' Type: 7 Rank: 0
Name: 'step_docstring' Type: 10 Rank: 1
0: 'step_value' rank 0, type 7
'step_value': 1
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 1}"
0: 'step_value' rank 0, type 7
'step_value': 2
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 2}"
0: 'step_value' rank 0, type 7
'step_value': 3
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 3}"
0: 'step_value' rank 0, type 7
'step_value': 4
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 4}"
0: 'step_value' rank 0, type 7
'step_value': 5
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 5}"
0: 'step_value' rank 0, type 7
'step_value': 6
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 6}"
0: 'step_value' rank 0, type 7
'step_value': 7
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 7}"
0: 'step_value' rank 0, type 7
'step_value': 8
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 8}"
0: 'step_value' rank 0, type 7
'step_value': 9
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 9}"
0: 'step_value' rank 0, type 7
'step_value': 10
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 10}"
0: 'step_value' rank 0, type 7
'step_value': 11
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 11}"
0: 'step_value' rank 0, type 7
'step_value': 12
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 12}"
0: 'step_value' rank 0, type 7
'step_value': 13
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 13}"
0: 'step_value' rank 0, type 7
'step_value': 14
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 14}"
0: 'step_value' rank 0, type 7
'step_value': 15
1: 'step_docstring' rank 1, type 10
'step_docstring': "{"detname": "Jetsam", "scantype": "Flotsam", "step": 15}"