Ejemplo n.º 1
0
    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))
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
 def photon_energy(self, val):
     """ Set the 'photon_energy' parameter to val."""
     self.__photon_energy = checkAndSetPhysicalQuantity(
         val, None, electronvolt)
Ejemplo n.º 4
0
 def pulse_energy(self, val):
     """ Set the 'pulse_energy' parameter to val."""
     self.__pulse_energy = checkAndSetPhysicalQuantity(val, 1.0e-3, joule)
Ejemplo n.º 5
0
 def divergence(self, val):
     """ Set the 'divergence' parameter to val."""
     self.__divergence = checkAndSetPhysicalQuantity(val, 0.0, radian)
Ejemplo n.º 6
0
 def beam_diameter_fwhm(self, val):
     """ Set the 'beam_diameter_fwhm' parameter to val."""
     self.__beam_diameter_fwhm = checkAndSetPhysicalQuantity(
         val, 1.0e-6, meter)
Ejemplo n.º 7
0
 def distance_offset(self, val):
     """ Set the panel distance_offset. """
     self.__distance_offset = checkAndSetPhysicalQuantity(
         val, 0.0 * meter, meter)
Ejemplo n.º 8
0
 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)
Ejemplo n.º 9
0
 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)