scan_info and Multiple -Top-Master scans
As implemented today scan_info
does not cope fully with Multiple-Top-Master scans. This issue is the result of discussion with @valentin.valls and @denolf.
From what I can see the problem arises from the fact that scan_info
is not fully populated by introspection of the acquisition chain as the scan_info['acquisition_chain']
entry suggest but also at other places.
Here is an example where there is not much found in scan_info...
TEST_SESSION [1]: from pprint import pprint
...: from bliss.scanning.chain import AcquisitionChain
...: from bliss.scanning.scan import Scan
TEST_SESSION [2]: chain = AcquisitionChain()
...: diode.mode='SAMPLES'
...: l=loopscan(50,.05,sim_ct_gauss,run=False)
...: m=amesh(roby,0,1,5,robz,0,1,5,.1,diode,run=False)
...: chain.append(l.acq_chain)
...: chain.nodes_list[0].terminator = False
...: chain.append(m.acq_chain)
...: scan = Scan(chain, "test")
acquisition chain
├── axis
│ └── timer
│ └── diode
└── timer
└── sim_ct_gauss
TEST_SESSION [3]: scan.run()
this leads to the following scan_info:
{'acquisition_chain': {'axis': {'display_names': {'diode:diode': 'diode',
'diode:diode_samples': 'diode_samples',
'timer:elapsed_time': 'elapsed_time',
'timer:epoch': 'epoch'},
'images': [],
'master': {'display_names': {'axis:roby': 'roby',
'axis:robz': 'robz'},
'images': [],
'scalars': ['axis:roby',
'axis:robz'],
'scalars_units': {'axis:roby': None,
'axis:robz': 'mm'},
'spectra': []},
'scalars': ['timer:elapsed_time',
'timer:epoch',
'diode:diode'],
'scalars_units': {'diode:diode': None,
'diode:diode_samples': None,
'timer:elapsed_time': 's',
'timer:epoch': 's'},
'spectra': ['diode:diode_samples']},
'timer': {'display_names': {'sim_ct_gauss:sim_ct_gauss': 'sim_ct_gauss'},
'images': [],
'master': {'display_names': {'timer:elapsed_time': 'elapsed_time',
'timer:epoch': 'epoch'},
'images': [],
'scalars': ['timer:elapsed_time',
'timer:epoch'],
'scalars_units': {'timer:elapsed_time': 's',
'timer:epoch': 's'},
'spectra': []},
'scalars': ['sim_ct_gauss:sim_ct_gauss'],
'scalars_units': {'sim_ct_gauss:sim_ct_gauss': None},
'spectra': []}},
'filename': '/tmp/scans/test_session/data.h5',
'instrument': {'positioners': {...}, #shortend here
'positioners_dial': {...}},#shortend here
'node_name': 'test_session:tmp:scans:27_test',
'proposal': {'NX_class': 'NXcollection'},
'sample': {'NX_class': 'NXsample'},
'sample_description': {'NX_class': 'NXcollection'},
'save': True,
'scan_meta_categories': ['sample',
'proposal',
'sample_description',
'technique'],
'scan_nb': 27,
'session_name': 'test_session',
'start_time': datetime.datetime(2019, 8, 8, 16, 26, 51, 600168),
'start_time_str': 'Thu Aug 08 16:26:51 2019',
'start_timestamp': 1565274411.6001678,
'technique': {'NX_class': 'NXcollection'},
'title': 'test',
'user_name': 'pithan'}
as we can see, there are no entries like
- 'data_dim'
- 'npoints'
- 'npoints1'
- 'npoints2'
- 'start'
- 'stop'
now there are two approaches
- It should be the responsibility of the person creating the chain to fill
scan_info
correctly, but it will be difficult to define what is correct here... - Is there any smart way to populate scan_info automatically?
maybe it would be good to see what information @valentin.valls or @denolf would expect to see here (the pure minimum in order to work) as a first step to approach this problem.