diff --git a/examples/03_checkerboard_2d/plot_model.ipynb b/examples/03_checkerboard_2d/plot_model.ipynb index a7c247b..7f024bc 100644 --- a/examples/03_checkerboard_2d/plot_model.ipynb +++ b/examples/03_checkerboard_2d/plot_model.ipynb @@ -11,24 +11,6 @@ "import numpy as np" ] }, - { - "cell_type": "code", - "execution_count": 34, - "metadata": {}, - "outputs": [], - "source": [ - "def to_ani(xi, eta):\n", - " epsilon = np.sqrt(eta**2+xi**2)\n", - " phi = np.zeros_like(epsilon)\n", - " idx = np.where(xi <= 0)\n", - " phi[idx] = 90 + 0.5*np.rad2deg(np.arctan(eta[idx]/xi[idx]))\n", - " idx = np.where((xi > 0) & (eta <= 0))\n", - " phi[idx] = 180 + 0.5*np.rad2deg(np.arctan(eta[idx]/xi[idx]))\n", - " idx = np.where((xi > 0) & (eta > 0))\n", - " phi[idx] = 0.5*np.rad2deg(np.arctan(eta[idx]/xi[idx]))\n", - " return epsilon, phi\n" - ] - }, { "cell_type": "code", "execution_count": 35, @@ -40,11 +22,6 @@ " x = f['x'][:]\n", " y = f['y'][:]\n", " periods = f['periods_ph'][:]\n", - " xi = f['xi_ph'][:]\n", - " eta = f['eta_ph'][:]\n", - " epsilon, phi = to_ani(xi, eta)\n", - "with h5py.File('OUTPUT_FILES/model_iter.h5', 'r') as f:\n", - " svel0 = f['vel_rayleigh_000'][:]\n", "xx, yy = np.meshgrid(x, y)\n" ] }, @@ -73,7 +50,7 @@ "region=[x.min(), x.max(), y.min(), y.max()]\n", "fig = pygmt.Figure()\n", "fig.basemap(region=region, projection='M4i', frame=True)\n", - "grid = pygmt.surface(z=eta[:,:,num_period].ravel(), x=xx.ravel(),y=yy.ravel(), region=region, spacing='0.01/0.01')\n", + "grid = pygmt.surface(z=svel[:,:,num_period].ravel(), x=xx.ravel(),y=yy.ravel(), region=region, spacing='0.01/0.01')\n", "fig.grdimage(grid=grid, cmap='seis')\n", "fig.show()" ]