Skip to content

Commit

Permalink
update docs Mixing->Rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanshs committed Sep 30, 2024
1 parent f89282e commit 51b1be8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions docs/user_guide/simulator/simulator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ number of gamma angles.
(right) Accurate simulation from a sufficiently large number of gamma angle averaging.

from mrsimulator.method import Method
from mrsimulator.method.event import SpectralEvent, MixingEvent
from mrsimulator.method.event import SpectralEvent, RotationEvent

site = Site(isotope="29Si", shielding_symmetric={"zeta": 100, "eta": 0.2})
spin_system = SpinSystem(sites=[site])
Expand All @@ -286,7 +286,7 @@ number of gamma angles.
spectral_width=25000,
events=[
SpectralEvent(fraction=0.5, transition_queries=[{"ch1": {"P": [-1]}}]),
MixingEvent(ch1={"angle": np.pi / 2}),
RotationEvent(ch1={"angle": np.pi / 2}),
SpectralEvent(fraction=0.5, transition_queries=[{"ch1": {"P": [-1]}}]),
]
)],
Expand All @@ -307,15 +307,15 @@ Decompose Spectrum
''''''''''''''''''

The attribute :py:attr:`~mrsimulator.simulator.ConfigSimulator.decompose_spectrum`
is an enumeration with two string literals, ``None`` and ``spin_system``. The default value is ``None``.
is an enumeration with two string literals, ``none`` and ``spin_system``. The default value is ``none``.

If the value is ``None`` (default), the resulting simulation is a single spectrum
If the value is ``none`` (default), the resulting simulation is a single spectrum
where the frequency contributions from all the spin systems are co-added. Consider the example below.
When the value of :py:attr:`~mrsimulator.simulator.ConfigSimulator.decompose_spectrum`
is ``spin_system``, the resulting simulation is a series of subspectra corresponding to
individual spin systems. The number of subspectra equals the number of spin systems
within the Simulator instance. Consider the same system as above, now run with
decompose_spectrum as ``spin_system``.
within the Simulator instance. Consider the following example with two spin systems simulated with decompose_spectrum attribute set to default ``none`` and ``spin_system``.

.. skip: next
.. plot::
Expand Down
4 changes: 2 additions & 2 deletions src/mrsimulator/method/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def parse_dict_to_ev_class(py_dict: dict):
(dict) py_dict: JSON representation of the Event class as a dictionary
Returns:
Either a SpectralEvent, DelayEvent, or MixingEvent object
Either a SpectralEvent, DelayEvent, or RotationEvent object
"""
if "duration" in py_dict:
return DelayEvent.parse_dict_with_units(py_dict)

if "ch1" in py_dict or "ch2" in py_dict or "ch3" in py_dict:
return MixingEvent.parse_dict_with_units(py_dict)
return RotationEvent.parse_dict_with_units(py_dict)

return SpectralEvent.parse_dict_with_units(py_dict)

Expand Down

0 comments on commit 51b1be8

Please sign in to comment.