You're reading the documentation for a development version. For the latest released version, please have a look at v0.5.

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: 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.

Type:

cwepr.metadata.Measurement

sample

Metadata corresponding to the sample.

Type:

cwepr.metadata.Sample

temperature_control

Metadata corresponding to the temperature.

Type:

cwepr.metadata.TemperatureControl

experiment

Metadata corresponding to the experiment.

Type:

cwepr.metadata.Experiment

spectrometer

Metadata corresponding to the spectrometer.

Type:

cwepr.metadata.Spectrometer

magnetic_field

Metadata corresponding to the magnetic field.

Type:

cwepr.metadata.MagneticField

bridge

Metadata corresponding to the microwave bridge.

Type:

cwepr.metadata.Bridge

signal_channel

Metadata corresponding to signal channel.

Type:

cwepr.metadata.SignalChannel

probehead

Metadata corresponding to the probehead used for the experiment.

Type:

cwepr.metadata.Probehead

metadata_modifications

List of all modifications performed on the metadata, e.g, overrides.

Type:

list

class cwepr.metadata.CalculatedDatasetMetadata

Bases: 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: Measurement

Metadata corresponding to the measurement.

Parameters:

dict (dict) – Dictionary containing properties to set.

label

Label of the sample, including the sample-number.

Type:

str

class cwepr.metadata.Sample(dict_=None)

Bases: 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

description

Description of the measured sample.

Type:

str

solvent

Name of the solvent used.

Type:

str

preparation

Short details of the sample preparation.

Type:

str

tube

Type and dimension of the sample tube used.

Type:

str

class cwepr.metadata.MagneticField(dict_=None)

Bases: 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.

Type:

aspecd.metadata.PhysicalQuantity

stop

Highest point of the magnetic field.

Type:

aspecd.metadata.PhysicalQuantity

sweep_width

Width of the magnetic field sweep.

Type:

aspecd.metadata.PhysicalQuantity

step_width

Distance between two points (only if equidistant!).

Type:

aspecd.metadata.PhyPhysicalQuantity

points

Number of points.

Type:

int

field_probe_type

Type of the field probe (e.g. Hall or Teslameter)

Type:

str

field_probe_model

Exact model of the field probe.

Type:

str

sequence

Sequence of the experiment (e.g. up or down).

Type:

str

controller

Model of the field controller.

Type:

str

power_supply

Model of the power supply.

Type:

str

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: Metadata

Metadata corresponding to the experiment.

Parameters:

dict (dict) – Dictionary containing properties to set.

type
Type:

str

runs

Number of recorded runs.

Type:

int

variable_parameter

Parameter that is varied during the measurement, e.g. magnetic field

Type:

str

increment

Increment the variable parameter is changed.

Type:

str

harmonic

Recorded harmonic of the signal.

Type:

str

class cwepr.metadata.Spectrometer(dict_=None)

Bases: Metadata

Metadata information on what type of spectrometer was used.

Parameters:

dict (dict) – Dictionary containing properties to set.

model

Model of the spectrometer used.

Type:

str

software

Name and version of the software used.

Type:

str

class cwepr.metadata.Bridge(dict_=None)

Bases: 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

model

Model of the microwave bridge used.

Type:

str

controller

Model of the bridge controller used.

Type:

str

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.

Type:

aspecd.metadata.PhysicalQuantity

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.

Type:

aspecd.metadata.PhysicalQuantity

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:

str

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:

str

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.

Type:

aspecd.metadata.PhysicalQuantity

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:

int

class cwepr.metadata.SignalChannel(dict_=None)

Bases: Metadata

Metadata information on the signal channel employed.

Parameters:

dict (dict) – Dictionary containing fields corresponding to attributes of the class

model

Model of the signal channel.

Type:

str

modulation_amplifier

Type of the modulation amplifier.

Type:

str

accumulations

Number of accumulated scans.

Type:

int

modulation_frequency

Modulation frequency used.

Type:

aspecd.metadata.PhysicalQuantity

modulation_amplitude

Amplitude of the modulation

Type:

aspecd.metadata.PhysicalQuantity

receiver_gain

Gain of the receiver, existence depends on the spectrometer.

Type:

aspecd.metadata.PhysicalQuantity

conversion_time

Conversion time (usually in ms).

Type:

aspecd.metadata.PhysicalQuantity

time_constant

Time constant (usually in ms).

Type:

aspecd.metadata.PhysicalQuantity

phase

Phase of the modulation amplifier.

Type:

aspecd.metadata.PhysicalQuantity

offset

Baseline offset

Type:

float

class cwepr.metadata.DigitalFilter(dict_=None)

Bases: 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.

mode

Mode of the digital filter. In Magnettech files, this is one of “DIG” or “DIGRC”.

Type:

str

points

Number of points taken into account. Not used in Magnettech data.

Type:

int

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 in DIGRC mode, it is the “Time Constant” and given in s.

Type:

aspecd.metadata.PhysicalQuantity

New in version 0.4.

class cwepr.metadata.Probehead(dict_=None)

Bases: 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:

str

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:

str

coupling

Type of coupling. In cwepr it is usually critically coupled.

Type:

str

class cwepr.metadata.TemperatureControl(dict_=None)

Bases: 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.

cryostat

Model of the cryostat used.

Type:

str

cryogen

Cryogen used.

Typically, this is either N2 (for temperatures down to 80K) or He (for temperatures down to 4 K)

Type:

str