Ejemplo n.º 1
0
 def load(self, name):
     state = self._persister.load(name)
     if isinstance(self._persister, UBCalculationJSONPersister):
         self._state = decode_ubcalcstate(
             state, self._geometry, self._get_diffractometer_axes_names())
         self._state.reference.get_UB = self._get_UB
     elif isinstance(self._persister, UBCalculationPersister):
         self._state = state
     else:
         raise Exception('Unexpected persister type: ' +
                         str(self._persister))
     if self._state.manual_U is not None:
         self._U = self._state.manual_U
         self._UB = self._U * self._state.crystal.B
         self.save()
     elif self._state.manual_UB is not None:
         self._UB = self._state.manual_UB
         self.save()
     elif self._state.or0 is not None:
         if self._state.or1 is None:
             self.calculate_UB_from_primary_only()
         else:
             if self._state.reflist:
                 self.calculate_UB()
             elif self._state.orientlist:
                 self.calculate_UB_from_orientation()
             else:
                 pass
     else:
         pass
Ejemplo n.º 2
0
 def load(self, name):
     state = self._persister.load(name)
     self._state = decode_ubcalcstate(state, self._geometry, self._diffractometer_axes_names)
     if self._state.manual_U is not None:
         self.set_U_manually(self._state.manual_U)
     elif self._state.manual_UB is not None:
         self.set_UB_manually(self._state.manual_UB)
     elif self._state.or0 is not None:
         if self._state.or1 is None:
             self.calculate_UB_from_primary_only()
         else:
             self.calculate_UB()
     else:
         pass
Ejemplo n.º 3
0
 def load(self, name):
     state = self._persister.load(name)
     if isinstance(self._persister, UBCalculationJSONPersister):
         self._state = decode_ubcalcstate(state, self._geometry, self._diffractometer_axes_names)
     elif isinstance(self._persister, UBCalculationPersister):
         self._state = state
     else:
         raise Exception('Unexpected persister type: ' + str(self._persister))
     if self._state.manual_U is not None:
         self.set_U_manually(self._state.manual_U)
     elif self._state.manual_UB is not None:
         self.set_UB_manually(self._state.manual_UB)
     elif self._state.or0 is not None:
         if self._state.or1 is None:
             self.calculate_UB_from_primary_only()
         else:
             self.calculate_UB()
     else:
         pass