evedata.evefile.controllers.info module

Information on measurements, often relevant for debugging purposes.

Measurements often contain a lot of relevant information beyond the pure data, such as the scan module structure of the scan as recreated from the saved scan description (SCML file). Getting easy access to this kind of information is particularly helpful if something went wrong or led to unexpected results.

The functionality provided in this module focuses primarily on users carrying out lower-level debug tasks, not normal end users who just want to work with their data, as well as on the developers of the evedata package themselves. Note that the functionality operates mostly on EveFile objects, hence the low-level user interface towards the eveH5 files, rather than the high-level Measurement objects targeted at end users.

Available functionality

Future plans

  • EngineLogInformation (preliminary name!)

    Collect information necessary to identify the engine log files.

    When something went wrong, one of the first steps admins usually try to do (if the incident is not too far in the past) is to have a look at the engine log files. However, currently it is rather tedious to identify the relevant log files, and although only with eveH5 structure v7.1 all relevant information will be available from an eveH5 file, a tool to collect the relevant information and do some “informed guessing” on older files is rather useful.

    The relevant information contains: timestamp of start and end of the measurement, host the engine runs on, user who started the engine, and the port the engine listens on (currently not available from the eveH5 files).

  • Extending the ScanModuleStructure class

    • Display positionings for each scan module (if present)

Module documentation

class evedata.evefile.controllers.info.ScanModuleStructure(scan_modules=None)

Bases: object

Collect basic information of the scan module structure of a scan.

Operating on the EveFile.scan_modules attribute of the EveFile class, this class extracts and collects basic information on the scan modules the given scan consists of. Hence, this class is basically aimed at debugging purposes, or for providing a first overview of the scan structure and the devices in each of the scan modules.

The (abbreviated) output showing the scan module structure of a real measurement file may look like:

+ 1: Dynamic Axis Snapshot - #1 [1]
+ 2: Dynamic Channel Snapshot - #1 [2]
+ 3: Motor - #47 [3..555]
    A Det-S (OMSMn:pi01700000)
    A Det-P (OMSMn:pi01700001)
    ...
  + 4: Motor - #56 [4..272]
      A SX700-Wavelength (nmEnerg:io1200000wl2e)
      C Keysight_1 (A2980:23303chan1)

As you can see from this example, the output attempts to have minimal markup, to allow to focus on the contents. For each of the scan modules (marked by a +), the ID, name, number of positions and first (and last) position are extracted. For each of the devices of a scan module, the type (A: axis, C: channel), the name and ID are extracted. The names are those used in the GUI of the measurement program, while the IDs are what you will find when opening an eveH5 file (e.g., with the hdfview program).

The resulting structure can be excessively configured, using the respective attributes described below. However, usually the default should be fine, and it is designed with a minimum markup in mind.

Note

Operating on the EveFile.scan_modules attribute of the EveFile class, the resulting scan structure may not in all details reflect the original scan module structure, particularly given that the special MPSKIP scans will usually be processed already. See the mpskip module for details.

scan_modules

Scan modules read from a given eveH5 file containing the SCML file.

Typically, this is the EveFile.scan_modules attribute of the EveFile class.

Type:

dict

scan_module_marker

Marker used to label a scan module.

Default: +

Type:

str

axis_marker

Marker used to label an axis contained in a scan module.

Default: A

Type:

str

channel_marker

Marker used to label a channel contained in a scan module.

Default: C

Type:

str

indentation

Indentation used to label nested scan modules (and their devices).

Default: two spaces

Type:

str

device_indentation

Indentation used to label devices of scan modules.

Default: four spaces

Type:

str

Parameters:

scan_modules (dict) –

Scan modules read from a given eveH5 file containing the SCML file.

Typically, this is the EveFile.scan_modules attribute of the EveFile class.

Raises:

ValueError – Raised if no scan modules are available to operate on.

Examples

Suppose you have loaded an eveH5 file using the EveFile class, and the loaded eveH5 file contained the scan description (SCML file).

eve_file = EveFile()
eve_file.load(filename="my_measurement_file.h5")

scan_module_structure = ScanModuleStructure(eve_file.scan_modules)
scan_module_structure.create()

This would create a textual overview of the scan structure in terms of its scan modules and the devices contained in each of the scan modules, and store this as a list of strings in the structure attribute.

However, usually you are interested in a straight output of the structure, as you would like to debug something. Hence, simply replace create() with print() and you are done:

eve_file = EveFile()
eve_file.load(filename="my_measurement_file.h5")

scan_module_structure = ScanModuleStructure(eve_file.scan_modules)
scan_module_structure.print()

This will create an output similar to what is shown as an example above at the beginning of the class documentation.

property structure

Structure of the scan modules and their devices.

The structure is created using the create() method, and it can be plotted conveniently using the print() method.

Returns:

structure – Structure of the scan modules and their devices.

Each element is of type str.

Return type:

list

create()

Create the basic information of the scan module structure of a scan.

The resulting information is contained in the structure attribute and can be printed conveniently using the print() method.

print()

Print the basic information of the scan module structure of a scan.

Convenience method to print the contents of the structure attribute of the class line-by-line. Intern, the create() method is called first, to ensure the correct output being printed.