.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/2D_simulation(crystalline)/plot_5_COASTER_Rb2CrO4.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_5_COASTER_Rb2CrO4.py: Rb₂CrO₄, ⁸⁷Rb (I=3/2) COASTER ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ⁸⁷Rb (I=3/2) Correlation of anisotropies separated through echo refocusing (COASTER) simulation. .. GENERATED FROM PYTHON SOURCE LINES 10-14 The following is a Correlation of Anisotropies Separated Through Echo Refocusing (COASTER) simulation of :math:`\text{Rb}_2\text{CrO}_4`. The Rb site with the smaller quadrupolar interaction is selectively observed and reported by Ash `et al.` [#f1]_. The following is the simulation based on the published tensor parameters. .. GENERATED FROM PYTHON SOURCE LINES 14-23 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from mrsimulator import Simulator, SpinSystem, Site from mrsimulator import signal_processor as sp from mrsimulator.spin_system.tensors import SymmetricTensor from mrsimulator.method import Method, SpectralDimension, SpectralEvent, MixingEvent .. GENERATED FROM PYTHON SOURCE LINES 25-26 Generate the site and spin system objects. .. GENERATED FROM PYTHON SOURCE LINES 26-40 .. code-block:: Python site = Site( isotope="87Rb", isotropic_chemical_shift=-9, # in ppm shielding_symmetric=SymmetricTensor(zeta=110, eta=0), quadrupolar=SymmetricTensor( Cq=3.5e6, # in Hz eta=0.36, alpha=0, # in rads beta=70 * 3.14159 / 180, # in rads gamma=0, # in rads ), ) spin_system = SpinSystem(sites=[site]) .. GENERATED FROM PYTHON SOURCE LINES 41-48 Use the generic `Method` class to simulate a 2D COASTER spectrum by customizing the method parameters, as shown below. By default, all transitions selected from a `SpectralEvent` connect to all selected transitions from the following `SpectralEvent` if no `MixingEvent` is defined between them. Here, we define a `MixingEvent` with an angle of 109.5 degrees to connect the 3Q to 1Q transitions. .. GENERATED FROM PYTHON SOURCE LINES 48-82 .. code-block:: Python coaster = Method( name="COASTER", channels=["87Rb"], magnetic_flux_density=9.4, # in T rotor_angle=70.12 * np.pi / 180, # in rads rotor_frequency=np.inf, spectral_dimensions=[ SpectralDimension( count=512, spectral_width=4e4, # in Hz reference_offset=-8e3, # in Hz label="$\\omega_1$ (CSA)", events=[ SpectralEvent(transition_queries=[{"ch1": {"P": [3], "D": [0]}}]), MixingEvent(query={"ch1": {"angle": np.pi * 109.5 / 180, "phase": 0}}), ], ), # The last spectral dimension block is the direct-dimension SpectralDimension( count=512, spectral_width=8e3, # in Hz reference_offset=-4e3, # in Hz label="$\\omega_2$ (Q)", events=[SpectralEvent(transition_queries=[{"ch1": {"P": [-1], "D": [0]}}])], ), ], affine_matrix=[[1, 0], [1 / 4, 3 / 4]], ) # A graphical representation of the method object. plt.figure(figsize=(5, 2.75)) coaster.plot() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_5_COASTER_Rb2CrO4_001.png :alt: COASTER :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_5_COASTER_Rb2CrO4_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 83-85 Create the Simulator object, add the method and spin system objects, and run the simulation. .. GENERATED FROM PYTHON SOURCE LINES 85-92 .. code-block:: Python sim = Simulator(spin_systems=[spin_system], methods=[coaster]) # configure the simulator object. For non-coincidental tensors, set the value of the # `integration_volume` attribute to `hemisphere`. sim.config.integration_volume = "hemisphere" sim.run() .. GENERATED FROM PYTHON SOURCE LINES 93-94 The plot of the simulation. .. GENERATED FROM PYTHON SOURCE LINES 94-105 .. 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.set_xlim(-0, -55) ax.set_ylim(80, -180) plt.tight_layout() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_5_COASTER_Rb2CrO4_002.png :alt: plot 5 COASTER Rb2CrO4 :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_5_COASTER_Rb2CrO4_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 106-107 Add post-simulation signal processing. .. GENERATED FROM PYTHON SOURCE LINES 107-119 .. code-block:: Python processor = sp.SignalProcessor( operations=[ # Gaussian convolution along both dimensions. sp.IFFT(dim_index=(0, 1)), sp.apodization.Gaussian(FWHM="0.15 kHz", dim_index=0), sp.apodization.Gaussian(FWHM="0.15 kHz", dim_index=1), sp.FFT(dim_index=(0, 1)), ] ) processed_dataset = processor.apply_operations(dataset=dataset) processed_dataset /= processed_dataset.max() .. GENERATED FROM PYTHON SOURCE LINES 120-121 The plot of the simulation after signal processing. .. GENERATED FROM PYTHON SOURCE LINES 121-130 .. 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(-0, -55) ax.set_ylim(80, -180) plt.tight_layout() plt.show() .. image-sg:: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_5_COASTER_Rb2CrO4_003.png :alt: plot 5 COASTER Rb2CrO4 :srcset: /examples/2D_simulation(crystalline)/images/sphx_glr_plot_5_COASTER_Rb2CrO4_003.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 131-135 .. [#f1] Jason T. Ash, Nicole M. Trease, and Philip J. Grandinetti. Separating Chemical Shift and Quadrupolar Anisotropies via Multiple-Quantum NMR Spectroscopy, J. Am. Chem. Soc. (2008) **130**, 10858-10859. `DOI: 10.1021/ja802865x `_ .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.157 seconds) .. _sphx_glr_download_examples_2D_simulation(crystalline)_plot_5_COASTER_Rb2CrO4.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_5_COASTER_Rb2CrO4.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_5_COASTER_Rb2CrO4.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_