.. 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_STMAS_RbNO3.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_2D_simulation(crystalline)_plot_1_STMAS_RbNO3.py: RbNO₃, ⁸⁷Rb (I=3/2) STMAS ^^^^^^^^^^^^^^^^^^^^^^^^^ ⁸⁷Rb (I=3/2) satellite-transition off magic-angle spinning simulation. .. GENERATED FROM PYTHON SOURCE LINES 9-11 The following is an example of the STMAS simulation of :math:`\text{RbNO}_3`. The :math:`^{87}\text{Rb}` tensor parameters were obtained from Massiot `et al.` [#f1]_. .. GENERATED FROM PYTHON SOURCE LINES 11-20 .. code-block:: default 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 22-23 Generate the site and spin system objects. .. GENERATED FROM PYTHON SOURCE LINES 23-42 .. code-block:: default Rb87_1 = Site( isotope="87Rb", isotropic_chemical_shift=-27.4, # in ppm quadrupolar=SymmetricTensor(Cq=1.68e6, eta=0.2), # Cq is in Hz ) Rb87_2 = Site( isotope="87Rb", isotropic_chemical_shift=-28.5, # in ppm quadrupolar=SymmetricTensor(Cq=1.94e6, eta=1.0), # Cq is in Hz ) Rb87_3 = Site( isotope="87Rb", isotropic_chemical_shift=-31.3, # in ppm quadrupolar=SymmetricTensor(Cq=1.72e6, eta=0.5), # Cq is in Hz ) sites = [Rb87_1, Rb87_2, Rb87_3] # all sites spin_systems = [SpinSystem(sites=[s]) for s in sites] .. GENERATED FROM PYTHON SOURCE LINES 43-48 **Step 2:** 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. Note, STMAS measurements are highly suspectable to rotor angle mismatch. In the following, we show two methods, first set to magic-angle and the second deliberately miss-sets by approximately 0.0059 degrees. .. GENERATED FROM PYTHON SOURCE LINES 48-79 .. code-block:: default angles = [54.7359, 54.73] method = [] for angle in angles: method.append( ST1_VAS( channels=["87Rb"], magnetic_flux_density=7, # in T rotor_angle=angle * 3.14159 / 180, # in rad (magic angle) spectral_dimensions=[ SpectralDimension( count=256, spectral_width=3e3, # in Hz reference_offset=-2.4e3, # in Hz label="Isotropic dimension", ), SpectralDimension( count=512, spectral_width=5e3, # in Hz reference_offset=-4e3, # in Hz label="MAS dimension", ), ], ) ) # A graphical representation of the method object. plt.figure(figsize=(5, 2.5)) method[0].plot() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_STMAS_RbNO3_001.png :alt: ST1_VAS :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_STMAS_RbNO3_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 80-82 Create the Simulator object, add the method and spin system objects, and run the simulation. .. GENERATED FROM PYTHON SOURCE LINES 82-87 .. code-block:: default sim = Simulator() sim.spin_systems = spin_systems # add the spin systems sim.methods = method # add the methods. sim.run() .. GENERATED FROM PYTHON SOURCE LINES 88-89 The plot of the simulation. .. GENERATED FROM PYTHON SOURCE LINES 89-102 .. code-block:: default dataset = [sim.methods[0].simulation, sim.methods[1].simulation] fig, ax = plt.subplots(1, 2, figsize=(8.5, 3), subplot_kw={"projection": "csdm"}) titles = ["STVAS @ magic-angle", "STVAS @ 0.0059 deg off magic-angle"] for i, item in enumerate(dataset): cb1 = ax[i].imshow(item.real / item.real.max(), aspect="auto", cmap="gist_ncar_r") ax[i].set_title(titles[i]) plt.colorbar(cb1, ax=ax[i]) ax[i].invert_xaxis() ax[i].invert_yaxis() plt.tight_layout() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_STMAS_RbNO3_002.png :alt: STVAS @ magic-angle, STVAS @ 0.0059 deg off magic-angle :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_STMAS_RbNO3_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 103-104 Add post-simulation signal processing. .. GENERATED FROM PYTHON SOURCE LINES 104-118 .. code-block:: default processor = sp.SignalProcessor( operations=[ # Gaussian convolution along both dimensions. sp.IFFT(dim_index=(0, 1)), sp.apodization.Gaussian(FWHM="50 Hz", dim_index=0), sp.apodization.Gaussian(FWHM="50 Hz", dim_index=1), sp.FFT(dim_index=(0, 1)), ] ) processed_dataset = [] for item in dataset: processed_dataset.append(processor.apply_operations(dataset=item)) processed_dataset[-1] /= processed_dataset[-1].max() .. GENERATED FROM PYTHON SOURCE LINES 119-120 The plot of the simulation after signal processing. .. GENERATED FROM PYTHON SOURCE LINES 120-129 .. code-block:: default plt.figure(figsize=(4.25, 3.0)) ax = plt.subplot(projection="csdm") cb = ax.imshow(processed_dataset[1].real, cmap="gist_ncar_r", aspect="auto") 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_STMAS_RbNO3_003.png :alt: plot 1 STMAS RbNO3 :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_1_STMAS_RbNO3_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 130-135 .. [#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 1.302 seconds) .. _sphx_glr_download_examples_2D_simulation(crystalline)_plot_1_STMAS_RbNO3.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_1_STMAS_RbNO3.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_1_STMAS_RbNO3.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_