Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #379

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading