# example, instead of creating 130 spin systems, we download the spin systems from
# a remote file and load it directly to the Simulator object.
import matplotlib.pyplot as plt

from mrsimulator import Simulator
from mrsimulator.methods import BlochDecaySpectrum
from mrsimulator import signal_processing as sp

# sphinx_gallery_thumbnail_number = 1

# %%
# Create the Simulator object and load the spin systems from an external file.
sim = Simulator()

file_ = "https://sandbox.zenodo.org/record/687656/files/protein_GB1_15N_13CA_13CO.mrsys"
sim.load_spin_systems(file_)  # load the spin systems.
print(f"number of spin systems = {len(sim.spin_systems)}")

# %%
all_sites = sim.sites().to_pd()
all_sites.head()

# %%
# Create a :math:`^{13}\text{C}` Bloch decay spectrum method.
method_13C = BlochDecaySpectrum(
    channels=["13C"],
    magnetic_flux_density=11.74,  # in T
    rotor_frequency=3000,  # in Hz
    spectral_dimensions=[{
        "count": 8192,
        "spectral_width": 5e4,  # in Hz
Exemple #2
0
# :math:`^{17}\text{O}` EFG tensor information from Grandinetti `et al.` [#f1]_
import matplotlib.pyplot as plt

from mrsimulator import Simulator
from mrsimulator.methods import Method2D
from mrsimulator import signal_processing as sp

# sphinx_gallery_thumbnail_number = 2

# %%
# Create the Simulator object and load the spin systems database or url address.
sim = Simulator()

# load the spin systems from url.
filename = "https://sandbox.zenodo.org/record/687656/files/coesite.mrsys"
sim.load_spin_systems(filename)

# %%
# Use the generic 2D method, `Method2D`, to simulate a DAS spectrum by customizing the
# method parameters, as shown below. Note, the Method2D method simulates an infinite
# spinning speed spectrum.
das = Method2D(
    channels=["17O"],
    magnetic_flux_density=11.74,  # in T
    spectral_dimensions=[
        {
            "count":
            256,
            "spectral_width":
            5e3,  # in Hz
            "reference_offset":
import matplotlib.pyplot as plt

from mrsimulator import Simulator
from mrsimulator.method.lib import BlochDecaySpectrum
from mrsimulator.method import SpectralDimension
from mrsimulator import signal_processor as sp

# sphinx_gallery_thumbnail_number = 1

# %%
# Create the Simulator object and load the spin systems from an external file.
sim = Simulator()

host = "https://ssnmr.org/sites/default/files/mrsimulator/"
filename = "protein_GB1_15N_13CA_13CO.mrsys"
sim.load_spin_systems(host + filename)  # load the spin systems.
print(f"number of spin systems = {len(sim.spin_systems)}")

# %%
all_sites = sim.sites().to_pd()
all_sites.head()

# %%
# Create a :math:`^{13}\text{C}` Bloch decay spectrum method.
method_13C = BlochDecaySpectrum(
    channels=["13C"],
    magnetic_flux_density=11.74,  # in T
    rotor_frequency=3000,  # in Hz
    spectral_dimensions=[
        SpectralDimension(
            count=8192,