BCDA-APS / bdp_controls

APS-U Beam line Data Pipelines - experiment controls with EPICS and Bluesky
Other
0 stars 1 forks source link

create bluesky instrument package for BDP controls #4

Closed prjemian closed 2 years ago

prjemian commented 2 years ago

Start with template instrument from APS bluesky training repository.

Need support for:

Addition

Not really part of bluesky, but shows local pipeline.

prjemian commented 2 years ago

Devices

In [26]: listobjects()
============= ================================ ============ =============
name          ophyd structure                  EPICS PV     label(s)     
============= ================================ ============ =============
adsimdet      MySimDetector                    ad:          area_detector
aps           ApsMachineParametersDevice                                 
coarse_xy     XYstage_Coarse                                stage        
fine_xy       XYstage_Fine                                  stage        
gp_stats      IocInfoDevice                    gp:                       
incident_beam EpicsSignalRO                    gp:userCalc2 simulator    
shutter       SimulatedApsPssShutterWithStatus              shutters     
============= ================================ ============ =============
prjemian commented 2 years ago

shutter open

shutter_open

shutter closed

shutter_close

shutter closed (autoscale image to show background noise)

shutter_close_autoscale

prjemian commented 2 years ago

plans

plan arguments docstring
close_shutter () Close the (simulated) shutter.
move_coarse_positioner x, y Move the coarse_xy positioner, only to new positions.
move_fine_positioner x, y Move the fine_xy positioner, only to new positions.
open_shutter () Open the (simulated) shutter.
take_image coarse, fine Take one image with the area detector.
prjemian commented 2 years ago
  1. Find the HDF5 image file (from most recent run) on local storage:

    In [11]: cat[-1].primary._get_resources()
    Out[20]: 
    [{'spec': 'AD_HDF5',
    'root': '/',
    'resource_path': 'tmp/docker_ioc/iocad/tmp/adsimdet/2022/03/19/ba5b0a21-832f-4ecf-b178_000.h5',
    'resource_kwargs': {'frame_per_point': 1},
    'path_semantics': 'posix',
    'uid': '64311a08-fd4b-4963-a7f0-ebc04bfdab3c',
    'run_start': '35a8d7bd-f3eb-4ea4-bc12-997fad9ab1db'}]

The HDF5 file is named: /tmp/docker_ioc/iocad/tmp/adsimdet/2022/03/19/ba5b0a21-832f-4ecf-b178_000.h5

Note that the image file name is a uuid that does not match the run's uuid.

NeXpy is a good viewer for NeXus HDF5 files (such as this). Here's a view of the image in this file: image viewed in NeXpy