示例#1
0
        def lockin_measure():
            time.sleep(self.tc_delay)
            return np.mean([self.lock.ch1 for i in range(self.averages)])

        self.frequency.set_method(self.lock.set_frequency)
        self.noise.set_method(lockin_measure)

    def instruments_shutdown(self):
        self.lock.channel_1_type = 'X'


if __name__ == '__main__':

    proc = FieldTest()

    # Define a sweep over prarameters
    sw = Sweep(proc)
    values = np.append(
        np.append(np.arange(0.1, 105, 5), np.arange(200, 1100, 50)),
        np.arange(2000, 7000, 500)).tolist()
    sw.add_parameter_hack(proc.frequency, values)

    # Define a writer
    sw.add_writer('SweepFrequency.h5', 'NoiseVsFreq-30ms', proc.noise)

    proc.instruments_init()
    for i in sw:
        logging.info("Freq, Noise: %f, %g" %
                     (proc.frequency.value, proc.noise.value))
    proc.instruments_shutdown()
示例#2
0
        for param in self._parameters:
            self._parameters[param].push()
        for quant in self._quantities:
            self._quantities[quant].measure()

    def instruments_shutdown(self):
        self.bop.current = 0.0


if __name__ == '__main__':

    proc = CurrentLoop()
    proc.field.value = 390.0

    # Define a sweep over prarameters
    sw = Sweep(proc)
    values = np.append(np.arange(-3.0, 3.01, 0.1), np.arange(3.0, -3.01,
                                                             -0.1)).tolist()
    sw.add_parameter(proc.dc_bias, values)

    # Define a writer
    sw.add_writer('data/CurrentLoops.h5', 'SWS2129(2,0)G-(011,09)', 'Loop',
                  proc.voltage)
    # sw.add_writer('data/CurrentLoops.h5', 'Test', proc.voltage)

    proc.instruments_init()
    for i in sw:
        logging.info("Bias (V), Lockin Magnitude (V): {:f}, {:g}".format(
            proc.dc_bias.value, proc.voltage.value))
    proc.instruments_shutdown()