You're reading an old version of this documentation. For up-to-date information, please have a look at v0.2.
nmraspecds.metadata module
metadata module of the nmraspecds package.
- class nmraspecds.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 NMR. 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.
..note
Not all parameters are yet taken into account, only the most important ones, that are needed for processing and analysis that are already implemented.
- spectrometer
Hardware configuration and details of the setup.
- Type:
- experiment
Experimental details, such as MAS frequency and pulse sequence.
- Type:
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
- Parameters:
dict (
dict
) –Dictionary with metadata.
Each key of this dictionary corresponds to a class attribute and is in itself a dictionary with the correct set of attributes for the particular class.
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.
- class nmraspecds.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
- container
Type and dimension of the sample container (tube or rotor) used.
- Type:
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
If a property is of class
aspecd.metadata.PhysicalQuantity
, it is set accordingly.- Parameters:
dict (
dict
) – Dictionary containing properties to set
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.
- class nmraspecds.metadata.SampleContainer(dict_=None)
Bases:
Metadata
Details on the sample containing container.
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
If a property is of class
aspecd.metadata.PhysicalQuantity
, it is set accordingly.- Parameters:
dict (
dict
) – Dictionary containing properties to set
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.
- class nmraspecds.metadata.Spectrometer(dict_=None)
Bases:
Metadata
Metadata information on what type of spectrometer was used.
- Parameters:
dict (
dict
) – Dictionary containing properties to set.
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
If a property is of class
aspecd.metadata.PhysicalQuantity
, it is set accordingly.- Parameters:
dict (
dict
) – Dictionary containing properties to set
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.
- class nmraspecds.metadata.Probehead(dict_=None)
Bases:
Metadata
Metadata corresponding to the probehead.
- 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:
- configuration
Listing of additional coils and capacitors to change the probes’ frequency.
- Type:
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
If a property is of class
aspecd.metadata.PhysicalQuantity
, it is set accordingly.- Parameters:
dict (
dict
) – Dictionary containing properties to set
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.
- class nmraspecds.metadata.Experiment(dict_=None)
Bases:
Metadata
Metadata corresponding to the experiment.
- spectrometer_frequency
Current spectrometer frequency of the dataset.
Current spectrometer frequency (“SF” in Bruker’s Topspin) of the dataset. Is different from the transmitter frequency (and independent of it) depending on the axis. The value is obtained after referencing the measurement.
- add_nucleus(nucleus)
- property spectrum_reference
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
If a property is of class
aspecd.metadata.PhysicalQuantity
, it is set accordingly.- Parameters:
dict (
dict
) – Dictionary containing properties to set
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.
- class nmraspecds.metadata.Nucleus(dict_=None)
Bases:
Metadata
Metadata to describe the observed nucleus.
The here mentioned frequencies are the settings given in the pulse program: The base frequency of the nucleus that corresponds to the current magnetic field (and that needs to get recalibrated from time to time) and the offset if one wants to excite the nucleus with a certain offset and not at 0 ppm.
- base_frequency
Current base frequency of a given nucleus.
- offset_hz
Offset of the nucleus’ frequency, given in Hz. (O1 in Buker’s Topspin)
- property transmitter_frequency
Actual frequency of the pulses of the given nucleus.
- Returns:
transmitter_frequency
- Return type:
- property offset_ppm
Offset of the pulse in ppm (O1p in Bruker’s Topspin)
- Returns:
offset_ppm
- Return type:
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
If a property is of class
aspecd.metadata.PhysicalQuantity
, it is set accordingly.- Parameters:
dict (
dict
) – Dictionary containing properties to set
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.
- class nmraspecds.metadata.Rotor(dict_=None)
Bases:
SampleContainer
Details on the rotor used for the experiment.
- diameter
Outer diameter of the rotor in mm
- Type:
aspecd:metadata:PhysicalQuantity
- from_dict(dict_=None)
Set properties from dictionary, e.g., from metadata.
Only parameters in the dictionary that are valid properties of the class are set accordingly.
Keys in the dictionary are converted to lower case and spaces converted to underscores to fit the naming scheme of attributes.
If a property is of class
aspecd.metadata.PhysicalQuantity
, it is set accordingly.- Parameters:
dict (
dict
) – Dictionary containing properties to set
- to_dict(remove_empty=False)
Create dictionary containing public attributes of an object.
- Parameters:
remove_empty (
bool
) –Whether to remove keys with empty values
Default: False
- Returns:
public_attributes – Ordered dictionary containing the public attributes of the object
The order of attribute definition is preserved
- Return type:
Changed in version 0.6: New parameter remove_empty
Changed in version 0.9: Settings for properties to exclude and include are not traversed
Changed in version 0.9.1: Dictionaries get copied before traversing, as otherwise, the special variables
__dict__
and__0dict__
are modified, what may result in strange behaviour.Changed in version 0.9.2: Dictionaries do not get copied by default, but there is a private method that can be overridden in derived classes to copy the dictionary.