Exemplo n.º 1
0
 def peaksearch(self, frm):
     # -> f.pixels['localmax']
     sparseframe.sparse_localmax(frm)
     # -> f.pixels['connectedpixels']
     sparseframe.sparse_connected_pixels(frm,
                                         threshold=np.finfo(np.float32).min)
     # which localmax peaks overlap each other
     adj = sparseframe.overlaps(frm, 'localmax', frm, 'connectedpixels')
     r, c = self.adj2overlap(adj)
     return frm, r, c
Exemplo n.º 2
0
def newpks(hf):
    """ do a peak search in a sparse frame series """
    blbs = []
    with h5py.File(hf, "r") as h:
        stem = list(h)[0]
        grp = h[stem]
        for g in range(900):
            f = sparseframe.from_hdf_group(grp[str(g)])
            sparseframe.sparse_localmax(f)
            blbs.append(sparseframe.sparse_moments(f, "intensity", "localmax"))
    return stem, blbs
Exemplo n.º 3
0
def newpks(hf, g='measurement/frelon3'):
    """ do a peak search in a sparse frame series """
    blbs = []
    with h5py.File(hf, "r") as h:
        # sort as numbers:
        dsu = [(float(v), v) for v in list(h)]
        dsu.sort()
        for _, scan in dsu:
            print(scan, end=" ")
            sys.stdout.flush()
            if g is None:
                gscan = h[scan]
            else:
                gscan = h[scan][g]
            for fgrp in sorted(list(gscan)):
                f = sparseframe.from_hdf_group(gscan[fgrp])
                sparseframe.sparse_localmax(f)
                blbs.append(
                    sparseframe.sparse_moments(f, "intensity", "localmax"))
    return blbs