You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I built a signal processor that includes an affine shear and scale transformation. When I use make_LMFIT_params, the affine scale factor is included in the fit parameters, but this parameter is not one that should be fitted for. Can we change the default behavior to exclude this parameter from the list, or change it to not vary by default?
To Reproduce
Sample code:
from mrsimulator import Site, SpinSystem, Simulator
from mrsimulator import Method, SpectralDimension
from mrsimulator.method import SpectralEvent
from mrsimulator import signal_processor as sp
import numpy as np
mqmas = Method(
channels=["87Rb"],
magnetic_flux_density = 9.373412440496665, #in T
rotor_frequency= np.inf, # in Hz
spectral_dimensions= [
SpectralDimension(
count = 1079,
spectral_width = 12500,
reference_offset = -12931.260000005364,
origin_offset = 131077732.42,
label="3Q",
events=[
SpectralEvent(transition_queries = [{"ch1": {"P": [-3], "D":[0]}}])
]
),
SpectralDimension(
count = 1024,
spectral_width = 25000,
reference_offset = -4310.420000001788,
origin_offset = 131077732.42,
label="1Q",
events=[
SpectralEvent(transition_queries = [{"ch1":{"P":[-1], "D":[0]}}])
]
)
],
)
site1 = Site(
isotope="87Rb",
isotropic_chemical_shift=-31, # ppm
quadrupolar={"Cq": 1.7e6, "eta": 0.58}, # Cq in Hz
)
sites = [site1]
RbNO3_spin_systems = [SpinSystem(sites=[s]) for s in sites]
sim = Simulator(spin_systems=RbNO3_spin_systems, methods=[mqmas])
processor = sp.SignalProcessor(operations=[
# broadening and scaling
sp.IFFT(dim_index=(0, 1)),
sp.apodization.Gaussian(FWHM="0.05 kHz", dim_index=0),
sp.apodization.Gaussian(FWHM="0.1 kHz", dim_index=1),
sp.FFT(dim_index=(0, 1)),
sp.Scale(factor=5e8),
# first shear
sp.IFFT(dim_index=1),
sp.affine.Shear(factor='-21/27', dim_index=0, parallel=1), #applying to zero
sp.IFFT(dim_index=0),
sp.affine.Scale(factor=48/27, dim_index=1),
sp.FFT(dim_index=0),
sp.FFT(dim_index=1),
]
)
from mrsimulator.utils import spectral_fitting as sf
fit_parameters = sf.make_LMFIT_params(sim, processor)
print(fit_parameters.pretty_print(columns=["value", "min", "max", "vary", "expr"]))
Desktop (please complete the following information):
OS: Windows
Python version: 3.9.18
mrsimulator version: 0.8.0
The text was updated successfully, but these errors were encountered:
I built a signal processor that includes an affine shear and scale transformation. When I use make_LMFIT_params, the affine scale factor is included in the fit parameters, but this parameter is not one that should be fitted for. Can we change the default behavior to exclude this parameter from the list, or change it to not vary by default?
To Reproduce
Sample code:
Desktop (please complete the following information):
mrsimulator
version: 0.8.0The text was updated successfully, but these errors were encountered: