Versions Compared

Key

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

...

An example hutch-python scan session in RIX:.  "rix3" also takes a "--debug" option to increase verbosity.  TMO has a similar "tmo3" command.

Code Block
rix-daq:~> rix3
Loading local disk python env pcds-4.1.4
      _      _____       _   _                 
     (_)    |  __ \     | | | |                
 _ __ ___  _| |__) |   _| |_| |__   ___  _ __  
| '__| \ \/ /  ___/ | | | __| '_ \ / _ \| '_ \ 
| |  | |>  <| |   | |_| | |_| | | | (_) | | | |
|_|  |_/_/\_\_|    \__, |\__|_| |_|\___/|_| |_|
                    __/ |                      
                   |___/                       

INFO     Selected default hutch-python daq platform: 0
INFO     Loading debug tools...

(lines removed for brevity)

In [1]: daq = get_daq() # in tmo this requires a "bluesky=True" kwarg

In [2]: dets = [daq]

In [3]: daq.configure(motors=[sim.fast_motor1, sim.fast_motor2])
INFO     configure.configure(motors=[sim.fast_motor1, sim.fast_motor2],events=10,record=True)
INFO     configure - configure: 2 motors
Out[31]: ({}, {})

In [42]: RE(bp.scan(dets[daq], sim.fast_motor1, 1, 10, sim.fast_motor2, 1, 10, 5))


Transient Scan ID: 1     Time: 2021-0710-0720 1712:0006:3021
Persistent Unique Scan ID: 'e1a966bd81544aea-c12d5fb7-429d4017-95edb03d-ea73f7dd7211a1ea8d15c174'
New stream: 'primary'
+-----------+------------+-------------+-------------+
|   seq_num |       time | fast_motor1 | fast_motor2 |
+-----------+------------+-------------+-------------+
|         1 | 1712:0006:4633.3 |           1 |           1 |
|         2 | 1712:0006:5934.14 |        3.25 |        3.25 |
|         3 | 1712:0106:0835.35 |         5.5 |         5.5 |
|         4 | 1712:0106:1836.36 |        7.75 |        7.75 |
|         5 | 1712:0106:2837.37 |          10 |          10 |
+-----------+------------+-------------+-------------+
generator scan ['e1a966bd81544aea'] (scan num: 1)



Out[42]: ('e1a966bd81544aea-c12d5fb7-429d4017-95edb03d-ea73f7dd7211a1ea8d15c174',)

In [5]: daq.push_socket.send_string('shutdown')

In [6]: daq.comm_thread.join()

In [73]: quit
rix-daq:~>control>  

If the "shutdown" and "join" commands are not issued then the "quit" command will hang, and you will have to control-C to end the program.

Arguments to get_daq() in rix (these are set by modifying daq.args.<attribute>, e.g. daq.args.cThese are the parameters that are settable in daq.configure (see these with "daq.configure?" in hutch-python):

Code Block
def get_daq()Signature:
daq.configure(
    #*,
 Construct the args thatmotors=None,
 DaqScan is looking for group_mask=None,
    args = SimpleNamespace(events=None,
    record=None,
    C='drp-neh-ctl001', # DRP host for controldetname=None,
    scantype=None,
        v=True,serial_number=None,
    alg_name=None,
    alg_version=None,
)
Docstring:
Set parameters for   # Verbosity
        B='DAQ:NEH',        # PV Base
        detname='scan',     # Detector name
        scantype='scan',    # scan type
        g=36,               # Bit mask of readout groups
        c=10,               # Events per step
        p=2,                # Platform
        x=0,                # Master XPM
        t=1000,             # Connection timeout
        )scan.

Keyword arguments:
motors -- list of motors, optional
    Motors with positions to include in the data stream
group_mask -- int, optional
    Bit mask of readout groups
motors -- list of motors, optional
    Motors with positions to include in the data stream
group_mask -- int, optional
    Bit mask of readout groups
events -- int, optional
    Number of events per scan point
record -- bool, optional
    Enable recording of data
detname -- str, optional
    Detector name
scantype -- str, optional
    Scan type
serial_number -- str, optional
    Serial number
alg_name -- str, optional
    Algorithm name
alg_version -- list of 3 version numbers, optional
    Algorithm version
File:      /u1/rixopr/conda_envs/pcds-5.0.0/lib/python3.9/site-packages/psdaq/control/BlueskyScan.py
Type:      method

Other hutch-python parameters are settable in this per-hutch configuration file:

Code Block
rix-daq:control> more /cds/group/pcds/pyps/apps/hutch-python/rix/conf.yml 
hutch: rix

# Locate happi database
db: /reg/g/pcds/pyps/apps/hutch-python/device_config/db.json

# Hutch-specific imports
load: rix.beamline

# DAQ interface configuration
daq_type: lcls2

daq_host: drp-neh-ctl001

daq_platform:
  default: 2
rix-daq:control>