Beispiel #1
0
 def test_loop_measure_all_channels(self):
     p1 = ManualParameter(name='p1', vals=Numbers(-10, 10))
     loop = Loop(p1.sweep(-10, 10, 1),
                 1e-6).each(self.instrument.channels.temperature)
     data = loop.run()
     self.assertEqual(data.p1_set.ndarray.shape, (21, ))
     self.assertEqual(len(data.arrays), 7)
     for chan in ['A', 'B', 'C', 'D', 'E', 'F']:
         self.assertEqual(
             getattr(data, 'testchanneldummy_Chan{}_temperature'.format(
                 chan)).ndarray.shape, (21, ))
Beispiel #2
0
 def test_loop_measure_channels_by_name(self, values):
     p1 = ManualParameter(name='p1', vals=Numbers(-10, 10))
     for i in range(4):
         self.instrument.channels[i].temperature(values[i])
     loop = Loop(p1.sweep(-10, 10, 1),
                 1e-6).each(self.instrument.A.temperature,
                            self.instrument.B.temperature,
                            self.instrument.C.temperature,
                            self.instrument.D.temperature)
     data = loop.run()
     self.assertEqual(data.p1_set.ndarray.shape, (21, ))
     for i, chan in enumerate(['A', 'B', 'C', 'D']):
         self.assertEqual(
             getattr(data, 'testchanneldummy_Chan{}_temperature'.format(
                 chan)).ndarray.shape, (21, ))
         self.assertEqual(
             getattr(data, 'testchanneldummy_Chan{}_temperature'.format(
                 chan)).ndarray.max(), values[i])
         self.assertEqual(
             getattr(data, 'testchanneldummy_Chan{}_temperature'.format(
                 chan)).ndarray.min(), values[i])