def testCheckAndSetPhysicalQuantity(self): """ """ self.assertEqual(1.0 * meter, checkAndSetPhysicalQuantity(1.0 * meter, None, meter)) self.assertEqual(1.0 * meter, checkAndSetPhysicalQuantity(None, 1.0, meter)) self.assertEqual(1.0 * meter, checkAndSetPhysicalQuantity(None, 1.0 * meter, meter))
def energy_response(self, val): """ Set the panel energy_response. """ if val is not None: val = checkAndSetPhysicalQuantity(val, None, 1. / electronvolt) self.__energy_response = val # Invalidate photon response. if val is not None and self.__photon_response is not None: self.__photon_response = None
def photon_energy(self, val): """ Set the 'photon_energy' parameter to val.""" self.__photon_energy = checkAndSetPhysicalQuantity( val, None, electronvolt)
def pulse_energy(self, val): """ Set the 'pulse_energy' parameter to val.""" self.__pulse_energy = checkAndSetPhysicalQuantity(val, 1.0e-3, joule)
def divergence(self, val): """ Set the 'divergence' parameter to val.""" self.__divergence = checkAndSetPhysicalQuantity(val, 0.0, radian)
def beam_diameter_fwhm(self, val): """ Set the 'beam_diameter_fwhm' parameter to val.""" self.__beam_diameter_fwhm = checkAndSetPhysicalQuantity( val, 1.0e-6, meter)
def distance_offset(self, val): """ Set the panel distance_offset. """ self.__distance_offset = checkAndSetPhysicalQuantity( val, 0.0 * meter, meter)
def distance_from_interaction_plane(self, val): """ Set the panel distance_from_interaction_plane. """ self.__distance_from_interaction_plane = checkAndSetPhysicalQuantity( val, 0.1 * meter, meter)
def pixel_size(self, val): """ Set the panel pixel_size. """ self.__pixel_size = checkAndSetPhysicalQuantity( val, 1.0e-4 * meter, meter)
def crystal_size_max(self, val): """ Set the 'crystal_size_max' parameter to val.""" # Check if iterable. self.__crystal_size_max = checkAndSetPhysicalQuantity(val, None, meter)