From de2e180102521c57b31e8984bb94fed409ef8bd2 Mon Sep 17 00:00:00 2001 From: daniel-koehn Date: Tue, 13 Dec 2022 13:23:12 +0100 Subject: [PATCH] Updated Jupyter notebooks --- Github_update.txt | 6 +-- par/pythonIO/denise_IO/denise_out.py | 16 +++---- par/visu/FWI_marmousi.ipynb | 46 +++++++-------------- par/visu/Misfit_step_length_evolution.ipynb | 38 +++++++---------- par/visu/Plot_model_PSV.ipynb | 12 +++--- par/visu/Plot_model_SH.ipynb | 12 +++--- par/visu/Plot_seis.ipynb | 2 +- par/visu/RTM_marmousi.ipynb | 34 ++++++--------- par/visu/snap_marmousi_div_rot.ipynb | 18 ++++---- 9 files changed, 75 insertions(+), 109 deletions(-) diff --git a/Github_update.txt b/Github_update.txt index 8f0af13..8c6aaf2 100644 --- a/Github_update.txt +++ b/Github_update.txt @@ -3,15 +3,15 @@ Git cloning ... ... the master branch -git clone https://github.com/daniel-koehn/DENISE-Black-Edition.git +git clone git@github.com:daniel-koehn/DENISE-Black-Edition.git ... only the latest master branch update -git clone --depth=1 https://github.com/daniel-koehn/DENISE-Black-Edition.git +git clone --depth=1 git@github.com:daniel-koehn/DENISE-Black-Edition.git ... a developing branch -git clone -b branch_name https://github.com/daniel-koehn/DENISE-Black-Edition.git +git clone -b branch_name git@github.com:daniel-koehn/DENISE-Black-Edition.git Update of Github DENISE-Black-Edition repository diff --git a/par/pythonIO/denise_IO/denise_out.py b/par/pythonIO/denise_IO/denise_out.py index eac1a94..34761b5 100644 --- a/par/pythonIO/denise_IO/denise_out.py +++ b/par/pythonIO/denise_IO/denise_out.py @@ -232,17 +232,17 @@ def do_plot(n, model, cm, an, title, vpmin, vpmax, x, y, font): #ax.set_yticks([0.5, 1, 1.5, 2, 2.5, 3, 3.5]) #plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) - rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) + #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) ## for Palatino and other serif fonts use: #rc('font',**{'family':'serif','serif':['Palatino']}) #plt.rc('text', usetex=True) - rc('text', usetex=True) + #rc('text', usetex=True) # plt.pcolor(x, y, vp, cmap=cm, vmin=vpmin) plt.imshow(model, cmap=cm, interpolation='none', extent=[np.min(x),np.max(x),np.min(y),np.max(y)], vmin=vpmin, vmax=vpmax) - a = gca() - a.set_xticklabels(a.get_xticks(), font) - a.set_yticklabels(a.get_yticks(), font) + #a = gca() + #a.set_xticklabels(a.get_xticks(), font) + #a.set_yticklabels(a.get_yticks(), font) plt.axis('scaled') plt.ylabel('Depth [km]', fontdict=font) if n==3: @@ -290,9 +290,9 @@ def plot_acq(vp,xrec,yrec,xsrc,ysrc,x,y,cmap,vpmin,vpmax): plt.plot(xrec,yrec,'cv',markersize=5) plt.plot(xsrc,ysrc,'r*',markersize=10) - a = gca() - a.set_xticklabels(a.get_xticks(), font) - a.set_yticklabels(a.get_yticks(), font) + #a = gca() + #a.set_xticklabels(a.get_xticks(), font) + #a.set_yticklabels(a.get_yticks(), font) plt.ylabel('Depth [m]', fontdict=font) plt.xlabel('Distance [m]', fontdict=font) diff --git a/par/visu/FWI_marmousi.ipynb b/par/visu/FWI_marmousi.ipynb index 067ac5f..7095767 100644 --- a/par/visu/FWI_marmousi.ipynb +++ b/par/visu/FWI_marmousi.ipynb @@ -46,9 +46,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "fp = open('cmap_cm.pkl', 'rb')\n", @@ -87,9 +85,7 @@ { "cell_type": "code", "execution_count": 65, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "FSize = 20\n", @@ -134,9 +130,7 @@ { "cell_type": "code", "execution_count": 122, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "name_vp = basename + \"modelTest_vp_stage_\" + \"%0.*f\" %(0,np.fix(stage)) + \".bin\"\n", @@ -151,9 +145,7 @@ { "cell_type": "code", "execution_count": 123, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "name_vs = basename + \"modelTest_vs_stage_\" + \"%0.*f\" %(0,np.fix(stage)) + \".bin\"\n", @@ -168,9 +160,7 @@ { "cell_type": "code", "execution_count": 124, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "name_rho = basename + \"modelTest_rho_stage_\" + \"%0.*f\" %(0,np.fix(stage)) + \".bin\"\n", @@ -192,9 +182,7 @@ { "cell_type": "code", "execution_count": 14, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "x = np.arange(0.0, DH*NX, DH)\n", @@ -213,9 +201,7 @@ { "cell_type": "code", "execution_count": 166, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "def do_plot(n, model, cm, an, title, vpmin, vpmax):\n", @@ -225,17 +211,17 @@ " ax.set_yticks([0.5, 1, 1.5, 2, 2.5, 3, 3.5])\n", " \n", " #plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", - " rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", + " #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", " ## for Palatino and other serif fonts use:\n", " #rc('font',**{'family':'serif','serif':['Palatino']})\n", " #plt.rc('text', usetex=True)\n", - " rc('text', usetex=True)\n", + " #rc('text', usetex=True)\n", " \n", " # plt.pcolor(x, y, vp, cmap=cm, vmin=vpmin)\n", " plt.imshow(model, cmap=cm, interpolation='none', extent=[0.0,NX*DH/1000.0,0.0,NY*DH/1000.0], vmin=vpmin, vmax=vpmax)\n", - " a = gca()\n", - " a.set_xticklabels(a.get_xticks(), font)\n", - " a.set_yticklabels(a.get_yticks(), font)\n", + " #a = gca()\n", + " #a.set_xticklabels(a.get_xticks(), font)\n", + " #a.set_yticklabels(a.get_yticks(), font)\n", " plt.axis('scaled')\n", " plt.ylabel('Depth [km]', fontdict=font)\n", " if n==3:\n", @@ -257,9 +243,7 @@ { "cell_type": "code", "execution_count": 167, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "plt.close('all')\n", @@ -298,9 +282,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.1" + "version": "3.7.4" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 } diff --git a/par/visu/Misfit_step_length_evolution.ipynb b/par/visu/Misfit_step_length_evolution.ipynb index 2a5e61b..8a9855f 100644 --- a/par/visu/Misfit_step_length_evolution.ipynb +++ b/par/visu/Misfit_step_length_evolution.ipynb @@ -46,9 +46,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "FSize = 20\n", @@ -58,8 +56,8 @@ "mpl.rc('xtick', labelsize=FSize) \n", "mpl.rc('ytick', labelsize=FSize) \n", "rcParams['figure.figsize'] = 12, 11\n", - "rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", - "rc('text', usetex=True)" + "#rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", + "#rc('text', usetex=True)" ] }, { @@ -72,9 +70,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "filename = \"elastic_FWT/OBC_FWT/LBFGS/19_04_2017_all_iterations/LOG_TEST.dat\"\n", @@ -123,9 +119,7 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -147,9 +141,9 @@ "plt.semilogy(iteration,data[:,4],'b-', linewidth=3, label='Evolution of the misfit function')\n", "\n", "# scale and annotate axis\n", - "a = gca()\n", - "a.set_xticklabels(a.get_xticks(), font)\n", - "a.set_yticklabels(a.get_yticks(), font)\n", + "#a = gca()\n", + "#a.set_xticklabels(a.get_xticks(), font)\n", + "#a.set_yticklabels(a.get_yticks(), font)\n", "plt.ylabel('Normalized misfit function', fontdict=font)\n", "plt.xlabel('Iteration no.', fontdict=font)\n", "plt.autoscale(enable=True, axis='y', tight=True)\n", @@ -177,9 +171,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { @@ -201,9 +193,9 @@ "plt.semilogy(iteration,data[:,0],'b-', linewidth=3)\n", "\n", "# scale and annotate axis\n", - "a = gca()\n", - "a.set_xticklabels(a.get_xticks(), font)\n", - "a.set_yticklabels(a.get_yticks(), font)\n", + "#a = gca()\n", + "#a.set_xticklabels(a.get_xticks(), font)\n", + "#a.set_yticklabels(a.get_yticks(), font)\n", "plt.ylabel('Optimum step length from parabolic line search', fontdict=font)\n", "plt.xlabel('Iteration no.', fontdict=font)\n", "plt.autoscale(enable=True, axis='y', tight=True)\n", @@ -234,7 +226,7 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python [default]", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -248,9 +240,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.2" + "version": "3.7.4" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 } diff --git a/par/visu/Plot_model_PSV.ipynb b/par/visu/Plot_model_PSV.ipynb index c4db837..bf4046b 100644 --- a/par/visu/Plot_model_PSV.ipynb +++ b/par/visu/Plot_model_PSV.ipynb @@ -179,14 +179,14 @@ " \n", " ax=plt.subplot(3, 1, n)\n", " \n", - " rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", - " rc('text', usetex=True)\n", + " #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", + " #rc('text', usetex=True)\n", " \n", " # plt.pcolor(x, y, vp, cmap=cm, vmin=vpmin)\n", " plt.imshow(model, cmap=cm, interpolation='none', extent=[0.0,NX*DH,0.0,NY*DH], vmin=vpmin, vmax=vpmax)\n", - " a = gca()\n", - " a.set_xticklabels(a.get_xticks(), font)\n", - " a.set_yticklabels(a.get_yticks(), font)\n", + " #a = gca()\n", + " #a.set_xticklabels(a.get_xticks(), font)\n", + " #a.set_yticklabels(a.get_yticks(), font)\n", " plt.axis('scaled')\n", " if n==3:\n", " plt.xlabel('Distance [m]', fontdict=font)\n", @@ -241,7 +241,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.4" } }, "nbformat": 4, diff --git a/par/visu/Plot_model_SH.ipynb b/par/visu/Plot_model_SH.ipynb index 6bab11d..660f2b6 100644 --- a/par/visu/Plot_model_SH.ipynb +++ b/par/visu/Plot_model_SH.ipynb @@ -164,13 +164,13 @@ " \n", " ax=plt.subplot(1, 2, n)\n", " \n", - " rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", - " rc('text', usetex=True)\n", + " #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", + " #rc('text', usetex=True)\n", " \n", " plt.imshow(model, cmap=cm, interpolation='none', extent=[0.0,NX*DH,0.0,NY*DH], vmin=vpmin, vmax=vpmax)\n", - " a = gca()\n", - " a.set_xticklabels(a.get_xticks(), font)\n", - " a.set_yticklabels(a.get_yticks(), font)\n", + " #a = gca()\n", + " #a.set_xticklabels(a.get_xticks(), font)\n", + " #a.set_yticklabels(a.get_yticks(), font)\n", " plt.axis('scaled')\n", " plt.xlabel('Distance [m]', fontdict=font)\n", " if n==1:\n", @@ -224,7 +224,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.4" } }, "nbformat": 4, diff --git a/par/visu/Plot_seis.ipynb b/par/visu/Plot_seis.ipynb index 88695a0..610fb04 100644 --- a/par/visu/Plot_seis.ipynb +++ b/par/visu/Plot_seis.ipynb @@ -122,7 +122,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.4" } }, "nbformat": 4, diff --git a/par/visu/RTM_marmousi.ipynb b/par/visu/RTM_marmousi.ipynb index 21a2c2e..f272f66 100644 --- a/par/visu/RTM_marmousi.ipynb +++ b/par/visu/RTM_marmousi.ipynb @@ -63,9 +63,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "FSize = 25\n", @@ -87,9 +85,7 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "f = open ('../start/marmousi_II_smooth2.vp')\n", @@ -103,9 +99,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "f1 = open ('../jacobian/jacobian_Test_P_image')\n", @@ -126,9 +120,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "x = np.arange(0.0, DH*NX/1000.0, DH)\n", @@ -145,9 +137,7 @@ { "cell_type": "code", "execution_count": 7, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "extent = [0.0,NX*DH/1000.0,0.0,NY*DH/1000.0]\n", @@ -156,8 +146,8 @@ "\n", "fig = plt.figure(frameon=False)\n", "\n", - "plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", - "plt.rc('text', usetex=True)\n", + "#plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", + "#plt.rc('text', usetex=True)\n", "\n", "im1 = plt.imshow(vp, cmap=plt.cm.jet, interpolation='nearest', extent=extent)\n", "plt.hold(True)\n", @@ -168,9 +158,9 @@ "#im2 = plt.imshow(RTM, cmap=plt.cm.seismic, interpolation='bicubic',\n", "# extent=extent, vmin=cmin, vmax=cmax)\n", "\n", - "a = gca()\n", - "a.set_xticklabels(a.get_xticks(), font)\n", - "a.set_yticklabels(a.get_yticks(), font)\n", + "#a = gca()\n", + "#a.set_xticklabels(a.get_xticks(), font)\n", + "#a.set_yticklabels(a.get_yticks(), font)\n", "#plt.axis('scaled')\n", "plt.title('Marmousi-RTM (smooth2 model)', fontdict=font)\n", "plt.ylabel('Depth [km]', fontdict=font)\n", @@ -210,9 +200,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.1" + "version": "3.7.4" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 } diff --git a/par/visu/snap_marmousi_div_rot.ipynb b/par/visu/snap_marmousi_div_rot.ipynb index dc4dc93..bd0afb0 100644 --- a/par/visu/snap_marmousi_div_rot.ipynb +++ b/par/visu/snap_marmousi_div_rot.ipynb @@ -180,8 +180,8 @@ "fig = plt.figure(frameon=True)\n", "\n", "\n", - "plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", - "plt.rc('text', usetex=True)\n", + "#plt.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", + "#plt.rc('text', usetex=True)\n", "\n", "i = NSNAP1\n", "while i <= NSNAP2:\n", @@ -202,9 +202,9 @@ " extent=extent, vmin=-clip_div, vmax=clip_div)\n", "\n", " # add title and axis annotations\n", - " a = gca()\n", - " a.set_xticklabels(a.get_xticks(), font)\n", - " a.set_yticklabels(a.get_yticks(), font)\n", + " #a = gca()\n", + " #a.set_xticklabels(a.get_xticks(), font)\n", + " #a.set_yticklabels(a.get_yticks(), font)\n", " time_str = str(time)\n", " name_title = \"P-wave energy (time = \" + time_str[0:5] + \" s)\"\n", " plt.title(name_title, fontdict=font)\n", @@ -222,9 +222,9 @@ " extent=extent, vmin=-clip_rot, vmax=clip_rot)\n", "\n", " # add title and axis annotations\n", - " a = gca()\n", - " a.set_xticklabels(a.get_xticks(), font)\n", - " a.set_yticklabels(a.get_yticks(), font)\n", + " #a = gca()\n", + " #a.set_xticklabels(a.get_xticks(), font)\n", + " #a.set_yticklabels(a.get_yticks(), font)\n", " name_title = \"S-wave energy\"\n", " plt.title(name_title, fontdict=font)\n", " plt.ylabel('Depth [km]', fontdict=font)\n", @@ -259,7 +259,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.4" } }, "nbformat": 4,