Skip to content

Commit 03c281b

Browse files
committed
Add StateField class
RE mantidproject#38524
1 parent 1cf6c28 commit 03c281b

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

scripts/SANS/sans/state/StateObjects/StatePolarization.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mantid Repository : https://github.com/mantidproject/mantid
22
#
3-
# Copyright © 2023 ISIS Rutherford Appleton Laboratory UKRI,
3+
# Copyright © 2025 ISIS Rutherford Appleton Laboratory UKRI,
44
# NScD Oak Ridge National Laboratory, European Spallation Source,
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
@@ -56,12 +56,31 @@ def __init__(self):
5656
self.initial_polarization = None
5757

5858

59+
class StateField(metaclass=JsonSerializable):
60+
sample_strength_log: None | str
61+
sample_direction_log: None | str
62+
63+
sample_direction_a: None | int
64+
sample_direction_p: None | int
65+
sample_direction_d: None | int
66+
67+
def __init__(self):
68+
super(StateField, self).__init__()
69+
self.sample_strength_log = None
70+
self.sample_direction_log = None
71+
self.sample_direction_a = None
72+
self.sample_direction_p = None
73+
self.sample_direction_d = None
74+
75+
5976
class StatePolarization(metaclass=JsonSerializable):
6077
flipper_configuration: None | str
6178
spin_configuration: None | str
6279
flippers: list[StateComponent]
6380
polarizer: None | StateFilter
6481
analyzer: None | StateFilter
82+
magnetic_field: None | StateField
83+
electric_field: None | StateField
6584

6685
def __init__(self):
6786
super(StatePolarization, self).__init__()
@@ -70,3 +89,5 @@ def __init__(self):
7089
self.analyzer = None
7190
self.polarizer = None
7291
self.flippers = []
92+
self.magnetic_field = None
93+
self.electric_field = None

0 commit comments

Comments
 (0)