BCDA-APS / bdp_controls

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

plan support for standard metadata #19

Closed prjemian closed 2 years ago

prjemian commented 2 years ago

Add support so that users do not have to provide common metadata with every plan. Need plans to manipulate and show the common metadata. (This would use the RE.md dictionary.)

prjemian commented 2 years ago

Really, this issue is about learning how to use the RunEngine in the queueserver.

prjemian commented 2 years ago

A related topic is the setup of baselines and monitors.

prjemian commented 2 years ago

Also related (directly): https://github.com/bluesky/bluesky-queueserver/issues/25

prjemian commented 2 years ago

The recommendation for the queueserver is to provide a RunEngine RE instance in all but the most trivial use cases. When providing RE, this advice:

  --keep-re         Keep RE created in profile collection. If the flag is set, RE must be
                    created in the profile collection for the plans to run. RE will also
                    keep all its subscriptions. Also must be subscribed to the Data Broker
                    inside the profile collection, since '--databroker-config' argument is
                    ignored.

Need to verify if a db (v1) instance must also be provided.

prjemian commented 2 years ago

Tested and found that it is not necessary to create an object named db for the catalog. Just require an object named RE for the bluesky.RunEngine instance.

prjemian commented 2 years ago

Now, the procedures to implement routine metadata, suspenders, baselines, and monitors are clear.

prjemian commented 2 years ago

Supporting supplementary data might be more of a challenge (the trick is to create and re-use the bluesky.SupplementaryData object).

prjemian commented 2 years ago

baseline from recent take_image() plan:

In [19]: cat[-1].baseline.read().to_pandas().T
Out[19]: 
time                                                                1.649185e+09                          1.649186e+09
aps_current                                                           101.906345                            101.890557
aps_lifetime                                                            9.138277                              9.064693
aps_aps_cycle                                                             2022-1                                2022-1
aps_machine_status                                               USER OPERATIONS                       USER OPERATIONS
aps_operating_mode                                                Delivered Beam                        Delivered Beam
aps_shutter_permit                                                        PERMIT                                PERMIT
aps_fill_number                                                             34.0                                  34.0
aps_orbit_correction                                                         0.0                                   0.0
aps_global_feedback                                                           On                                    On
aps_global_feedback_h                                                         On                                    On
aps_global_feedback_v                                                         On                                    On
aps_operator_messages_operators                                    Smith, Kimbro                         Smith, Kimbro
aps_operator_messages_floor_coordinator                             MCR (2-0101)                          MCR (2-0101)
aps_operator_messages_fill_pattern                                        0+24x1                                0+24x1
aps_operator_messages_last_problem_message                                                                            
aps_operator_messages_last_trip_message                                                                               
aps_operator_messages_message6                         User beam on 4/5 at 08:00             User beam on 4/5 at 08:00
aps_operator_messages_message7              Linac/PAR: Power out til 5/19 ~22:00  Linac/PAR: Power out til 5/19 ~22:00
aps_operator_messages_message8                Booster: Power out til 5/19 ~22:00    Booster: Power out til 5/19 ~22:00
prjemian commented 2 years ago

List of plans (now)

RunEngine metadata

================== =============================================
key                value                                        
================== =============================================
beamline_id        BDP                                          
databroker_catalog bdp2022                                      
instrument_name    APS-U Beamline Data Pipelines project in 2022
login_id           jemian@wow.xray.aps.anl.gov                  
pid                22313                                        
proposal_id        bdp2022                                      
versions           =================== ========                 
                   key                 value                    
                   =================== ========                 
                   apstools            1.6.1                    
                   bluesky             1.8.2                    
                   bluesky_queueserver 0.0.12                   
                   databroker          1.2.5                    
                   epics               3.5.0                    
                   h5py                3.6.0                    
                   matplotlib          3.5.1                    
                   numpy               1.21.2                   
                   ophyd               1.6.3                    
                   pyRestTable         2020.0.3                 
                   spec2nexus          2021.2.0                 
                   =================== ========                                            
================== =============================================