16
16
from sans .state .StateObjects .StateMaskDetectors import get_mask_builder , StateMaskDetectors
17
17
from sans .state .StateObjects .StateMoveDetectors import get_move_builder
18
18
from sans .state .StateObjects .StateNormalizeToMonitor import get_normalize_to_monitor_builder
19
+ from sans .state .StateObjects .StatePolarization import StatePolarization
19
20
from sans .state .StateObjects .StateReductionMode import StateReductionMode
20
21
from sans .state .StateObjects .StateSave import StateSave
21
22
from sans .state .StateObjects .StateScale import StateScale
@@ -73,6 +74,9 @@ def get_state_normalize_to_monitor(self, _):
73
74
def get_state_reduction_mode (self ):
74
75
return self ._implementation .reduction_mode
75
76
77
+ def get_state_polarization (self ):
78
+ return self ._implementation .polarization
79
+
76
80
def get_state_save (self ):
77
81
return StateSave ()
78
82
@@ -112,6 +116,7 @@ def parse_all(self):
112
116
self ._parse_transmission ()
113
117
self ._parse_transmission_roi ()
114
118
self ._parse_transmission_fitting ()
119
+ self ._parse_polarization ()
115
120
116
121
@property
117
122
def instrument (self ):
@@ -134,6 +139,7 @@ def _create_state_objs(self, data_info):
134
139
self .scale = StateScale ()
135
140
self .wavelength = StateWavelength ()
136
141
self .wavelength_and_pixel = get_wavelength_and_pixel_adjustment_builder (data_info = data_info ).build ()
142
+ self .polarization = StatePolarization ()
137
143
138
144
# Ensure they are linked up correctly
139
145
self .adjustment .calculate_transmission = self .calculate_transmission
@@ -511,6 +517,13 @@ def _parse_mask(self):
511
517
if "stop" in phi_mask :
512
518
self .mask .phi_max = phi_mask ["stop" ]
513
519
520
+ def _parse_polarization (self ):
521
+ polarization_dict = self .get_val ("polarization" )
522
+ if polarization_dict is None :
523
+ return
524
+ self .polarization .flipper_configuration = self .get_val ("flipper_configuration" , polarization_dict )
525
+ self .polarization .spin_configuration = self .get_val ("spin_configuration" , polarization_dict )
526
+
514
527
@staticmethod
515
528
def _get_1d_min_max (one_d_binning : str ):
516
529
# TODO: We have to do some special parsing for this type on behalf of the sans codebase
0 commit comments