SpectralDimension¶

class mrsimulator.SpectralDimension(*, property_units: Dict = {'origin_offset': 'Hz', 'reference_offset': 'Hz', 'spectral_width': 'Hz'}, count: mrsimulator.method.spectral_dimension.ConstrainedIntValue = 1024, spectral_width: mrsimulator.method.spectral_dimension.ConstrainedFloatValue = 25000.0, reference_offset: float = 0.0, origin_offset: float = None, label: str = None, description: str = None, events: = [])

Bases: mrsimulator.utils.parseable.Parseable

Base SpectralDimension class defines a spectroscopic dimension of the method.

count

The number of points, $$N$$, along the spectroscopic dimension. The default value is 1024.

Type

int (optional)

spectral_width

The spectral width, $$\Delta x$$, of the spectroscopic dimension in units of Hz. The default value is 25000.

Type

float (optional)

reference_offset

The reference offset, $$x_0$$, of the spectroscopic dimension in units of Hz. The default value is 0.

Type

float (optional)

origin_offset

The origin offset (Larmor frequency) along the spectroscopic dimension in units of Hz. The default value is None. When the value is None, the origin offset is set to the Larmor frequency of the isotope from the channels attribute of the method.

Type

float (optional)

label

The value is a label of the spectroscopic dimension. The default value is None.

Type

str (optional)

description

The value is a description of the spectroscopic dimension. The default value is None.

Type

str (optional)

events

The value describes a series of events along the spectroscopic dimension.

Type

A list of Event or equivalent dict objects (optional).

Method Documentation

classmethod parse_dict_with_units(py_dict: dict)

Parse the physical quantities of a SpectralDimension object from a python dictionary object.

Parameters

py_dict (dict) – Dict object

coordinates_Hz()

The grid coordinates along the dimension in units of Hz, evaluated as

(32)$x_\text{Hz} = \left([0, 1, ... N-1] - T\right) \frac{\Delta x}{N} + x_0$

where $$T=N/2$$ and $$T=(N-1)/2$$ for even and odd values of $$N$$, respectively.

coordinates_ppm()

The grid coordinates along the dimension as dimension frequency ratio in units of ppm. The coordinates are evaluated as

(33)$x_\text{ppm} = \frac{x_\text{Hz}} {x_0 + \omega_0}$

where $$\omega_0$$ is the Larmor frequency.

json() dict

Parse the class object to a JSON compliant python dictionary object, where the attribute value with physical quantity is expressed as a string with a number and a unit.

to_csdm_dimension()

Return the spectral dimension as a CSDM dimension object.