Skip to content

Commit b2e117e

Browse files
committed
Add option for "percent_amplitude" threshold on SensWeights
1 parent 3524121 commit b2e117e

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

SimPEG/directives/directives.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,6 +2117,7 @@ class UpdateSensitivityWeights(InversionDirective):
21172117
everyIter = True
21182118
threshold: int = 0
21192119
switch = True
2120+
method = "percent_amplitude"
21202121

21212122
def initialize(self):
21222123

@@ -2173,10 +2174,15 @@ def getWr(self):
21732174
wr += prob_JtJ
21742175

21752176
wr /= wr.max()
2176-
wr = wr ** 0.5
21772177

2178-
wr += np.percentile(wr, self.threshold)#threshold
2178+
if self.method == "percent_amplitude":
2179+
wr += np.abs(wr.max() - wr.min()) * self.threshold / 100.
2180+
elif self.method == "percentile":
2181+
np.percentile(wr, self.threshold) #threshold
2182+
else:
2183+
wr += self.threshold
21792184

2185+
wr **= 0.5
21802186

21812187
else:
21822188
wr += 1.0

0 commit comments

Comments
 (0)