Skip to content

Commit

Permalink
fix the mask issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwj679 committed Nov 29, 2023
1 parent 3ea1e90 commit a1d2221
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SOSAT/risk_analysis/critically_oriented_fault.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def PlotFailureProbability(self,
fig = plt.figure(figsize=(figwidth, figwidth * 0.7))
ax = fig.add_subplot(111)
ax.plot(P, Pfail, "k")
ax.set_xlabel("Pore Pressure")
ax.set_xlabel("Pore Pressure (" + self.ss.stress_unit + ")")
ax.set_ylabel("Probability of Fault Activation")
plt.tight_layout()

Expand Down
2 changes: 1 addition & 1 deletion SOSAT/risk_analysis/hydraulic_fracture.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def PlotFailureProbability(self,
fig = plt.figure(figsize=(figwidth, figwidth * 0.7))
ax = fig.add_subplot(111)
ax.plot(P, Pfail, "k")
ax.set_xlabel("Pore Pressure")
ax.set_xlabel("Pore Pressure (" + self.ss.stress_unit + ")")
ax.set_ylabel("Probability of Hydraulic Fracturing")
plt.tight_layout()

Expand Down
6 changes: 6 additions & 0 deletions SOSAT/stress_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ def evaluate_posterior(self):
log_posterior = log_posterior + loglikelihood

self.posterior = np.exp(log_posterior)
# reset the mask to account for the problem of mask
# getting changed when ma.log(0)=Masked in the
# c.loglikelihood(self) function
# set the posterior to zero where the mask has changed
indicator = self.posterior.mask != self.shmin_grid.mask
self.posterior[indicator] = 0
# now normalize
tot = ma.sum(self.posterior)
self.posterior = self.posterior / tot
Expand Down

0 comments on commit a1d2221

Please sign in to comment.