Utility functions¶
- mrsimulator.utils.collection.single_site_system_generator(isotopes, isotropic_chemical_shifts=0, shielding_symmetric=None, quadrupolar=None, abundance=None, site_labels=None, site_names=None, site_descriptions=None, rtol=0.001)¶
Generate and return a list of single-site spin systems from the input parameters.
- Parameters
isotopes – A string or a list of site isotopes.
isotropic_chemical_shifts – A float or a list/ndarray of values. The default value is 0.
shielding_symmetric – A shielding symmetric like dict object, where the keyword value can either be a float or a list/ndarray of floats. The default value is None. The allowed keywords are
zeta
,eta
,alpha
,beta
, andgamma
.quadrupolar – A quadrupolar like dict object, where the keyword value can either be a float or a list/ndarray of floats. The default value is None. The allowed keywords are
Cq
,eta
,alpha
,beta
, andgamma
.abundance – A float or a list/ndarray of floats describing the abundance of each spin system.
site_labels – A string or a list of strings each with a site label. The default is None.
site_names – A string or a list of strings each with a site name. The default is None.
site_descriptions – A string or a list of strings each with a site description. Default is None.
rtol – The relative tolerance. This value is used in determining the cutoff abundance given as \(\tt{abundance}_{\tt{cutoff}} = \tt{rtol} * \tt{max(abundance)}.\) The spin systems with abundance below this threshold are ignored.
Note
The parameter value can either be a float or a list/ndarray. If the parameter value is a float, the given value is assigned to the respective parameter in all the spin systems. If the parameter value is a list or ndarray, its ith value is assigned to the respective parameter of the ith spin system. When multiple parameter values are given as lists/ndarrays, the length of all the lists must be the same.
- mrsimulator.utils.get_spectral_dimensions(csdm_object, units=False)¶
Extract the count, spectral_width, and reference_offset parameters, associated with the spectral dimensions of the method, from the CSDM dimension objects.
- Parameters
csdm_object – A CSDM object holding the measurement dataset.
- Returns
A list of dict objects, where each dict containts the count, spectral_width, and reference_offset.