silx icon indicating copy to clipboard operation
silx copied to clipboard

[spech5] Raise Warning instead of Error when discrepancy with motors positions (as PyMca)

Open maurov opened this issue 5 years ago • 0 comments

@payno, @vasole, follow-up of a discussion on the mailing list entitled: Cannot read a Spec file that is correctly read by Pymca.

A well known problem with SPEC files is that the motors positions in a scan (values in #P lines) may differ from the header (names in #O lines). This is happening when the configuration of SPEC is changed (adding motors for instance) and a newfile is not called afterwards.

PyMca does not ignore the problem. It only reports it when the information is accessed. For instance, when trying to show the scan header of the last scan, it reports "Incorrect number of labels or values". This allows the user to access the valid content of the SPEC file and use good counters or motors positions.

Currently, in silx.io.spech5 the motor_value = scan.motor_position_by_name(motor_name) call triggers a SfErrColNotFound error, interrupting reading the whole file.

The expected behaviour from a user point of view is as PyMca does: raise a warning on the incorrect number of labels or values, without interruption on the whole file reading.

maurov avatar Oct 19 '19 06:10 maurov