evedata.measurement.entities.metadata module

Metadata corresponding to a measurement.

A measurement generally reflects all the data obtained during a measurement. However, to plot data or to perform some analysis, usually we need data together with an axis (or multiple axes for nD data), where data (“intensity values”) and axis values come from different HDF5 datasets. Furthermore, there may generally be the need/interest to plot arbitrary data against each other, i.e. channel data vs. channel data and axis data vs. axis data, not only channel data vs. axis data. This is the decisive difference between the Measurement entity and the Measurement facade, with the latter having the additional attributes for storing the data to work on.

Metadata are a crucial part of reproducibility. Furthermore, metadata allow analysis routines to gain a “semantic” understanding of the data and hence perform (at least some) actions unattended and fully automatically. While all metadata corresponding to the individual devices used in recording data are stored in the metadata attribute of the Data class (and its descendants), there are other types of metadata that belong to the measurement as such itself. These are modelled in the metadata module in the Metadata class.

Overview

A first overview of the classes implemented in this module and their hierarchy is given in the UML diagram below.

../../../_images/evedata.measurement.entities.metadata.svg

Fig. 43 While the Metadata class inherits directly from its counterpart from the evedata.evefile.entities.file module, it is extended in crucial ways, reflecting the aim for more reproducible measurements and having datasets containing all crucial information in one place. This involves information on both, the machine (BESSY-II, MLS) and the beamline, but on the sample(s) as well. Perhaps the sample attribute should be a dictionary rather than a plain list, with (unique) labels for each sample as keys.

As of now, the eveH5 files do not contain any metadata regarding machine, beamline, or sample(s). The names of the machine and beamline can most probably be inferred, having the name of the beamline obviously allows to assign the machine as well.

Given that one measurement (i.e. one scan resulting in one eveH5 file) can span multiple samples, and will often do, in the future, at least some basic information regarding the sample(s) should be added to the eveH5 file and read and mapped accordingly to instances of the Sample class, one instance per sample. Potentially, this allows to assign parts of the measured data to individual samples and hence automate data processing and analysis, e.g. splitting the data for the different samples into separate datasets/files.

Key aspects

  • xxx

Module documentation

class evedata.measurement.entities.metadata.Metadata

Bases: Metadata

Metadata of a given measurement resulting in an eveH5 file.

As measurements result in individual files, there is a series of crucial metadata of such a measurement on this global level.

In addition to the base class, information on the machine, beamline, and sample(s) measured are stored.

filename

Name (full path) of the eveH5 file.

Type:

str

eveh5_version

Version of the eveH5 schema.

Type:

str

eve_version

Version of the eve engine used to record the data.

Type:

str

xml_version

Version of the schema used for the scan description (SCML/XML)

Type:

str

measurement_station

Name of the measurement station used to record the data.

Type:

str

start

Timestamp of the start of the measurement

Type:

datetime.datetime

end

Timestamp of the end of the measurement

Type:

datetime.datetime

description

User-entered description of the entire scan.

Type:

str

simulation

Flag signalling whether the measurement was a simulation.

Default: False

Type:

bool

preferred_axis

Name of the axis marked as preferred in the scan description.

Default: “”

Type:

string

preferred_channel

Name of the channel marked as preferred in the scan description.

Default: “”

Type:

string

preferred_normalisation_channel

Name of the channel marked as preferred for normalising.

Default: “”

Type:

string

sample

Metadata for each individual sample.

Each element of the list is of type Sample.

Type:

List

machine

Metadata for the machine (BESSY-II, MLS) used for the measurement.

Type:

Machine

beamline

Metadata for the beamline used for the measurement.

Type:

Beamline

Raises:

exception – Short description when and why raised

class evedata.measurement.entities.metadata.Sample

Bases: object

Metadata of a given sample that has been measured.

As multiple samples can be measured within one measurement, the Metadata class associated with a Measurement contains a list of Sample objects in its Metadata.sample attribute.

name

Short, descriptive name of the sample

Type:

str

id

Unique identifier of the sample

Type:

str