00001 """
00002 Simple example on how to Create an Out-of-Core Linear
00003 Operator.
00004 """
00005
00006 from slimpy_base.Core.User.linop.NewLinOp import NewLinop
00007 from slimpy_base import voidSpace
00008 from os import environ
00009 from os.path import join
00010
00011
00012 class fft_user(NewLinop):
00013 """
00014 The variables that must be specified are:
00015 command - if command is rsf, will automatically add the sf infront.
00016 So "command = fft1" will call the command sffft1
00017 params
00018
00019 Optional variables for the transpose are:
00020 inSpace
00021 kparams
00022 transp_command
00023 outSpace
00024 transp_params
00025 transp_kparams
00026 If the optional variables are not specified then they are assumed to
00027 be the same as the forward.
00028 """
00029
00030
00031 def __init__(self, space, opt='y', inv='n'):
00032
00033 self.inSpace = space
00034 self.outSpace = voidSpace( 'slim2rsf' )
00035
00036 self.kparams = dict(opt=opt, inv=inv)
00037
00038 RSFROOT = environ.get('RSFROOT')
00039 self.command = join(RSFROOT, 'bin', "sffft1")
00040 self.params = ()
00041
00042 NewLinop.__init__( self )
00043
00044
00045 def add_3( vec ):
00046 RSFROOT = environ.get('RSFROOT')
00047 cmd = join(RSFROOT, 'bin', "sfadd")
00048
00049 return vec.generateNew( cmd , add=3 )
00050
00051