From d82c90ed7e4790e7729ef496e91f05307f20ec0b Mon Sep 17 00:00:00 2001 From: Francesco Picetti Date: Mon, 28 Mar 2022 13:56:43 -0700 Subject: [PATCH] Fix typo --- occamypy/torch/back_utils.py | 2 +- tutorials/ax_info.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/occamypy/torch/back_utils.py b/occamypy/torch/back_utils.py index cd9c924..ce8e7ba 100644 --- a/occamypy/torch/back_utils.py +++ b/occamypy/torch/back_utils.py @@ -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" diff --git a/tutorials/ax_info.py b/tutorials/ax_info.py index 10ee48d..da56426 100644 --- a/tutorials/ax_info.py +++ b/tutorials/ax_info.py @@ -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)) @@ -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()