# Simulation
# ----------
sim = Simulator(spin_systems=spin_systems, methods=[DAS])
sim.config.number_of_sidebands = 1  # no sidebands are required for this dataset.
sim.run()

# Post Simulation Processing
# --------------------------
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.1 kHz", dim_index=1),
        sp.FFT(dim_index=(0, 1)),
        sp.Scale(factor=4e7),
    ]
)
processed_data = processor.apply_operations(data=sim.methods[0].simulation).real

# Plot of the guess Spectrum
# --------------------------
plt.figure(figsize=(4.25, 3.0))
ax = plt.subplot(projection="csdm")
ax.contour(experiment, colors="k", **options)
ax.contour(processed_data, colors="r", linestyles="--", **options)
ax.invert_xaxis()
ax.set_ylim(30, -30)
plt.grid()
plt.tight_layout()
plt.show()
# %%
# **Guess Model Spectrum**

# Simulation
# ----------
sim = Simulator(spin_systems=spin_systems, methods=[MAS_CT])
sim.run()

# Post Simulation Processing
# --------------------------
processor = sp.SignalProcessor(operations=[
    sp.IFFT(),
    sp.apodization.Exponential(FWHM="100 Hz"),
    sp.FFT(),
    sp.Scale(factor=200),
])
processed_data = processor.apply_operations(
    data=sim.methods[0].simulation).real

# Plot of the guess Spectrum
# --------------------------
plt.figure(figsize=(4.25, 3.0))
ax = plt.subplot(projection="csdm")
ax.plot(experiment, color="black", linewidth=0.5, label="Experiment")
ax.plot(processed_data, linewidth=2, alpha=0.6, label="Guess Spectrum")
ax.set_xlim(100, -150)
plt.grid()
plt.legend()
plt.tight_layout()
plt.show()
示例#3
0
# %%
# **Step 3:** Create the Simulator object, add the method and spin system objects, and
# run the simulation.
sim = Simulator(spin_systems=[spin_system], methods=[MAS])
sim.run()

# %%
# **Step 4:** Create a SignalProcessor class and apply post simulation processing.
processor = sp.SignalProcessor(operations=[
    sp.IFFT(
    ),  # inverse FFT to convert frequency based spectrum to time domain.
    sp.apodization.Exponential(
        FWHM="200 Hz"),  # apodization of time domain signal.
    sp.FFT(
    ),  # forward FFT to convert time domain signal to frequency spectrum.
    sp.Scale(factor=3),  # scale the frequency spectrum.
])
processed_data = processor.apply_operations(
    data=sim.methods[0].simulation).real

# %%
# **Step 5:** The plot the spectrum. We also plot the synthetic dataset for comparison.
plt.figure(figsize=(4.25, 3.0))
ax = plt.subplot(projection="csdm")
ax.plot(synthetic_experiment, "k", linewidth=1, label="Experiment")
ax.plot(processed_data, "r", alpha=0.75, linewidth=1, label="guess spectrum")
ax.set_xlim(50, -200)
plt.legend()
plt.grid()
plt.tight_layout()
plt.show()
示例#4
0
# Simulation
# ----------
sim = Simulator()
sim.spin_systems = spin_systems  # add the spin systems
sim.methods = [ssb]  # add the method
sim.run()

# Post Simulation Processing
# --------------------------
processor = sp.SignalProcessor(operations=[
    # Lorentzian convolution along the isotropic dimensions.
    sp.FFT(axis=0),
    apo.Exponential(FWHM="50 Hz"),
    sp.IFFT(axis=0),
    sp.Scale(factor=0.6),
])
processed_data = processor.apply_operations(
    data=sim.methods[0].simulation).real

# Plot of the guess Spectrum
# --------------------------
ax = plt.subplot(projection="csdm")
ax.contour(mat_data, colors="k", levels=levels, alpha=0.75)
ax.contour(processed_data,
           colors="r",
           linestyles="--",
           levels=levels,
           alpha=0.75)
ax.set_xlim(200, 10)
plt.grid()
示例#5
0
]
sim.config.decompose_spectrum = "spin_system"

method_1 = BlochDecaySpectrum(
    channels=["1H"],
    magnetic_flux_density=9.4,
    rotor_angle=0,
    rotor_frequency=0,
    spectral_dimensions=[{
        "count": 65536,
        "spectral_width": 25000,
        "reference_offset": 0
    }],
)

PS_0 = [sp.Scale(factor=10)]

PS_1 = [
    sp.IFFT(dim_index=0),
    apo.Exponential(FWHM="200 Hz", dim_index=0, dv_index=0),
    sp.FFT(dim_index=0),
]

sigma = 20 * 2.354820045030949
PS_2 = [
    sp.IFFT(dim_index=0),
    apo.Gaussian(FWHM=f"{sigma} Hz", dim_index=0, dv_index=[0, 1]),
    sp.FFT(dim_index=0),
]

PS_3 = [
# %%
# **Guess Spectrum**

# Simulation
# ----------
sim = Simulator(spin_systems=spin_systems, methods=[PASS])
sim.run()

# Post Simulation Processing
# --------------------------
processor = sp.SignalProcessor(operations=[
    # Lorentzian convolution along the isotropic dimensions.
    sp.FFT(axis=0),
    sp.apodization.Gaussian(FWHM="50 Hz"),
    sp.IFFT(axis=0),
    sp.Scale(factor=1e4),
])
processed_data = processor.apply_operations(
    data=sim.methods[0].simulation).real

# Plot of the guess Spectrum
# --------------------------
plt.figure(figsize=(8, 3.5))
ax = plt.subplot(projection="csdm")
ax.contour(qmat_data.T, colors="k", **options)
ax.contour(processed_data.T, colors="r", linestyles="--", **options)
ax.set_xlim(200, -200)
ax.set_ylim(75, -120)
plt.grid()
plt.tight_layout()
plt.show()