示例#1
0
class TestXrayTube(TestCase):

    def setUp(self):
        self.tube = XRayTube()

    def test_on(self):
        if self.tube.state != 'off':
            self.tube.off().join()

        self.tube.on().join()
        self.assertEqual('on', self.tube.state)
        self.assertRaises(TransitionNotAllowed, self.tube.on().join)

    def test_off(self):
        if self.tube.state != 'on':
            self.tube.on().join()

        self.tube.off().join()
        self.assertEqual('off', self.tube.state)
        self.assertRaises(TransitionNotAllowed, self.tube.off().join)

    def test_power(self):
        self.tube.current = 2 * q.A
        self.tube.voltage = 3 * q.V
        self.assertEqual(self.tube.power, 6 * q.W)
示例#2
0
 def setUp(self):
     Radiography.setUp(self)
     self.source = XRayTube()
     self.exp = XRayTubeRadiography(walker=self.walker,
                                    flat_motor=self.flatfield_axis,
                                    radio_position=0 * q.mm,
                                    flat_position=10 * q.mm,
                                    camera=self.camera,
                                    xray_tube=self.source,
                                    num_flats=5,
                                    num_darks=5,
                                    num_projections=10)
示例#3
0
 def setUp(self):
     SteppedTomography.setUp(self)
     self.source = XRayTube()
     self.exp = XRayTubeSteppedTomography(walker=self.walker,
                                          flat_motor=self.flatfield_axis,
                                          tomography_motor=self.tomo_motor,
                                          radio_position=0 * q.mm,
                                          flat_position=10 * q.mm,
                                          camera=self.camera,
                                          xray_tube=self.source,
                                          num_flats=5,
                                          num_darks=5,
                                          num_projections=10,
                                          angular_range=360 * q.deg,
                                          start_angle=0 * q.deg)
示例#4
0
 def setUp(self):
     ContinuousSpiralTomography.setUp(self)
     self.source = XRayTube()
     self.exp = XRayTubeContinuousSpiralTomography(
         walker=self.walker,
         flat_motor=self.flatfield_axis,
         tomography_motor=self.tomo_motor,
         vertical_motor=self.vertical_motor,
         radio_position=0 * q.mm,
         flat_position=10 * q.mm,
         camera=self.camera,
         xray_tube=self.source,
         start_position_vertical=0 * q.mm,
         vertical_shift_per_tomogram=5 * q.mm,
         sample_height=10 * q.mm,
         num_flats=5,
         num_darks=5,
         num_projections=10,
         angular_range=360 * q.deg,
         start_angle=0 * q.deg)
示例#5
0
 def setUp(self):
     self.tube = XRayTube()
示例#6
0
 def setUp(self):
     self.tube = XRayTube()