.. only:: html
.. note::
:class: sphx-glr-download-link-note
Click :ref:`here ` to download the full example code or to run this example in your browser via Binder
.. rst-class:: sphx-glr-example-title
.. _sphx_glr_examples_1D_simulation(crystalline)_plot_3_quad_csa.py:
Non-coincidental Quad and CSA, 17O (I=5/2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17O (I=5/2) quadrupolar static spectrum simulation.
The following example illustrates the simulation of NMR spectra arising from
non-coincidental quadrupolar and shielding tensors. The tensor parameter values for
the simulation are obtained from Yamada `et. al.` [#f1]_, for the
:math:`^{17}\text{O}` site in benzanilide.
.. warning::
The Euler angles representation using by Yamada `et. al` is different from the
representation used in mrsimulator. The resulting simulation might not resemble
the published spectrum.
.. code-block:: python
import matplotlib as mpl
import matplotlib.pyplot as plt
from mrsimulator import Simulator, SpinSystem, Site
from mrsimulator.methods import BlochDecayCentralTransitionSpectrum
import numpy as np
# global plot configuration
mpl.rcParams["figure.figsize"] = [4.5, 3.0]
**Step 1:** Create the spin system.
.. code-block:: python
site = Site(
isotope="17O",
isotropic_chemical_shift=320, # in ppm
shielding_symmetric={"zeta": 376.667, "eta": 0.345},
quadrupolar={
"Cq": 8.97e6, # in Hz
"eta": 0.15,
"alpha": 5 * np.pi / 180,
"beta": np.pi / 2,
"gamma": 70 * np.pi / 180,
},
)
spin_system = SpinSystem(sites=[site])
**Step 2:** Create a central transition selective Bloch decay spectrum method.
.. code-block:: python
method = BlochDecayCentralTransitionSpectrum(
channels=["17O"],
magnetic_flux_density=11.74, # in T
rotor_frequency=0, # in Hz
spectral_dimensions=[
{
"count": 1024,
"spectral_width": 1e5, # in Hz
"reference_offset": 22500, # in Hz
"label": r"$^{17}$O resonances",
}
],
)
**Step 3:** Create the Simulator object and add method and spin system objects.
.. code-block:: python
sim = Simulator()
sim.spin_systems = [spin_system] # add the spin system
sim.methods = [method] # add the method
# Since the spin system have non-zero Euler angles, set the integration_volume to
# hemisphere.
sim.config.integration_volume = "hemisphere"
**Step 4:** Simulate the spectrum.
.. code-block:: python
sim.run()
# The plot of the simulation before signal processing.
ax = plt.subplot(projection="csdm")
ax.plot(sim.methods[0].simulation.real, color="black", linewidth=1)
ax.invert_xaxis()
plt.tight_layout()
plt.show()
.. image:: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_3_quad_csa_001.png
:alt: plot 3 quad csa
:class: sphx-glr-single-img
.. [#f1] Yamada, K., Dong, S., Wu, G., Solid-State 17O NMR Investigation of the
Carbonyl Oxygen Electric-Field-Gradient Tensor and Chemical Shielding Tensor in
Amides, J. Am. Chem. Soc. 2000, **122**, 11602-11609.
`DOI: 10.1021/ja0008315 `_
.. rst-class:: sphx-glr-timing
**Total running time of the script:** ( 0 minutes 0.221 seconds)
.. _sphx_glr_download_examples_1D_simulation(crystalline)_plot_3_quad_csa.py:
.. only :: html
.. container:: sphx-glr-footer
:class: sphx-glr-footer-example
.. container:: binder-badge
.. image:: images/binder_badge_logo.svg
:target: https://mybinder.org/v2/gh/DeepanshS/mrsimulator/master?urlpath=lab/tree/docs/_build/html/../../notebooks/examples/1D_simulation(crystalline)/plot_3_quad_csa.ipynb
:alt: Launch binder
:width: 150 px
.. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_3_quad_csa.py `
.. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_3_quad_csa.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_