コード例 #1
0
ファイル: wavelets.py プロジェクト: LongyanU/SLIMpy
 def __init__( self, inSpace, h=None, L=2, adj=False, **kparams ):
     """
     Takes h, L as paramaters. h as source so it creates it.
     """
     assert h is not None
     kparams.update( h=Source(h.getContainer()), L=L, adj=adj )
     
     LinearOperatorStruct.__init__( self, inSpace, **kparams )
コード例 #2
0
 def __init__(self, inSpace, nbs, nba, ac, cpxIn=False, adj=False):
     LinearOperatorStruct.__init__(self,
                                   inSpace,
                                   nba=nba,
                                   nbs=nbs,
                                   ac=ac,
                                   adj=adj,
                                   cpxIn=cpxIn)
コード例 #3
0
ファイル: wavelets.py プロジェクト: LongyanU/SLIMpy
 def __init__( self, inSpace, axis= 1, type = 'linear', unit=True ):
     """
     @param unit unitary scaling
     @param type wavelet type
     """
     self.axis = axis
     kparams = dict( type = type , adj=False, unit=unit )
     
     LinearOperatorStruct.__init__( self, inSpace, **kparams )
コード例 #4
0
    def __init__(self, inSpace, num_blocks):
        env = InstanceManager()
        np = env['slimvars']['np']
        if prod(num_blocks) != np:
            raise Exception(
                "num_blocks does not match mpi variable 'np', %(num_blocks)s != %(np)s "
                % vars())

        kparams = dict(num_blocks=tuple(num_blocks))

        LinearOperatorStruct.__init__(self, inSpace, **kparams)
コード例 #5
0
    def __init__(self, inSpace, filt=1, input=None, adj=0, **kparams):
        """
        Takes filt and input as paramaters. Input as source so it creates it.
        """
        kparams.update(filt=filt, adj=adj)

        if filt == 1:
            assert input is not None
            kparams.update(input=Source(input.getContainer()))

        LinearOperatorStruct.__init__(self, inSpace, **kparams)
コード例 #6
0
    def __init__(self, inSpace, adj=False, **kparams):
        """
        nN is the number of N's that are given to the functions.
        Note: n1,n2 and n1out,n2out are the same.  beg1.end1 - beg2,end2 adds padding to the dataset.
        """

        for nN in kparams:
            if not re.match('(^beg\d+$|^end\d+$|^n\d+$|^adj$|^n\d+out$)', nN):
                raise TypeError, "Invalid Parameter, must be n# or n#out, beg# or end#."

#        kparams['adj'] = False
        LinearOperatorStruct.__init__(self, inSpace, adj=adj, **kparams)
コード例 #7
0
    def __init__(self, inSpace, dataSpace, que='y', adj=False, **kparams):
        """
        inp and out are the input and output's of the file.
        The que='n' param sets the default mig script to force run in environment.
        """

        # This parameter sets the default mig script to force run in environment.
        kparams.update(modelSpace=inSpace,
                       dataSpace=dataSpace,
                       adj=adj,
                       que=que)

        LinearOperatorStruct.__init__(self, inSpace, **kparams)
コード例 #8
0
    def __init__(self, inSpace, mask):

        from slimpy_base.Core.User.Structures.serial_vector import Vector
        if isinstance(mask, str):
            from slimpy_base import vector
            mask = vector(mask)
        elif not isinstance(mask, Vector):
            raise TypeError(
                "argument 'mask' must be a 'Vector' or a 'str' instance got '%s'"
                % type(mask))

        LinearOperatorStruct.__init__(self,
                                      inSpace,
                                      mask=Source(mask.container))
コード例 #9
0
 def __init__(self,
              inSpace,
              curveSpace=None,
              nbs=4,
              nba=8,
              ac=1,
              adj=False):
     LinearOperatorStruct.__init__(self,
                                   inSpace,
                                   curveSpace=curveSpace,
                                   nbs=nbs,
                                   nba=nba,
                                   ac=ac,
                                   adj=adj)
コード例 #10
0
    def __init__(self, space, matrix, adj=False):

        from slimpy_base.Core.User.Structures.serial_vector import Vector
        if isinstance(matrix, str):
            from slimpy_base import vector
            matrix = vector(matrix)
        elif not isinstance(matrix, Vector):
            raise TypeError(
                "argument 'matrix' must be a 'Vector' or a 'str' instance got '%s'"
                % type(matrix))

        self.inSpace = space
        kparams = dict(mat=Source(matrix.container), adj=adj)

        LinearOperatorStruct.__init__(self, self.inSpace, **kparams)
コード例 #11
0
    def __init__(self, domain):
        if isinstance(domain, MetaSpace):
            adj = False
            #            meta_shape = domain.meta.shape
            num_blocks = domain.shape
        else:
            adj = True
            #            meta_shape = domain.shape
            num_blocks = domain['num_blocks']

        LinearOperatorStruct.__init__(
            self,
            domain,
            #                                      meta_shape=tuple(meta_shape),
            num_blocks=tuple(num_blocks),
            adj=adj)
コード例 #12
0
    def __init__(self, inSpace, adj=False, Pyr_Level=2, **kparams):
        """
        Only Pyr_Level, K, lambda, beta, mSize, bo, dir_filter allowed.
         Constructor
         @param inSpace space instance
         @param adj create adjoint transform
         @param Pyr_Level ???
        """
        for key in kparams:
            if not key in [
                    'Pyr_Level', 'K', 'lamb', 'beta', 'mSize', 'bo',
                    'dir_filter'
            ]:
                raise TypeError, "Invalid Paramter, only Pyr_Level, K, lamb, beta, mSize, bo, dir_filter allowed."

        kparams.update(adj=adj, Pyr_Level=Pyr_Level)

        __LR.__init__(self, inSpace, **kparams)
コード例 #13
0
    def __init__(self,
                 inSpace,
                 ang1=None,
                 ang2=None,
                 ang3=None,
                 ang4=None,
                 ang=None,
                 angle='n',
                 dim=2,
                 adj=False,
                 **kparams):
        """
        Takes parameters dim=[2/3], pass=[y/n], ang[1-4]=
        """
        for nN in kparams:
            if not re.match('(^v\d*$|^pass$)', nN):
                raise TypeError, "Invalid Parameter, must be v# or pass."

        if ang != None:
            ang = 90 - ang
            kparams = dict(kparams,
                           adj=adj,
                           angle=angle,
                           dim=dim,
                           ang1=-ang,
                           ang2=-0.9 * ang,
                           ang3=0.9 * ang,
                           ang4=ang)
        else:
            kparams = dict(kparams,
                           adj=adj,
                           angle=angle,
                           dim=dim,
                           ang1=ang1,
                           ang2=ang2,
                           ang3=ang3,
                           ang4=ang4)

        LinearOperatorStruct.__init__(self, inSpace, **kparams)
コード例 #14
0
    def __init__(self, wvec, inSpace):
        """
        The param wvec must be able to be applied to another vector. Or is it is out of core, can be a string
        TODO if wvec is None, it is the Identity operator.
        TODO - error trap that if wvec is same type as other when applying. 
        """

        msg = "weightoper:Dont use this class!!! use DiagonalWeight"
        import warnings
        warnings.warn(msg, DeprecationWarning)

        self.wvec = wvec
        if is_vector(wvec):
            par = Source(wvec.container)
            LinearOperatorStruct.__init__(self, inSpace, vec=par)
        if isinstance(wvec, DataContainer):
            par = Source(wvec)
            LinearOperatorStruct.__init__(self, inSpace, vec=par)
        else:
            LinearOperatorStruct.__init__(self, inSpace, wvec)
コード例 #15
0
ファイル: fft.py プロジェクト: LongyanU/SLIMpy
 def __init__( self, inSpace, sym=True, opt=False, pad=1, axis=2, adj=False ):
     
     kparams = dict( sym=sym, opt=opt, pad=pad, axis=axis, adj=adj )
     
     LinearOperatorStruct.__init__( self, inSpace, **kparams )
コード例 #16
0
    def __init__(self, domain):

        kparams = dict(adj=False)

        LinearOperatorStruct.__init__(self, domain, **kparams)
コード例 #17
0
ファイル: new_fft_slimpy.py プロジェクト: LongyanU/SLIMpy
    def __init__(self, domain, sym=True, opt=False):

        kparams = dict(sym=sym, opt=opt, adj=False)

        LinearOperatorStruct.__init__(self, domain, **kparams)
コード例 #18
0
ファイル: linear_alg.py プロジェクト: LongyanU/SLIMpy
 def __init__(self, inSpace, inv=True, **kparams):
     """
     Initialize the operator.
     """
     LinearOperatorStruct.__init__(self, inSpace, inv=inv, **kparams)
コード例 #19
0
    def __init__(self, inSpace, mask, axis=2):
        self.axis = axis
        kparams = dict(mask=Source(mask.container))

        LinearOperatorStruct.__init__(self, inSpace, **kparams)
コード例 #20
0
    def __init__(self, domain, adj=False):

        LinearOperatorStruct.__init__(self, domain, adj=False)
コード例 #21
0
    def __init__(self, inspace, plane=[1, 2], **kparams):

        LinearOperatorStruct.__init__(self, inspace, plane=plane, **kparams)
コード例 #22
0
 def __init__(self, domain, eps, adj=False):
     """
     Initialize the operator.
     """
     LinearOperatorStruct.__init__(self, domain, adj=False, eps=eps)
コード例 #23
0
 def __init__(self, inSpace, **kparams):
     """
     Initialize the operator.
     """
     LinearOperatorStruct.__init__(self, inSpace, adj=False, **kparams)
コード例 #24
0
    def __init__(self, inSpace, eps):

        kparams = dict(eps=eps)

        LinearOperatorStruct.__init__(self, inSpace, **kparams)
コード例 #25
0
ファイル: new_noise_slimpy.py プロジェクト: LongyanU/SLIMpy
    def __init__(self, domain, sigma=0.08):

        kparams = dict(sigma=0.08, adj=False)

        LinearOperatorStruct.__init__(self, domain, **kparams)
コード例 #26
0
 def __init__(self, inspace):
     """
     Just call the superclass weight operator, that will apply the conj op.
     """
     LinearOperatorStruct.__init__(self, inspace)