.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/2D_simulation(crystalline)/plot_1_MQMAS_albite.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_1_MQMAS_albite.py: Albite, ²⁷Al (I=5/2) 3QMAS ^^^^^^^^^^^^^^^^^^^^^^^^^^ ²⁷Al (I=5/2) triple-quantum magic-angle spinning (3Q-MAS) simulation. .. GENERATED FROM PYTHON SOURCE LINES 9-12 The following is an example of :math:`^{27}\text{Al}` 3QMAS simulation of albite :math:`\text{NaSi}_3\text{AlO}_8`. The :math:`^{27}\text{Al}` tensor parameters were obtained from Massiot `et al.` [#f1]_. .. GENERATED FROM PYTHON SOURCE LINES 12-21 .. code-block:: Python import matplotlib.pyplot as plt from mrsimulator import Simulator, SpinSystem, Site from mrsimulator.method.lib import ThreeQ_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-32 .. code-block:: Python site = Site( isotope="27Al", isotropic_chemical_shift=64.7, # in ppm quadrupolar=SymmetricTensor(Cq=3.25e6, eta=0.68), # Cq is in Hz ) spin_systems = [SpinSystem(sites=[site])] .. GENERATED FROM PYTHON SOURCE LINES 33-35 Select a Triple Quantum variable-angle spinning method. You may optionally provide a `rotor_angle` to the method. The default `rotor_angle` is the magic-angle. .. GENERATED FROM PYTHON SOURCE LINES 35-54 .. code-block:: Python method = ThreeQ_VAS( channels=["27Al"], magnetic_flux_density=7, # in T spectral_dimensions=[ SpectralDimension( count=256, spectral_width=1e4, # in Hz reference_offset=-3e3, # in Hz label="Isotropic dimension", ), SpectralDimension( count=512, spectral_width=1e4, # in Hz reference_offset=4e3, # in Hz label="MAS dimension", ), ], ) .. GENERATED FROM PYTHON SOURCE LINES 55-57 Create the Simulator object, add the method and spin system objects, and run the simulation. .. GENERATED FROM PYTHON SOURCE LINES 57-60 .. code-block:: Python sim = Simulator(spin_systems=spin_systems, methods=[method]) sim.run() .. GENERATED FROM PYTHON SOURCE LINES 61-62 The plot of the simulation. .. GENERATED FROM PYTHON SOURCE LINES 62-73 .. code-block:: Python dataset = sim.methods[0].simulation plt.figure(figsize=(4.25, 3.0)) ax = plt.subplot(projection="csdm") cb = ax.imshow(dataset.real / dataset.real.max(), aspect="auto", cmap="gist_ncar_r") plt.colorbar(cb) ax.invert_xaxis() ax.invert_yaxis() plt.tight_layout() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_MQMAS_albite_001.png :alt: plot 1 MQMAS albite :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_MQMAS_albite_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 74-75 Add post-simulation signal processing. .. GENERATED FROM PYTHON SOURCE LINES 75-87 .. code-block:: Python processor = sp.SignalProcessor( operations=[ # Gaussian convolution along both dimensions. sp.IFFT(dim_index=(0, 1)), sp.apodization.Gaussian(FWHM="0.2 kHz", dim_index=0), sp.apodization.Gaussian(FWHM="0.2 kHz", dim_index=1), sp.FFT(dim_index=(0, 1)), ] ) processed_dataset = processor.apply_operations(dataset=sim.methods[0].simulation) processed_dataset /= processed_dataset.max() .. GENERATED FROM PYTHON SOURCE LINES 88-89 The plot of the simulation after signal processing. .. GENERATED FROM PYTHON SOURCE LINES 89-98 .. code-block:: Python plt.figure(figsize=(4.25, 3.0)) ax = plt.subplot(projection="csdm") cb = ax.imshow(processed_dataset.real, cmap="gist_ncar_r", aspect="auto") plt.colorbar(cb) ax.set_xlim(75, 25) ax.set_ylim(-15, -65) plt.tight_layout() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_MQMAS_albite_002.png :alt: plot 1 MQMAS albite :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_MQMAS_albite_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 99-104 .. [#f1] Massiot, D., Touzoa, B., Trumeaua, D., Coutures, J.P., Virlet, J., Florian, P., Grandinetti, P.J. Two-dimensional magic-angle spinning isotropic reconstruction sequences for quadrupolar nuclei, ssnmr, (1996), **6**, *1*, 73-83. `DOI: 10.1016/0926-2040(95)01210-9 `_ .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.877 seconds) .. _sphx_glr_download_examples_2D_simulation(crystalline)_plot_1_MQMAS_albite.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_1_MQMAS_albite.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_1_MQMAS_albite.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_