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.

Command Line Arguments

'lab3_bluesky_scan.py -h' output
$ 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

$ python psdaq/psdaq/control/lab3_bluesky_scan.py -c 2 --detname Jetsam --scantype Flotsam

Transient Scan ID: 1     Time: 2021-07-15 14:01:54
Persistent Unique Scan ID: 'a99547e3-fec5-4971-8bed-12a1a3ec23f1'
New stream: 'primary'
+-----------+------------+------------+
|   seq_num |       time |     motor1 |
+-----------+------------+------------+
|         1 | 14:01:59.3 |    -10.000 |
|         2 | 14:01:59.6 |     -8.571 |
|         3 | 14:01:59.9 |     -7.143 |
|         4 | 14:02:00.2 |     -5.714 |
|         5 | 14:02:00.5 |     -4.286 |
|         6 | 14:02:00.8 |     -2.857 |
|         7 | 14:02:01.1 |     -1.429 |
|         8 | 14:02:01.4 |      0.000 |
|         9 | 14:02:01.7 |      1.429 |
|        10 | 14:02:02.0 |      2.857 |
|        11 | 14:02:02.2 |      4.286 |
|        12 | 14:02:02.5 |      5.714 |
|        13 | 14:02:02.8 |      7.143 |
|        14 | 14:02:03.1 |      8.571 |
|        15 | 14:02:03.4 |     10.000 |
+-----------+------------+------------+
generator scan ['a99547e3'] (scan num: 1)
'xtcreader -d' output
$ xtcreader -d -f /cds/home/c/caf/data/tst/tstx00217/xtc/tstx00217-r0240-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}"



  • No labels