Ejemplo n.º 1
0
    def get_projection_operator(self, verbose=True):
        """
        Return the projection operator for the peak sampling.
        Convert units from W to W/sr.

        Parameters
        ----------
        verbose : bool, optional
            If true, display information about the memory allocation.

        """
        f = self.instrument.get_projection_operator
        if len(self.block) == 1:
            return BlockColumnOperator([
                f(self.sampling[b], self.scene, verbose=verbose)
                for b in self.block
            ],
                                       axisout=1)

        # XXX HACK
        def callback(i):
            p = f(self.sampling[self.block[i]], self.scene, verbose=False)
            return p

        shapeouts = [
            (len(self.instrument), s.stop - s.start) + self.scene.shape[1:]
            for s in self.block
        ]
        proxies = proxy_group(len(self.block), callback, shapeouts=shapeouts)
        return BlockColumnOperator(proxies, axisout=1)
Ejemplo n.º 2
0
def _get_projection_restricted(acq, P, mask):
    #XXX HACK
    if len(acq.block) == 1:
        return P.restrict(mask, inplace=True)

    def callback(i):
        f = acq.instrument.get_projection_operator
        p = f(acq.sampling[acq.block[i]], acq.scene, verbose=False)
        return p.restrict(mask, inplace=True)
    shapeouts = [(len(acq.instrument), s.stop-s.start) +
                 acq.scene.shape[1:] for s in acq.block]
    proxies = proxy_group(len(acq.block), callback, shapeouts=shapeouts)
    return BlockColumnOperator(proxies, axisout=1)
Ejemplo n.º 3
0
def _get_projection_restricted(acq, P, mask):
    #XXX HACK
    if len(acq.block) == 1:
        return P.restrict(mask, inplace=True)

    def callback(i):
        f = acq.instrument.get_projection_operator
        p = f(acq.sampling[acq.block[i]], acq.scene, verbose=False)
        return p.restrict(mask, inplace=True)

    shapeouts = [(len(acq.instrument), s.stop - s.start) + acq.scene.shape[1:]
                 for s in acq.block]
    proxies = proxy_group(len(acq.block), callback, shapeouts=shapeouts)
    return BlockColumnOperator(proxies, axisout=1)
Ejemplo n.º 4
0
    def get_projection_operator(self, verbose=True):
        """
        Return the projection operator for the peak sampling.

        Parameters
        ----------
        verbose : bool, optional
            If true, display information about the memory allocation.

        """
        f = self.instrument.get_projection_operator
        if len(self.block) == 1:
            return BlockColumnOperator(
                [f(self.sampling[b], self.scene, verbose=verbose)
                 for b in self.block], axisout=1)
        #XXX HACK
        def callback(i):
            p = f(self.sampling[self.block[i]], self.scene, verbose=False)
            return p
        shapeouts = [(len(self.instrument), s.stop-s.start) +
                      self.scene.shape[1:] for s in self.block]
        proxies = proxy_group(len(self.block), callback, shapeouts=shapeouts)
        return BlockColumnOperator(proxies, axisout=1)