Skip to content

Commit 3524121

Browse files
committed
Change directive, small update to example
1 parent d875608 commit 3524121

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

SimPEG/directives/directives.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,17 +1367,9 @@ def stack_channels(self, dpred: list):
13671367
Regroup channel values along rows.
13681368
"""
13691369
if isinstance(dpred, np.ndarray):
1370-
return dpred.reshape((1, -1))
1370+
return self.reshape(dpred)
13711371

1372-
tile_stack = []
1373-
channels = []
1374-
for pred in dpred:
1375-
channels += [pred]
1376-
if len(channels) == len(self.channels):
1377-
tile_stack += [self.reshape(np.vstack(channels))]
1378-
channels = []
1379-
1380-
return np.dstack(tile_stack)
1372+
return self.reshape(np.hstack(dpred))
13811373

13821374
def save_components(self, iteration: int, values: list[np.ndarray] = None):
13831375
"""

tutorials/08-tdem/plot_inv_3_tem_3d.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def reshape(values):
340340
data_object = data.Data(
341341
survey,
342342
dobs=dpred + noise,
343-
noise_floor=floors.flatten(),
343+
noise_floor=floors.flatten(order='F'),
344344
# noise_floor=np.kron(
345345
# np.mean(np.abs(dpred).reshape), axis=1),
346346
# np.ones(n_times),
@@ -453,7 +453,7 @@ def reshape(values):
453453
plt.plot(reshape(np.r_[inv_prob.dpred]).squeeze().T, "r")
454454
plt.plot(reshape(data_object.standard_deviation).squeeze().T, "k--")
455455
plt.plot(reshape(-data_object.standard_deviation).squeeze().T, "k--")
456-
axs.set_yscale("symlog", linthresh=1e-11)
456+
axs.set_yscale("symlog", linthresh=1e-13)
457457
axs.set_title("LP Predicted")
458458
axs.set_ylim([-1e-10, 0])
459459

@@ -464,7 +464,7 @@ def reshape(values):
464464
plt.plot(reshape(simulation.dpred(inv_prob.l2model)).squeeze().T, "r")
465465
plt.plot(reshape(data_object.standard_deviation).squeeze().T, "k--")
466466
plt.plot(reshape(-data_object.standard_deviation).squeeze().T, "k--")
467-
axs.set_yscale("symlog", linthresh=1e-11)
467+
axs.set_yscale("symlog", linthresh=1e-14)
468468
axs.set_title("L2 Predicted")
469469
axs.set_ylim([-1e-10, 0])
470470
plt.show()

0 commit comments

Comments
 (0)