Skip to content

Commit

Permalink
ADD: inv.setInterRegionConstraint syntactic sugar directed to fop.reg…
Browse files Browse the repository at this point in the history
…ionManager
  • Loading branch information
Thomas Günther committed Mar 18, 2024
1 parent c3a4824 commit d4da24c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pygimli/frameworks/inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ def echoStatus(self):
self.inv.echoStatus()

def setPostStep(self, p):
"""Set a function to be called after each iteration.
"""Set a function to be called after each iteration.
The function is called with p(IterationNumber, self)."""
self._postStep = p

Expand Down Expand Up @@ -495,6 +495,19 @@ def setRegularization(self, *args, **kwargs):
if len(kwargs) > 0:
self.fop.setRegionProperties(*args, **kwargs)

def setInterRegionConstraint(self, region1, region2, strength):
"""Set constraints between neighboring regions.
Parameters
----------
region1, region2 : int|'*'
Region IDs
strength : float
weighting factor for roughness across regions
"""
self.fop.regionManager().setInterRegionConstraint(
region1, region2, strength)

def setConstraintWeights(self, cWeight):
"""Set weighting factors for the invidual rows of the C matrix."""
self.inv.setCWeight(cWeight)
Expand Down

0 comments on commit d4da24c

Please sign in to comment.