Skip to content

WIP: ideas for a scan_info sekeleton

Linus Pithan requested to merge scan_info_design into master

ideas for a new scan_info structure to play with...

to generate the new scan_info structure in this branch use 'generate_scan_info_skeleton'


TEST_SESSION [1]: from bliss.data.scan_info import generate_scan_info_skeleton 
             ...: s=loopscan(1,.1,diode,run=False) 
             ...: si=generate_scan_info_skeleton(s)            
TEST_SESSION [2]: from bliss.data.scan_info import get_acq_tree,get_channels_by_chain,get_channels_by_controller,get_channels_
             ...: by_master_controller 
             ...: t=get_acq_tree(si) 
             ...: t.show()     
Acquisition
└── timer
    └── simulation_diode_sampling_controller

TEST_SESSION [3]: t.to_dict(with_data=True)                    
         Out [3]: {'Acquisition': {'children': [{'timer': {'children': [{'simulation_diode_sampling_controller': {'data': ['simulation_diode_sampling_controller:diode']}}], 'data': ['timer:elapsed_time', 'timer:epoch']}}], 'data': None}}

TEST_SESSION [4]: get_channels_by_chain(si)                    
         Out [4]: {'timer': ['timer:elapsed_time', 'timer:epoch', 'simulation_diode_sampling_controller:diode']}

the acq_chain part of scan_info would look like this:

TEST_SESSION [3]: pprint.pprint(si)                            
{'acq_devs': [{'acq_class': 'SoftwareTimerMaster',
               'aqc_name': 'timer',
               'tree_path': 'timer'},
              {'acq_class': 'SamplingCounterAcquisitionSlave',
               'aqc_name': 'simulation_diode_sampling_controller',
               'tree_path': 'timer:simulation_diode_sampling_controller'}],
 'chains': [{'top_master': 'timer'}],
 'channels': [{'dim': 0,
               'display_name': 'elapsed_time',
               'name': 'timer:elapsed_time',
               'tree_path': 'timer'},
              {'dim': 0,
               'display_name': 'epoch',
               'name': 'timer:epoch',
               'tree_path': 'timer'},
              {'controller': 'simulation_diode_sampling_controller',
               'dim': 0,
               'display_name': 'diode',
               'name': 'simulation_diode_sampling_controller:diode',
               'tree_path': 'timer:simulation_diode_sampling_controller'}],
 'controllers': [{'ctlr_class': 'SimulationDiodeController',
                  'ctlr_name': 'simulation_diode_sampling_controller'}]}
Edited by Valentin Valls

Merge request reports