Beispiel #1
0
    def get_mca(self, mca=1, with_rois=True):
        if self._xsp3 is None:
            self.connect()
            time.sleep(0.5)

        emca = self._xsp3.mcas[mca - 1]
        if with_rois:
            emca.get_rois()

        counts = self.get_array(mca=mca)
        if max(counts) < 1.0:
            counts = 0.5 * np.ones(len(counts))
            counts[0] = 2.0

        thismca = MCA(counts=counts, offset=0.0, slope=0.01)
        thismca.energy = self.get_energy()
        thismca.counts = counts
        thismca.quad = 0.0
        thismca.rois = []
        if with_rois:
            for eroi in emca.rois:
                thismca.rois.append(
                    ROI(name=eroi.name,
                        address=eroi._prefix,
                        left=eroi.left,
                        right=eroi.right))
        return thismca
Beispiel #2
0
    def get_mca(self, mca=1, with_rois=True):
        """return an MCA object """
        emca = self._xmap.mcas[mca-1]
        if with_rois:
            emca.get_rois()
        counts = self.get_array(mca=mca)
        if max(counts) < 1.0:
            counts    = 0.5*np.ones(len(counts))
            counts[0] = 2.0

        thismca = MCA(counts=counts, offset=emca.CALO, slope=emca.CALS)
        thismca.energy = emca.get_energy()
        thismca.counts = counts
        thismca.real_time = emca.ERTM
        thismca.live_time = emca.ELTM
        thismca.rois = []
        if with_rois:
            for eroi in emca.rois:
                thismca.rois.append(ROI(name=eroi.NM, address=eroi.address,
                                        left=eroi.LO, right=eroi.HI))
        return thismca
Beispiel #3
0
    def get_mca(self, mca=1, with_rois=True):
        """return an MCA object """
        emca = self._xmap.mcas[mca - 1]
        if with_rois:
            emca.get_rois()
        counts = self.get_array(mca=mca)
        if max(counts) < 1.0:
            counts = 0.5 * np.ones(len(counts))
            counts[0] = 2.0

        thismca = MCA(counts=counts, offset=emca.CALO, slope=emca.CALS)
        thismca.energy = emca.get_energy()
        thismca.counts = counts
        thismca.real_time = emca.ERTM
        thismca.live_time = emca.ELTM
        thismca.rois = []
        if with_rois:
            for eroi in emca.rois:
                thismca.rois.append(
                    ROI(name=eroi.NM,
                        address=eroi.address,
                        left=eroi.LO,
                        right=eroi.HI))
        return thismca
Beispiel #4
0
    def get_mca(self, mca=1, with_rois=True):
        if self._xsp3 is None:
            self.connect()
            time.sleep(0.5)

        emca = self._xsp3.mcas[mca-1]
        if with_rois:
            emca.get_rois()

        counts = self.get_array(mca=mca)
        if max(counts) < 1.0:
            counts    = 0.5*np.ones(len(counts))
            counts[0] = 2.0

        thismca = MCA(counts=counts, offset=0.0, slope=0.01)
        thismca.energy = self.get_energy()
        thismca.counts = counts
        thismca.quad   = 0.0
        thismca.rois = []
        if with_rois:
            for eroi in emca.rois:
                thismca.rois.append(ROI(name=eroi.name, address=eroi._prefix,
                                        left=eroi.left, right=eroi.right))
        return thismca