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 Jetsam --scantype Flotsam

Transient Scan ID: 1     Time: 2021-0407-1915 2314:5101:2954
Persistent Unique Scan ID: 'eec76443a99547e3-6deafec5-4e164971-b3ca8bed-e11b6bef8f6812a1a3ec23f1'
New stream: 'primary'
+-----------+------------+------------+------------+
|   seq_num |       time |     motor1 | step_value |
+-----------+------------+------------+------------+
|         1 | 2314:5101:3259.93 |    -10.000 |      0.000 |
|         2 | 2314:5101:3359.26 |     -8.571 |      1.000 |
|         3 | 2314:5101:3359.59 |     -7.143 |      2.000 |
|         4 | 2314:5102:3300.82 |     -5.714 |      3.000 |
|         5 | 2314:5102:3400.15 |     -4.286 |      4.000 |
|         6 | 2314:5102:3400.38 |     -2.857 |      5.000 |
|         7 | 2314:5102:3401.61 |     -1.429 |      6.000 |
|         8 | 2314:5102:3401.94 |      0.000 |      7.000 |
|         9 | 2314:5102:3501.27 |      1.429 |      8.000 |
|        10 | 2314:5102:3502.50 |      2.857 |      9.000 |
|        11 | 2314:5102:3502.82 |      4.286 |     10.000 |
|        12 | 2314:5102:3602.15 |      5.714 |     11.000 |
|        13 | 2314:5102:3602.48 |      7.143 |     12.000 |
|        14 | 2314:5102:3603.71 |      8.571 |     13.000 |
|        15 | 2314:5102:3703.04 |     10.000 |     14.000 |
+-----------+------------+------------+------------+
generator scan ['eec76443a99547e3'] (scan num: 1)
Code Block
languagetext
title'xtcreader -d' output
collapsetrue
$ 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}"