evedata.evefile.entities.data module
Entities representing an eveH5 file on the data level.
Data are organised in “datasets” within HDF5, and the
evedata.evefile.entities.data
module provides the relevant entities
to describe these datasets. Although currently (as of 07/2024, eve version
2.1) neither average nor interval detector channels save the individual
data points, at least the former is a clear need of the
engineers/scientists. Hence, the data model already respects this use
case. As per position (count) there can be a variable number of measured
points, the resulting array is no longer rectangular, but a “ragged
array”. While storing such arrays is possible directly in HDF5,
the implementation within evedata is entirely independent of the actual
representation in the eveH5 file.
Overview
A first overview of the classes implemented in this module and their
hierarchy is given in the UML diagram below, Fig. 33. The first distinction is made
between MonitorData
and MeasureData
, with the former
having timestamps (in milliseconds) as their quantisation axis, and the
latter individual positions (integer values). MeasureData
can
further be separated into AxisData
, ChannelData
,
and DeviceData
. The TimestampData
class is somewhat
special, as it (only) gets used to map timestamps to positions and does
not correspond to any physical device or option of such device. Generally,
each data class comes with its corresponding metadata class implemented in
the evedata.evefile.entities.metadata
module.
Fig. 33 Class hierarchy of the evedata.evefile.entities.data
module.
Each class has a corresponding metadata class in the
evedata.evefile.entities.metadata
module. While in this
diagram, some child classes seem to be identical, they have a
different type of metadata (see the
evedata.evefile.entities.metadata
module). Generally, having
different types serves to discriminate where necessary between
detector channels and motor axes.
You may click on the image for a larger view.
While the UML diagram in Fig. 33 represents the actually implemented classes in the module, it might sometimes be easier to have a more high-level and abstract overview of the different data classes. This is provided in Fig. 34. below.
Fig. 34 A more abstract view of the MeasureData
class hierarchy. The
class names here generally do not reflect actual class names,
but are rather meant as a quick overview. Detector channels can
generally be distinguished according to the dimensionality of the recorded
data (0D…2D, potentially 3D in the future).
Array and area channels are currently best modelled with respect to their data model and are hence described in more detail below.
Array channels
Array channels in their general form are channels collecting 1D data.
Typical devices used here are MCAs, but oscilloscopes and vector signal
analysers (VSA) would be other typical array channels. Hence, for these
quite different types of array channels, distinct subclasses of the
generic ArrayChannelData
class exist, see
Fig. 35.
Fig. 35 Preliminary data model for the ArrayChannelData
classes. The
basic hierarchy is identical to Fig. 33. Details for the
MCAChannelData
class can be found in Fig. 36. The ScopeChannelData
class is a
container for scopes with several channels read simultaneously.
Further array detector channels can be added by subclassing
ArrayChannelData
. Probably the next class will be
VSAChannelData
for Vector Signal Analyser (VSA) data.
Multi Channel Analysers (MCA) generally collect 1D data and typically have separate regions of interest (ROI) defined, containing the sum of the counts for the given region. For the EPICS MCA record, see https://millenia.cars.aps.anl.gov/software/epics/mcaRecord.html.
Fig. 36 Preliminary data model for the MCAChannelData
classes. The basic
hierarchy is identical to Fig. 33, and here, the relevant part of the
metadata class hierarchy from Fig. 12 is shown as well. Separating the
MCAChannelCalibration
class from the
ArrayChannelMetadata
allows to
add distinct behaviour, e.g. creating calibration curves from the
parameters.
Note: The scalar attributes for ArrayChannelROIs will currently be saved
as snapshots regardless of whether the actual ROI has been defined/used.
Hence, the evedata package needs to decide based on the existence of the
actual data whether to create a ROI object and attach it to
ArrayChannelData
.
The calibration parameters are needed to convert the x axis of the MCA
spectrum into a real energy axis. Hence,
the MCAChannelCalibration
class will have methods for performing exactly this conversion. The
relationship between calibrated units (cal) and channel number (chan) is
defined as cal=CALO + chan*CALS + chan^2*CALQ. The first channel in the
spectrum is defined as chan=0. However, not all MCAs/SDDs have these
calibration values: Ketek SDDs seem to not have these values (internal
calibration?).
The real_time and life_time values can be used to get an idea of the amount of pile up occurring, i.e. having two photons with same energy within a short time interval reaching the detector being detected as one photon with twice the energy. Hence, latest in the radiometry package, distinct methods for this kind of analysis should be implemented.
Area channels
Area channels are basically 2D channels, i.e., cameras. There are (at least) two distinct types of cameras in use, namely scientific cameras and standard consumer digital cameras for taking pictures (of sample positions in the setup). While scientific cameras usually record only greyscale images, but have additional parameters and can define regions of interest ( ROI), consumer cameras are much simpler in terms of their data model and typically record RGB images. These different types of images need to be handled differently in the data processing and analysis pipeline.
Fig. 37 Preliminary data model for the AreaChannelData
class. The basic
hierarchy is identical to Fig. 33. As
scientific cameras are quite different from standard consumer digital
cameras for taking pictures, but both are used from within the
measurement program, distinct subclasses of the basic
AreaChannelData
class exist. For details on the
ScientificCameraData
classes, see Fig. 38.
Fig. 38 Preliminary data model for the ScientificCameraData
classes. The
basic hierarchy is identical to Fig. 33, and here, the relevant part of the
metadata class hierarchy from Fig. 12 is shown as well. As different
area detectors (scientific cameras) have somewhat different options,
probably there will appear a basic AreaChannelData
class with
more specific subclasses.
Regarding file names/paths: Some of the scientific cameras are operated from Windows, hence there is usually no unique mapping of paths to actual places of the files, particularly given that Windows allows to map a drive letter to arbitrary network paths. It seems as if these paths are quite different for the different detectors, and therefore, some externally configurable mapping should be used.
Note for Pilatus cameras: Those cameras seem to have three sensors each for temperature and humidity. Probably the simplest solution would be to store those values in an array rather than having three individual fields each. In case of temperature (and humidity) readings for each individual image, the array would become a 2D array.
Generally: How to deal with image filenames/paths and actual data?
Currently, the mapper maps the HDF5 dataset, hence puts the filenames as
array of strings into the Data.data
attribute. Shall all images be
loaded at once when the data are imported? Or shall loading of images be
deferred as well for the individual images? At least regarding the time
necessary to load images, this would be negligible (<1 ms per image).
Individual classes
The following is not a strict inheritance hierarchy, but rather a grouped hierarchical list of classes for quick access to their individual API documentation:
Special aspects
There is a number of special aspects that need to be taken into account when reading data. These are detailed below.
Sorting non-monotonic positions
For MeasureData
, positions (“PosCounts”) need not be
monotonically increasing. This is due to the way the engine handles the
different scan modules and writes data. However, this will usually be a
problem for the analysis. Therefore, positions need to be sorted
monotonically, and this is done during data import.
Handling duplicate positions
Although technically speaking a bug, some (older) measurement files
contain duplicate positions (“PosCounts”). Here, the handling is different
for AxisData
and ChannelData
, but in both cases taken
care of during data import:
For
AxisData
, only the last position is taken.For
ChannelData
, only the first position is taken.
Module documentation
- class evedata.evefile.entities.data.Data
Bases:
object
Data recorded from the devices involved in a measurement.
This is the base class for all data(sets) and not meant to be used directly. Rather, one of the individual subclasses should actually be used.
When subclassing, make sure to create the corresponding metadata class in the
evedata.evefile.entities.metadata
module as well.Data are read from HDF5 files, and to save time and resources, actual data are only read upon request.
- metadata
Relevant metadata for the individual device.
- options
(Variable) options of the device.
Devices can have options. Generally, there are two types of options: those whose values are not changing within a given scan module, and those whose values can potentially change for every individual position (count). The latter are stored here as key–value pairs with the key corresponding to the option name. The former are stored in the
evedata.evefile.entities.metadata.Metadata.options
attribute.- Type:
- importer
Importer objects for the data and possibly (variable) options.
Each item is a
DataImporter
object.Data are loaded on demand, not already when initially loading the eveH5 file. Hence, the need for a mechanism to provide the relevant information where to get the relevant data from and how. Different versions of the underlying eveH5 schema differ even in whether all data belonging to one
Data
object are located in one HDF5 dataset or spread over multiple HDF5 datasets. In the latter case, individual importers are necessary for the separate HDF5 datasets. Hence, the list of importers.- Type:
Examples
The
Data
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- class evedata.evefile.entities.data.MonitorData
Bases:
Data
Data from devices monitored, but not controlled by the eve engine.
In contrast to
MeasureData
,MonitorData
do not have a position as primary axis, but a timestamp in milliseconds, i.e., themilliseconds
attribute.- metadata
Relevant metadata for the individual device.
- milliseconds
Time in milliseconds since start of the scan.
- Type:
Examples
The
MonitorData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- class evedata.evefile.entities.data.MeasureData
Bases:
Data
Base class for data from devices actually controlled by the eve engine.
In contrast to
MonitorData
,MeasureData
have a position as primary axis rather than a timestamp in milliseconds, i.e., thepositions
attribute.Note
Positions and (all) corresponding data are sorted upon load. For the handling of duplicate positions in
AxisData
andChannelData
. see there.- metadata
Relevant metadata for the individual device.
Examples
The
MeasureData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- class evedata.evefile.entities.data.DeviceData
Bases:
MeasureData
Data from (dumb) devices.
Three types of devices are distinguished by the eve measurement program: (dumb) devices, motor axes, and detector channels.
- metadata
Relevant metadata for the individual device.
Examples
The
DeviceData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.AxisData
Bases:
MeasureData
Data from motor axes.
Three types of devices are distinguished by the eve measurement program: (dumb) devices, motor axes, and detector channels.
Note
Positions and (all) corresponding data are sorted upon load. In case of duplicate positions, only the last position is retained.
- metadata
Relevant metadata for the individual device.
- set_values
Values the axis should have been set to.
While the
Data.data
attribute contains the actual positions of the axis, here, the originally intended positions are stored. This allows for easily checking whether the axis has been positioned within a scan as intended.- Type:
None
Examples
The
AxisData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.ChannelData
Bases:
MeasureData
Data from detector channels.
Three types of devices are distinguished by the eve measurement program: (dumb) devices, motor axes, and detector channels.
Note
Positions and (all) corresponding data are sorted upon load. In case of duplicate positions, only the first position is retained.
- metadata
Relevant metadata for the individual device.
Examples
The
ChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.TimestampData
Bases:
MeasureData
Data correlating the positions to the time used for monitors.
There are generally two different types of devices: those directly controlled by the eve engine, and those who are monitored. The former are instances of the
MeasureData
class, the latter of theMonitorData
class.The
TimestampData
class allows to map the time stamps (in milliseconds) of theMonitorData
data to positions ofMeasureData
data. This is a necessary prerequisite to correlate monitored values to the data from controlled devices, such as motor axes and detector channels.- metadata
Relevant metadata for the individual device.
Examples
The
TimestampData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- get_position(time=-1)
Get position for a given (list of) time(stamp)s.
This method is used to map monitor timestamps to positions.
Note
Due to not being able to distinguish between axes and channels up to eveH5 v7, timestamps are generally mapped to the previous position.
- Parameters:
time (
int
|list
|numpy.ndarray
) – Time(s) a position is requested for.- Returns:
positions – Position(s) corresponding to the timestamp(s) given.
- Return type:
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.NonnumericChannelData
Bases:
ChannelData
Data for channels with non-numeric data.
There are EPICS PVs returning non-numeric values that are stored in HDF5 datasets in eveH5 files. This class represents these read non-numeric values.
- metadata
Relevant metadata for the individual device.
Examples
The
NonnumericChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.SinglePointChannelData
Bases:
ChannelData
Data for channels with numeric 0D data.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 0D, scalar values.
- metadata
Relevant metadata for the individual device.
Examples
The
SinglePointChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.AverageChannelData
Bases:
ChannelData
Data for channels with averaged numeric 0D data.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 0D, scalar values that are averaged.
- metadata
Relevant metadata for the individual device.
- raw_data
The raw individual values measured.
- Type:
Any
- attempts
Short description
- Type:
Examples
The
AverageChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- property mean
Mean values for channel data.
- Returns:
mean – The mean of the values recorded.
If more values have been recorded than should be averaged over, only the number of values to average over are taken from the end of the individual
raw_data
row.- Return type:
- property std
Standard deviation values for channel data.
- Returns:
mean – The standard deviation of the values recorded.
If more values have been recorded than should be averaged over, only the number of values to average over are taken from the end of the individual
raw_data
row to calculate the standard deviation.- Return type:
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.IntervalChannelData
Bases:
ChannelData
Data for channels with numeric 0D data measured in a time interval.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 0D, scalar values that are measured in a time interval.
- metadata
Relevant metadata for the individual device.
- raw_data
The raw individual values measured in the given time interval.
- Type:
Any
- counts
The number of values measured in the given time interval.
Note that this value may change for each individual position.
- Type:
Examples
The
IntervalChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- property mean
Mean values for channel data.
- Returns:
mean – The mean of the values measured in the given time interval.
- Return type:
- property std
Standard deviation values for channel data.
- Returns:
mean – The standard deviation of the values measured in the given time interval.
- Return type:
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.ArrayChannelData
Bases:
ChannelData
Metadata for channels with numeric 1D data.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 1D array values.
- metadata
Relevant metadata for the individual device.
Examples
The
ArrayChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.Todo
Decide whether all data need to be ordered according to their first axis (monitor data and measure data), and if only the latter, implement the sorting in the
MeasureData.get_data()
method. Otherwise, implement it here.Make this method version-aware, i.e. handle situation with new eveH5 v8 schema where data are stored as single dataset in HDF5, no longer as separate datasets. Should be rather easy, as this would mean only one importer with “data” as value?
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.AreaChannelData
Bases:
ChannelData
Metadata for channels with numeric 2D data.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 2D area values.
- metadata
Relevant metadata for the individual device.
Examples
The
AreaChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.NormalizedChannelData
Bases:
object
Mixin class (interface) for normalized channel data.
0D channels can be normalized by the data of another 0D channel, i.e. by dividing its values by the values of the normalizing channel.
- metadata
Relevant metadata for normalization.
- normalized_data
Data that have been normalized.
Normalization takes place by dividing by the values of the normalizing channel.
- Type:
Any
- normalizing_data
Data used for normalization.
- Type:
Any
- Raises:
exception – Short description when and why raised
Examples
The
AreaChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.
- class evedata.evefile.entities.data.SinglePointNormalizedChannelData
Bases:
SinglePointChannelData
,NormalizedChannelData
Data for channels with normalized numeric 0D data.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 0D, scalar values that are normalized by the data of another 0D channel.
- metadata
Relevant metadata for the individual normalized device.
Examples
The
SinglePointNormalizedChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.AverageNormalizedChannelData
Bases:
AverageChannelData
,NormalizedChannelData
Data for channels with normalized averaged numeric 0D data.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 0D, scalar values that are averaged and normalized by the data of another 0D channel.
- metadata
Relevant metadata for the individual normalized device.
Examples
The
AverageNormalizedChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property mean
Mean values for channel data.
- Returns:
mean – The mean of the values recorded.
If more values have been recorded than should be averaged over, only the number of values to average over are taken from the end of the individual
raw_data
row.- Return type:
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- property std
Standard deviation values for channel data.
- Returns:
mean – The standard deviation of the values recorded.
If more values have been recorded than should be averaged over, only the number of values to average over are taken from the end of the individual
raw_data
row to calculate the standard deviation.- Return type:
- class evedata.evefile.entities.data.IntervalNormalizedChannelData
Bases:
IntervalChannelData
,NormalizedChannelData
Data for channels with normalized interval-measured numeric 0D data.
Detector channels can be distinguished by the dimension of their data:
- 0D
scalar values per position, including average and interval channels
- 1D
array values, i.e. vectors, per position
- 2D
area values, i.e. images, per position
This class represents 0D, scalar values that are measured in a time interval and normalized by the data of another 0D channel.
- metadata
Relevant metadata for the individual normalized device.
Examples
The
IntervalNormalizedChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property mean
Mean values for channel data.
- Returns:
mean – The mean of the values measured in the given time interval.
- Return type:
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- property std
Standard deviation values for channel data.
- Returns:
mean – The standard deviation of the values measured in the given time interval.
- Return type:
- class evedata.evefile.entities.data.ScopeChannelData
Bases:
ArrayChannelData
Data for oscilloscope channels.
Oscilloscope channel data are usually 1D data, i.e. arrays or vectors.
- metadata
Relevant metadata for the individual device.
- Raises:
exception – Short description when and why raised
Examples
The
ScopeChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.Todo
Decide whether all data need to be ordered according to their first axis (monitor data and measure data), and if only the latter, implement the sorting in the
MeasureData.get_data()
method. Otherwise, implement it here.Make this method version-aware, i.e. handle situation with new eveH5 v8 schema where data are stored as single dataset in HDF5, no longer as separate datasets. Should be rather easy, as this would mean only one importer with “data” as value?
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.MCAChannelData
Bases:
ArrayChannelData
Data for multichannel analyzer (MCA) channels.
MCA channel data are usually 1D data, i.e. arrays or vectors.
- metadata
Relevant metadata for the individual device.
- roi
List of data for the individual ROIs defined.
Individual items in the list are objects of class
MCAChannelROIData
.- Type:
- life_time
Short description
- Type:
- real_time
Short description
- Type:
- preset_life_time
Short description
- Type:
- preset_real_time
Short description
- Type:
Examples
The
MCAChannelData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.Todo
Decide whether all data need to be ordered according to their first axis (monitor data and measure data), and if only the latter, implement the sorting in the
MeasureData.get_data()
method. Otherwise, implement it here.Make this method version-aware, i.e. handle situation with new eveH5 v8 schema where data are stored as single dataset in HDF5, no longer as separate datasets. Should be rather easy, as this would mean only one importer with “data” as value?
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.MCAChannelROIData
Bases:
MeasureData
Data for an individual ROI of an MCA detector channel.
Many MCAs allow to define one or several regions of interest (ROI). This class contains the relevant data for an individual ROI.
- marker
Two-element vector of integer values containing the left and right boundary of the ROI.
- Type:
Examples
The
MCAChannelROIData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.ScientificCameraData
Bases:
AreaChannelData
Data for scientific camera data.
Scientific camera data are usually 2D data, i.e. images.
Note, however, that typically the data column in the corresponding HDF5 dataset contains filenames rather than the actual data, as the data are not stored on the HDF5 level.
- metadata
Relevant metadata for the individual device.
- roi
List of data for the individual ROIs defined.
Individual items in the list are objects of class
ScientificCameraROIData
.To each ROI belongs a
ScientificCameraStatisticsData
object, but there can be an additionalScientificCameraStatisticsData
object for a scientific camera, describing the entire image. Furthermore, mapping ROI to statistics data is specific for each camera and setup.- Type:
- statistics
List of data for the individual statistics defined.
Individual items in the list are objects of class
ScientificCameraStatisticsData
.To each ROI belongs a
ScientificCameraStatisticsData
object, but there can be an additionalScientificCameraStatisticsData
object for a scientific camera, describing the entire image. Furthermore, mapping ROI to statistics data is specific for each camera and setup.- Type:
- acquire_time
Short description
- Type:
any
- temperature
Short description
- Type:
- humidity
Short description
- Type:
Examples
The
ScientificCameraData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.ScientificCameraROIData
Bases:
MeasureData
Data for an individual ROI of a scientific camera.
Many scientific cameras allow to define one or several regions of interest (ROI). This class contains the relevant data for an individual ROI.
- marker
Four-element vector of integer values containing the boundary of the ROI.
- Type:
Examples
The
ScientificCameraROIData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.ScientificCameraStatisticsData
Bases:
MeasureData
Data for an individual ROI of a scientific camera.
Many scientific cameras allow to define one or several regions of interest (ROI). This class contains the relevant data for an individual ROI.
- min_value
Short description
- Type:
- min_x
Short description
- Type:
- min_y
Short description
- Type:
- max_value
Short description
- Type:
- max_x
Short description
- Type:
- max_y
Short description
- Type:
- mean
Short description
- Type:
- total
Short description
- Type:
- net
Short description
- Type:
- sigma
Short description
- Type:
- centroid_threshold
Short description
- Type:
- centroid_x
Short description
- Type:
- centroid_y
Short description
- Type:
- centroid_sigma_x
Short description
- Type:
- centroid_sigma_y
Short description
- Type:
- centroid_sigma_xy
Short description
- Type:
Examples
The
ScientificCameraROIData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.SampleCameraData
Bases:
AreaChannelData
Data for consumer digital cameras used to take photos of samples.
Consumer digital camera data are usually 2D data, i.e. images.
Note, however, that typically the data column in the corresponding HDF5 dataset contains filenames rather than the actual data, as the data are not stored on the HDF5 level.
- metadata
Relevant metadata for the individual device.
Examples
The
SampleCameraData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.NonencodedAxisData
Bases:
AxisData
Data from motor axes without encoders.
Three types of devices are distinguished by the eve measurement program: (dumb) devices, motor axes, and detector channels.
Motor axes can have encoders that allow to read the real values back, while axes without encoders only report the value they should be arrived at.
- metadata
Relevant metadata for the individual device.
- set_values
Values the axis should have been set to.
While the
Data.data
attribute contains the actual positions of the axis, here, the originally intended positions are stored. This allows for easily checking whether the axis has been positioned within a scan as intended.- Type:
None
Examples
The
NonencodedAxisData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- property filled_data
Filled axis values.
Depending on the detector channel the axis values should be plotted against, filling may change.
- Returns:
data – Filled axis values.
- Return type:
any
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.DataImporter(source='')
Bases:
object
Base class for data importer.
Data need to be imported from somewhere. And usually, data should only be imported once they are requested, to save time and resources.
Actual importer classes inherit from this base class and implement the private method
_load()
. This method simply returns the loaded data.Optionally, preprocessing will be applied to the data loaded, if the list
preprocessing
is not empty.- preprocessing
Preprocessing steps applied after loading the original data.
Each entry in the list is an object of type
ImporterPreprocessingStep
.- Type:
- Raises:
ValueError – Raised upon load if no source is provided.
Examples
While this base class is not intended to be used directly, the general usage is the same for all descendants:
importer = DataImporter() data = importer.import(source="myfilename")
For convenience, you can set the source when instantiating the object. This makes actually importing simpler, not having to worry anymore about the source:
importer = DataImporter(source="myfilename") data = importer.import()
- load(source='')
Load data from source.
The method first checks for the source to be present, and afterwards calls out to the private method
_load()
that does the actual business. Child classes hence need to implement this private method. Make sure to return the loaded data from this method.Once loaded, the data are preprocessed with each of the preprocessing steps defined in
preprocessing
.- Parameters:
source (
str
) –Source the data should be loaded from.
Typically, a file name.
- Raises:
ValueError – Raised if no source is provided.
- Returns:
data – Data loaded from the source.
The actual type of data depends on the source and importer type.
- Return type:
any
- class evedata.evefile.entities.data.HDF5DataImporter(source='')
Bases:
DataImporter
Load data from HDF5 dataset.
HDF5 files are organised hierarchically, with groups as nodes and datasets as leafs. Data can (only) be contained in datasets, and this is what this importer is concerned about.
Note
Perhaps it is possible to move this class to the boundary technical layer, by means of creating an (abstract) DataImporterFactory in the entities layer and a concrete factory in the boundary layer. The only complication currently: the controller technical layer needs to access the concrete DataImporterFactory.
- item
The dataset within the HDF5 file.
Datasets are addressed by a path-like string, with slashes separating the hierarchy levels in the file.
- Type:
- mapping
Mapping table for table columns to
Data
object attributes.HDF5 datasets in eveH5 files usually consist of at least two columns for their data, the first either the position or the time since start of the measurement in milliseconds. Besides this, there can be more than one additional column for the actual data. As the structure of the datasets changed and will change, there is a need for a mapping table that gets filled properly by the
VersionMapper
class.Furthermore, storing this mapping information is relevant as data are usually only loaded upon request, not preliminary, to save time and resources.
- Type:
- data
Data loaded from the HDF5 dataset.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Type:
- Raises:
ValueError – Raised upon load if either source or item are not provided.
Examples
To import data from an HDF5 dataset located in an HDF5 file, you need to provide both, file name (source) and dataset name (item):
importer = HDF5DataImporter() importer.source = "test.h5" importer.item = "/c1/main/test" data = importer.load()
You can, for convenience, provide both, source and item upon instantiating the importer object:
importer = HDF5DataImporter(source="test.h5", item="/c1/main/test") data = importer.load()
- load(source='', item='')
Load data from source.
The method first checks for the source to be present, and afterwards calls out to the private method
_load()
that does the actual business. Child classes hence need to implement this private method. Make sure to return the loaded data from this method.Besides returning the data (for convenience), they are set to the
data
attribute for later access.- Parameters:
- Raises:
ValueError – Raised if either source or item are not provided.
- Returns:
data – Data loaded from the HDF5 dataset.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- class evedata.evefile.entities.data.SkipData
Bases:
ChannelData
Data for skip detector channel.
A skip detector channel is a special EPICS device termed “MPSKIP” used mainly to store individual values of an average detector channel, but not only the individual detector channel values, but at the same time RBVs of a series of motor axes of interest.
Qualitatively, the MPSKIP device behaves similar to an average detector channel modelled via
AverageChannelData
. Hence, the metadata are similar as well. However, each channel readout and axes RBV has its own position count. Hence, in case of such channel present in a scan, usually, some post-processing of the individual data of both, channels and axes RBVs is necessary. This is a task implemented in thempskip
module.The actual MPSKIP detector channel does not contain any relevant detector channel values, only parts of the information necessary to afterwards post-process the data of the other axes and channels. For the way this information is obtained and mapped to the
SkipData
class, see the documentation of theversion_mapping
module.- metadata
Relevant metadata for the individual device.
Examples
The
SkipData
class is not meant to be used directly, as any entities, but rather indirectly by means of the respective facades in the boundaries technical layer of theevedata.evefile
subpackage. Hence, for the time being, there are no dedicated examples how to use this class. Of course, you can instantiate an object as usual.- get_parent_positions()
Obtain positions of the parent scan module.
The scan module containing the MPSKIP detector is easy to determine. However, given the unpredictable number of positions of this scan module, the position (count)s for the parent scan module need to be determined from the actual positions created during executing the MPSKIP scan module.
Given the direct relationship between MPSKIP scan module and parent, with the MPSKIP scan module nested, the positions of the parent are simply those missing in the position list, and in addition the first position being
SkipCount.positions[0] - 1
.- Returns:
parent_positions – Positions of the parent scan module.
- Return type:
- get_scan_module_positions()
Obtain positions for the individual scan modules.
Used in case of more than one scan module with MPSKIP detector.
- Returns:
scan_module_positions – list of
numpy.ndarray
objects- Return type:
- copy_attributes_from(source=None)
Obtain attributes from another
Data
object.Sometimes, it is useful to obtain the (public) attributes from another
Data
object. Note that only public attributes are copied. Furthermore, a (true) copy of the attributes is obtained, hence the properties of source and target are actually different objects.- Parameters:
source (
Data
) –Object to copy attributes from.
Should typically be of the same (super)type.
- Raises:
ValueError – Raised if no source is provided to copy attributes from.
- property data
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
data
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
data – Actual data recorded from the device.
The actual data type (
numpy.dtype
) depends on the specific dataset loaded.- Return type:
- get_data()
Load data (and variable option data) using the respective importer.
Data are loaded only on demand. Hence, upon the first access of the
data
property, this method will be called, calling out to the respective importers.As
Data
objects may contain (variable) options that are themselves data, but loading these data is only triggered when accessing thedata
property, you can either once access thedata
property or call this method.Data may be spread over several HDF5 datasets, depending on the version of the eveH5 file read. Hence, there may be several importers, and they are dealt with sequentially.
Furthermore, for each importer type, there is a special private method
_import_from_<importer-type>
, with<importer-type>
being the lowercase class name. Those classes using additional importers beyondHDF5DataImporter
need to implement additional private methods to handle the special importer classes. A typical use case is theAreaChannelData
class dealing with image data stored mostly in separate files.
- property position_counts
Position counts data are recorded for.
Each data “point” corresponds to an overall position of all actuators (motor axes) of the setup and is assigned an individual “position count” (an integer number).
Actual data recorded from the device.
Data are loaded only on demand. Hence, upon the first access of the
positions
property, theget_data()
method will be called, calling out to the respective importers.- Returns:
positions – Position values data are recorded for.
The actual data type (
numpy.dtype
) is usually int.- Return type:
- class evedata.evefile.entities.data.ImporterPreprocessingStep(data=None)
Bases:
object
Abstract preprocessing step optionally hooked into data importers.
Sometimes, data need to be preprocessed after loading from the source. Typical examples are extracting only parts of the HDF5 dataset, but can be much more involved.
For a series of (more) generic preprocessing steps, see the
preprocessing
module in thecontrollers
subpackage.- data
Data loaded from the source.
The actual type of data depends on the source and importer type.
- Type:
any
Examples
The class operates on data as read from the source during import using a
DataImporter
. Hence, the actual type of data depends heavily on the importer used. Processing is done by calling theprocess()
method.There are two basic ways of using the class, differing only by where the data are set. You can set the data while instantiating the processing step:
task = ImporterPreprocessingStep(data="foo") data = task.process()
Alternatively, you can set the data when calling the
process()
method:task = ImporterPreprocessingStep() data = task.process(data="foo")
Of course, processing steps can be chained, i.e., applied in a sequence. Hence, they should never change the basic format/type of the data.
- process(data=None)
Perform the preprocessing step on the data.
The actual task is implemented in the
_process()
method.- Parameters:
data (any) –
Data loaded from the source.
The actual type of data depends on the source and importer type.
- Returns:
data – Processed data.
The actual type of data depends on the source and importer type.
- Return type:
any