Exemplo n.º 1
0
    def Measure(self, crv=[], file_name=None, meas_opts=[10, 1, 0.1]):
        fields = numpy.asarray(crv)

        # Initialize data objects
        self.Data.reset()
        self.Data.xlim = [fields.min(), fields.max()]
        sen = self.VC.LockIn.SEN * 1.5 * self.VC.emu_per_V
        self.Data.ylim = [-sen, sen]

        n_pts, iniDelay, measDelay = meas_opts

        # Loop for each field
        for i, h in enumerate(fields):
            self.FC.setField(h)
            while abs(h - self.FC.getField()) > 50:
                self.FC.setField(h)
            #time.sleep(0.5)
            m, sm = self.VC.getMagnetization(n=n_pts,
                                             iniDelay=iniDelay,
                                             measDelay=measDelay)
            self.Data.addPoint(h, m)
            MyPlot(self.Data)
            ThD.check_stop()

        if file_name != None:
            self._SaveData(file_name)
        self.FC.TurnOff()
        self.FC.Kepco.BEEP()
Exemplo n.º 2
0
    def FreqCurve(self, crvf=[], file_name=None, TurnOff=False):
        freqs = numpy.asarray(crvf)

        #Initialize data objects
        self.DataFreq.reset()
        self.DataFreq.xlim = [freqs.min(), freqs.max()]
        sen = self.VC.LockIn.SEN * 1.5 * self.VC.emu_per_V
        self.DataFreq.ylim = [0, sen]

        #Loop for each field
        for i, f in enumerate(freqs):
            self.VC.LockIn.setOscilatorFreq(f)
            #time.sleep(0.5)
            a = self.VC.getAmplitude()
            if a >= 0.9 * self.VC.LockIn.SEN:
                self.VC.LockIn.SEN = 3 * self.VC.LockIn.SEN
                a = self.VC.getAmplitude()
            self.DataFreq.addPoint(f, a * self.VC.emu_per_V)
            FreqPlot(self.DataFreq)
            ThD.check_stop()

        if file_name is not None:
            self._SaveData(file_name)
        if TurnOff:
            self.FC.TurnOff()
        self.FC.Kepco.BEEP()
Exemplo n.º 3
0
    def test_Measure(self, crv=[], file_name=None, meas_opts=[10, 1, 0.1]):

        global t0

        fields = numpy.asarray(crv)
        print("Field cicle for histeresys")
        # Initialize data objects
        self.Data.reset()
        self.Data.ylim = [fields.min(), fields.max()]
        sen = self.VC.LockIn.SEN * 1.5 * self.VC.emu_per_V
        #self.Data.ylim = [-sen, sen]

        n_pts, iniDelay, measDelay = meas_opts

        # Loop for each field
        for i, h in enumerate(fields):
            self.FC.setField(h)
            while abs(h - self.FC.getField(delay=0)) > 30:
                self.FC.setField(h)
            f = self.FC.getField(delay=0)
            t = time.time() - t0
            print(t, '\t', f)
            #time.sleep(0.5)
            #m, sm = self.VC.getMagnetization(n = n_pts, iniDelay = iniDelay, measDelay = measDelay)
            self.Data.addPoint(t, f)
            MyPlot_2(self.Data)
            ThD.check_stop()
        print("Time elapsed: %f min" % ((time.time() - t0) / 60))
        if file_name != None:
            self._SaveData(file_name)
        self.FC.TurnOff()
        self.FC.Kepco.BEEP()
Exemplo n.º 4
0
    def Measure(self, crv, file_name):
        fields = crv
        freqs = self.VNAC.frequencies

        # Initialize data objects
        for D in self.DataCollection:
            D.initialize(fields, freqs, dtype=complex)
        self.DataPlot.initialize(fields, freqs)

        # Loop for each field
        for i, h in enumerate(fields):

            self.FC.setField(h, Tol=0.25, FldStep=0.5)
            # time.sleep(0.5)
            Ss = self._MeasureSpectra()
            for j, S in enumerate(Ss):
                self.DataCollection[j].addColumn(S)
            self.PlotData(i)
            ThD.check_stop()

        if file_name is not None:
            self._SaveData(file_name)
        self.FC.TurnOff()
        self.FC.Kepco.BEEP()