00001 """
00002 Perform 2D de-noiseing using landweber method.
00003
00004 @note that, as of August 28, 2006:
00005 - dimension fixed (2D)
00006
00007 @par REQUIREMENTS:
00008 - Madagascar with SLIM toolbox
00009 - SLIMpy
00010
00011 @param lambdaMax=LMAX [Default=0.01]
00012 @param lambdaMin=LMIN [Default=0.6]
00013 @param OuterN=NBOUT Number of outer loops [Default=2]
00014 @param InnerN=NBIN Number of inner loops [Default=2]
00015 """
00016
00017 __copyright__ = """
00018 Copyright 2008 Sean Ross-Ross
00019 """
00020
00021 __license__ = """
00022 This file is part of SLIMpy .
00023
00024 SLIMpy is free software: you can redistribute it and/or modify
00025 it under the terms of the GNU Lesser General Public License as published by
00026 the Free Software Foundation, either version 3 of the License, or
00027 (at your option) any later version.
00028
00029 SLIMpy is distributed in the hope that it will be useful,
00030 but WITHOUT ANY WARRANTY; without even the implied warranty of
00031 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00032 GNU Lesser General Public License for more details.
00033
00034 You should have received a copy of the GNU Lesser General Public License
00035 along with SLIMpy . If not, see <http://www.gnu.org/licenses/>.
00036 """
00037
00038
00039
00040 from SLIMpy import vector
00041 from SLIMpy.linear_operators import surf, Identity
00042 from slimpy_base.utils.slim_decorators import depends_on
00043 from slimpy_contrib.ana.GenLandweber import GenThreshLandweber
00044 from slimpy_contrib.ana.utils.thresholds import LinearCooling
00045
00046
00047 __acknowledgments__ = """
00048 Author: G. Hennenfent
00049 Seismic Laboratory for Imaging and Modeling (SLIM)
00050 Department of Earth & Ocean Sciences (EOS)
00051 The University of British Columbia at Vancouver (UBC)
00052
00053 Acknowledgments:
00054 Sean Ross-Ross
00055 Seismic Laboratory for Imaging and Modeling (SLIM)
00056 Department of Earth & Ocean Sciences (EOS)
00057 The University of British Columbia at Vancouver (UBC)
00058
00059 Darren Thomson
00060 Seismic Laboratory for Imaging and Modeling (SLIM)
00061 Department of Earth & Ocean Sciences (EOS)
00062 The University of British Columbia at Vancouver (UBC)
00063
00064 Funding: This work was carried out as part of the SINBAD project with
00065 financial support, secured through ITF, from the following
00066 organizations: BG Group, BP, Chevron, ExxonMobil, and Shell. SINBAD is
00067 part of a collaborative research and development grant (CRD) number
00068 334810-05 funded by the Natural Science and Engineering Research
00069 Council (NSERC)
00070
00071 """
00072
00073
00074
00075 Get = lambda env, item: env.get( item ) or env.get( 'problem', env.get('default_pack',{}) ).get(item)
00076
00077
00078 @depends_on( 'lambdaMax', 'lambdaMin' )
00079 @depends_on( 'OuterN', 'InnerN' )
00080 @depends_on( 'x0' )
00081 def solver_callback( target, source, env, A ):
00082 """
00083 solver_callback( target, source, env, space ) -> Solver
00084 Set the default value for the solver. Solver defaults
00085 to the thresholded landweber with a linear cooling
00086 threshold scheme.
00087 @return Thresholded Landweber Solver with LinearCooling scheme
00088 """
00089
00090 space = A.domain()
00091
00092 lambdaMax = Get( env,'lambdaMax' )
00093 lambdaMin = Get( env,'lambdaMin' )
00094 outer = int( Get( env,'OuterN' ) )
00095 inner = int( Get( env,'InnerN' ) )
00096
00097 thresh = LinearCooling( float( lambdaMax ), float( lambdaMin ), outer )
00098 I = Identity( space )
00099
00100
00101 x0 = env.get( 'x0' , None )
00102 if x0 is None:
00103 x0 = space.zeros()
00104 else:
00105 x0 = vector( x0 )
00106
00107 solver = GenThreshLandweber( outer, inner, thresh, I, x0 )
00108
00109 return solver
00110
00111 @depends_on( 'transparams' )
00112 def transform_callback( target, source, env, space ):
00113 '''
00114 transform_callback( target, source, env, space ) -> A
00115 set the default value for the transform
00116 @return the inverse surfacelet transform
00117 '''
00118 transparams = Get( env,'transparams' )
00119 A = surf( space ).inv()
00120
00121 return A
00122
00123
00124 def precondition_callback(target,source,env, space ):
00125 """
00126 precondition_callback(target,source,env, space) -> Identity(space)
00127 Default preconditioner defaults to the Identity
00128 """
00129 return Identity(space)
00130
00131
00132 l1_min = {}
00133 l1_min['name'] = 'l1 minimizeation with landweber method'
00134 l1_min['doc'] = {}
00135
00136
00137 l1_min['precondition_callback'] = precondition_callback
00138 l1_min['transform_callback'] = transform_callback
00139 l1_min['solver_callback'] = solver_callback
00140 l1_min['lambdaMax'] = .01
00141 l1_min['doc']['lambdaMax'] = """
00142 This parameter must be greater
00143 than lambdaMin. The closer lambdaMax is to the max value of the coefficients of the vector the more your
00144 acurate your result will be, but the problem needs to have
00145 more iterations. less iterations need a smaller value,
00146 however your results will be less acurate.
00147 """
00148 l1_min['lambdaMin'] = .60
00149 l1_min['doc']['lambdaMin'] = """
00150 The closer the
00151 parameter is to 0 the more noise and signal is kept in the
00152 result as lambdaMin increases more noise will be removed.
00153 """
00154 l1_min['OuterN'] = 2
00155 l1_min['doc']['OuterN'] = """
00156 number of outer iterations for the solver
00157 """
00158 l1_min['InnerN'] = 2
00159 l1_min['doc']['InnerN'] = """
00160 number of inner iterations for the solver
00161 """
00162 l1_min['transparams'] = [4, 32, 1]
00163 l1_min['doc']['transparams'] = """
00164 default parameters to pass to the curvelet transform
00165 """
00166
00167
00168
00169
00170
00171
00172
00173
00174