.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/2D_simulation(crystalline)/plot_2_STMAS_quad_shield_cross.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_2D_simulation(crystalline)_plot_2_STMAS_quad_shield_cross.py: Co59 (I=7/2) STMAS ^^^^^^^^^^^^^^^^^^ Co59 (I=7/2) satellite-transition magic-angle spinning simulation. (Quad-csa cross terms) .. GENERATED FROM PYTHON SOURCE LINES 11-21 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from mrsimulator import Simulator, SpinSystem, Site from mrsimulator.method.lib import ST1_VAS from mrsimulator import signal_processor as sp from mrsimulator.spin_system.tensors import SymmetricTensor from mrsimulator.method import SpectralDimension .. GENERATED FROM PYTHON SOURCE LINES 23-24 Generate the site and spin system objects. .. GENERATED FROM PYTHON SOURCE LINES 24-61 .. code-block:: Python Co_sites = [ Site( isotope="59Co", # 59Co isotropic_chemical_shift=0, # in ppm shielding_symmetric=SymmetricTensor(zeta=-1750, eta=1), quadrupolar=SymmetricTensor(Cq=3.1e6, eta=1), # Cq is in Hz name="$\\alpha=\\beta=\\gamma=0$", ), Site( isotope="59Co", # 59Co isotropic_chemical_shift=0, # in ppm shielding_symmetric=SymmetricTensor(zeta=-1750, eta=1), quadrupolar=SymmetricTensor(Cq=3.1e6, eta=1, beta=np.pi / 2), # Cq is in Hz name="$\\beta=90, \\alpha=\\gamma=0$", ), Site( isotope="59Co", # 59Co isotropic_chemical_shift=0, # in ppm shielding_symmetric=SymmetricTensor(zeta=-1750, eta=1), quadrupolar=SymmetricTensor( Cq=3.1e6, eta=1, alpha=np.pi / 2, beta=np.pi / 2 ), # Cq is in Hz name="$\\alpha=\\beta=90, \\gamma=0$", ), Site( isotope="59Co", # 59Co isotropic_chemical_shift=0, # in ppm shielding_symmetric=SymmetricTensor(zeta=-1750, eta=1), quadrupolar=SymmetricTensor( Cq=3.1e6, eta=1, alpha=np.pi / 2, beta=np.pi / 2, gamma=np.pi / 2 ), # Cq is in Hz name="$\\alpha=\\beta=\\gamma=90$", ), ] spin_systems = [SpinSystem(sites=[site], name=site.name) for site in Co_sites] .. GENERATED FROM PYTHON SOURCE LINES 62-65 Select a satellite-transition variable-angle spinning method. The following `ST1_VAS` method correlates the frequencies from the two inner-satellite transitions to the central transition. .. GENERATED FROM PYTHON SOURCE LINES 65-90 .. code-block:: Python method = ST1_VAS( channels=["59Co"], magnetic_flux_density=4.684, # in T rotor_angle=54.7359 * 3.14159 / 180, # in rad (magic angle) spectral_dimensions=[ SpectralDimension( count=256, spectral_width=1e3, # in Hz label="Isotropic dimension", ), SpectralDimension( count=512, spectral_width=3e3, # in Hz reference_offset=-1e3, # in Hz label="MAS dimension", ), ], ) # A graphical representation of the method object. plt.figure(figsize=(5, 2.5)) method.plot() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_2_STMAS_quad_shield_cross_001.png :alt: ST1_VAS :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_2_STMAS_quad_shield_cross_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 91-93 Create the Simulator object, add the method and spin system objects, and run the simulation. .. GENERATED FROM PYTHON SOURCE LINES 93-97 .. code-block:: Python sim = Simulator(spin_systems=spin_systems, methods=[method]) sim.config.decompose_spectrum = "spin_system" sim.run() .. GENERATED FROM PYTHON SOURCE LINES 98-99 Add post-simulation signal processing. .. GENERATED FROM PYTHON SOURCE LINES 99-112 .. code-block:: Python dataset = sim.methods[0].simulation processor = sp.SignalProcessor( operations=[ # Gaussian convolution along both dimensions. sp.IFFT(dim_index=(0, 1)), sp.apodization.Gaussian(FWHM="20 Hz", dim_index=0), sp.apodization.Gaussian(FWHM="20 Hz", dim_index=1), sp.FFT(dim_index=(0, 1)), ] ) processed_dataset = processor.apply_operations(dataset=dataset) .. GENERATED FROM PYTHON SOURCE LINES 113-114 The plot of the simulation. .. GENERATED FROM PYTHON SOURCE LINES 114-128 .. code-block:: Python _ = [item.to("kHz", "nmr_frequency_ratio") for item in processed_dataset.x] processed_dataset = processed_dataset.split() fig, ax = plt.subplots( 2, 2, figsize=(6, 4.5), sharex=True, sharey=True, subplot_kw={"projection": "csdm"} ) ax[0, 0].imshow(processed_dataset[0].real, cmap="gist_ncar_r", aspect="auto") ax[0, 1].imshow(processed_dataset[1].real, cmap="gist_ncar_r", aspect="auto") ax[1, 0].imshow(processed_dataset[2].real, cmap="gist_ncar_r", aspect="auto") ax[1, 1].imshow(processed_dataset[3].real, cmap="gist_ncar_r", aspect="auto") ax[0, 0].invert_xaxis() ax[0, 0].invert_yaxis() plt.tight_layout() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_2_STMAS_quad_shield_cross_002.png :alt: $\alpha=\beta=\gamma=0$, $\beta=90, \alpha=\gamma=0$, $\alpha=\beta=90, \gamma=0$, $\alpha=\beta=\gamma=90$ :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_2_STMAS_quad_shield_cross_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.161 seconds) .. _sphx_glr_download_examples_2D_simulation(crystalline)_plot_2_STMAS_quad_shield_cross.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_2_STMAS_quad_shield_cross.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_2_STMAS_quad_shield_cross.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_