cwepr.metadata module
Metadata: Information on numeric data stored in a structured way.
Metadata
In this module, the individual metadata classes are defined which contain the metadata for the different types of datasets:
What may sound like a minor detail is one key aspect of the cwepr package:
The metadata and their structure provide a unified interface for all
functionality operating on datasets. Furthermore, the metadata contained
particularly in the cwepr.metadata.ExperimentalDatasetMetadata
class
are the result of several years of practical experience. Reproducible research
is only possible if all information necessary is always recorded, and this
starts with all the metadata accompanying a measurement. Defining what kind
of metadata is important and needs to be recorded, together with metadata
formats easily writable by the experimenters during recording the data
requires a thorough understanding of both, the method and the setup(s) used.
For an overview of the structures of the dataset classes and their
corresponding metadata, see the dataset structure
section.
Module documentation
- class cwepr.metadata.ExperimentalDatasetMetadata
Bases:
aspecd.metadata.ExperimentalDatasetMetadata
Set of all metadata for a dataset object.
Metadata as a unified structure of information coupled to the dataset are necessary for the understanding, analysis and processing of data, especially in cwepr. Too many parameters have a direct influence to the spectral shape of the spectrum that anything other than saving them in an appropriate place and accessing them automatised in the respective tasks is no option. Some parameters are written automatically by the spectrometer’s software, others, depending also on the actual setup (that may change over time!) are omitted. It is highly recommended those parameters should be noted by hand, for example in an .info-file.
- measurement
Metadata corresponding to the measurement.
- sample
Metadata corresponding to the sample.
- temperature_control
Metadata corresponding to the temperature.
- experiment
Metadata corresponding to the experiment.
- spectrometer
Metadata corresponding to the spectrometer.
- magnetic_field
Metadata corresponding to the magnetic field.
- bridge
Metadata corresponding to the microwave bridge.
- signal_channel
Metadata corresponding to signal channel.
- probehead
Metadata corresponding to the probehead used for the experiment.
- class cwepr.metadata.CalculatedDatasetMetadata
Bases:
aspecd.metadata.CalculatedDatasetMetadata
Metadata for a calculated dataset.
This class contains the minimal set of metadata for a dataset consisting of calculated data, i.e.,
cwepr.dataset.CalculatedDataset
.Metadata of actual datasets should extend this class by adding properties that are themselves classes inheriting from
aspecd.metadata.Metadata
.Metadata can be converted to dict via
aspecd.utils.ToDictMixin.to_dict()
, e.g., for generating reports using templates and template engines.
- class cwepr.metadata.Measurement(dict_=None)
Bases:
aspecd.metadata.Measurement
Metadata corresponding to the measurement.
- Parameters
dict (
dict
) – Dictionary containing properties to set.
- class cwepr.metadata.Sample(dict_=None)
Bases:
aspecd.metadata.Sample
Metadata corresponding to the sample .
As this class inherits from
aspecd.metadata.Sample
, see the documentation of the parent class for details and the full list of inherited attributes.- Parameters
dict (
dict
) – Dictionary containing fields corresponding to attributes of the class
- class cwepr.metadata.MagneticField(dict_=None)
Bases:
aspecd.metadata.Metadata
Metadata corresponding to the magnetic field.
- Parameters
dict (
dict
) – Dictionary containing fields corresponding to attributes of the class
- start
Lowest point of the magnetic field.
- stop
Highest point of the magnetic field.
- sweep_width
Width of the magnetic field sweep.
- step_width
Distance between two points (only if equidistant!).
- Type
aspecd.metadata.PhyPhysicalQuantity
- can_calculate()
Check if enough data is present to determine field values.
Checks if enough different pieces of information are provided to calculate all information concerning the field sector and sweeping steps.
Note
Currently, the possibility of calculating the sector width from the width and the number of steps is not accounted for.
- Raises
NotEnoughValuesError – Raised when not enough different pieces of information are provided to determine the other variables.
- calculate_values()
Perform the calculation of all field values left out.
Calculate the different values concerning the sector and sweeping steps of the magnetic field.
Note
Currently, the possibility of calculating the sector width from the with and the number of steps is not accounted for.
- Raises
UnequalUnitsError : – Raised, when two physical quantities shall be added or subtracted that have unequal units.
- gauss_to_millitesla()
Transform magnetic field parameters from gauss to millitesla.
- class cwepr.metadata.Experiment(dict_=None)
Bases:
aspecd.metadata.Metadata
Metadata corresponding to the experiment.
- Parameters
dict (
dict
) – Dictionary containing properties to set.
- class cwepr.metadata.Spectrometer(dict_=None)
Bases:
aspecd.metadata.Metadata
Metadata information on what type of spectrometer was used.
- Parameters
dict (
dict
) – Dictionary containing properties to set.
- class cwepr.metadata.Bridge(dict_=None)
Bases:
aspecd.metadata.Metadata
Metadata corresponding to the microwave bridge.
The microwave bridge contains the microwave source and parts of the detection system. Therefore, the crucial experimental parameters such as attenuation and power, microwave frequency and detection system used are contained as well as the description of the devices, i.e. the bridge itself, its controller, and the frequency counter, as these can be different interchangeable components.
- Parameters
dict (
dict
) – Dictionary containing fields corresponding to attributes of the class
- attenuation
Attenuation of the microwave power in dB.
Without knowing the unattenuated source power, the attenuation is a rather useless value, although it gets often used, particularly in lab jargon. Typical microwave bridges have source powers of 200 mW in X-Band, but newer devices sometimes deliver only 150 mW.
- power
Output power of the microwave.
The actual output power of the microwave used for the experiment, i.e. the source power reduced by the attenuation. Typical values are in the range of 20 mW to 20 µW.
- detection
Type of the detection used.
There are two types of detection: diode and mixer. The latter usually allows for quadrature detection, i.e. detecting both, the absorptive and dispersive signal components.
- Type
- frequency_counter
Model of the frequency counter used.
Depending on the setup used, this can be included in the bridge. Otherwise, it will often be a HP device.
- Type
- mw_frequency
Microwave frequency.
The actual microwave frequency used for the experiment. Usually, this is a scalar number. Depending on the experiment control software used, the microwave frequency for each transient will be recorded, thus allowing for analysing frequency drifts. This is particularly helpful in case of long-running experiments (12+ h). By comparing the amplitude of the frequency drift with the field step width, the potential impact in the signal shape can be directly calculated.
- q_value
Quality factor of the cavity.
In most spectrometers, acquiring the Q-factor is not done by hand i.e. in Bruker spectrometers the measurement ist most commonly performed in tune mode with an attenuation of 33 dB, whereas at the Magnettech benchtop spectrometer, one has to select the box to measure the Q-factor.
- Type
- class cwepr.metadata.SignalChannel(dict_=None)
Bases:
aspecd.metadata.Metadata
Metadata information on the signal channel employed.
- Parameters
dict (dict) – Dictionary containing fields corresponding to attributes of the class
- modulation_frequency
Modulation frequency used.
- modulation_amplitude
Amplitude of the modulation
- receiver_gain
Gain of the receiver, existence depends on the spectrometer.
- conversion_time
Conversion time (usually in ms).
- time_constant
Time constant (usually in ms).
- phase
Phase of the modulation amplifier.
- class cwepr.metadata.DigitalFilter(dict_=None)
Bases:
aspecd.metadata.Metadata
Metadata about the digital filter applied to the data.
Especially in Magnettech data, by default, a digital filter is applied on the data.
- Parameters
dict (
dict
) – Dictionary containing properties to set.
- parameter
In Magnettech data files, there are two different types of parameters: In
DIG
mode the parameter is named “Smoothing Filter width” and given in mT` whereas inDIGRC
mode, it is the “Time Constant” and given in s.
New in version 0.4.
- class cwepr.metadata.Probehead(dict_=None)
Bases:
aspecd.metadata.Metadata
Metadata corresponding to the probehead.
Often, resonating structures get used in EPR spectroscopy, but as this is not always the case, the term “probehead” is more generic.
In all except of fully integrated benchtop spectrometers, the probehead can readily be exchanged. As each probehead has its own characteristics, it is crucially important to note at least type and model. The coupling (critically or overcoupled) determines the bandwidth of the resonator, and in all but pulsed experiments, usually, critical coupling is used.
- Parameters
dict (
dict
) – Dictionary containing properties to set.
- type
Type of the probehead used.
There are several types of probeheads regularly used. For resonators, there are, e.g., dielectic and split-ring resonators, cylindrical and rectangular cavities. More special would be Fabry-Perot and stripline resonators. Sometimes, even resonator-free designs are used as probeheads.
- Type
- model
Model of the probehead used.
Commercial probeheads come with a distinct model that goes in here. In all other cases, use a short, memorisable, and unique name.
- Type
- class cwepr.metadata.TemperatureControl(dict_=None)
Bases:
aspecd.metadata.TemperatureControl
Metadata corresponding to the temperature control.
As this class inherits from
aspecd.metadata.TemperatureControl
, see the documentation of the parent class for details and the full list of inherited attributes.- Parameters
dict (
dict
) – Dictionary containing properties to set.