Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
fpicetti committed Mar 28, 2022
1 parent fd19629 commit d82c90e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion occamypy/torch/back_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_device(devID: int = None) -> torch.device:

return torch.device(dev)

s

def get_device_name(devID: int = None) -> str:
if devID is None or isinstance(torch.cuda.get_device_name(devID), torch.NoneType):
return "CPU"
Expand Down
12 changes: 6 additions & 6 deletions tutorials/ax_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
ot = 0.
dt = 0.002 # fs = 500Hz
wav = o.VectorNumpy(np.load("./data/ricker20.npy"))
wav.ax_info = [o.AxInfo(wav.size, ot, dt, "time")]
wav.ax_info = [o.AxInfo(wav.size, ot, dt, "time [s]")]

plt.figure()
plt.plot(wav.ax_info[0].plot(), wav.plot())
plt.xlim(wav.ax_info[0].o, wav.ax_info[0].last)
plt.title("Wavelet"), plt.xlabel("time")
plt.title("Wavelet"), plt.xlabel(wav.ax_info[0].l)
plt.tight_layout()
plt.show()

# build a two-layer velocity model sampled at 10m, with a Gaussian anomaly
vp = o.VectorNumpy((101, 101)).zero()
vp.ax_info = [o.AxInfo(101, 0., 10., "z"),
o.AxInfo(101, 0., 10., "x")]
vp.ax_info = [o.AxInfo(101, 0., 10., "z [m]"),
o.AxInfo(101, 0., 10., "x [m]")]

vp[35, 50] = 1.
G = o.GaussianFilter(vp, (3, 10))
Expand All @@ -34,8 +34,8 @@
plt.imshow(vp.plot(), cmap="jet", aspect="auto", vmin=vp.min(), vmax=vp.max(),
extent=[vp.ax_info[1].o, vp.ax_info[1].last, vp.ax_info[0].last, vp.ax_info[0].o])
plt.colorbar(label="[m/s]")
plt.xlabel("%s [m]" % vp.ax_info[1].l)
plt.ylabel("%s [m]" % vp.ax_info[0].l)
plt.xlabel(vp.ax_info[1].l)
plt.ylabel(vp.ax_info[0].l)
plt.title("Velocity model")
plt.tight_layout()
plt.show()
Expand Down

0 comments on commit d82c90e

Please sign in to comment.