Skip to content

Commit

Permalink
Updated Jupyter notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-koehn committed Dec 13, 2022
1 parent 0080950 commit de2e180
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 109 deletions.
6 changes: 3 additions & 3 deletions Github_update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions par/pythonIO/denise_IO/denise_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
46 changes: 15 additions & 31 deletions par/visu/FWI_marmousi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"fp = open('cmap_cm.pkl', 'rb')\n",
Expand Down Expand Up @@ -87,9 +85,7 @@
{
"cell_type": "code",
"execution_count": 65,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"FSize = 20\n",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -257,9 +243,7 @@
{
"cell_type": "code",
"execution_count": 167,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"plt.close('all')\n",
Expand Down Expand Up @@ -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
}
38 changes: 15 additions & 23 deletions par/visu/Misfit_step_length_evolution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"FSize = 20\n",
Expand All @@ -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)"
]
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -123,9 +119,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -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",
Expand Down Expand Up @@ -177,9 +171,7 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -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",
Expand Down Expand Up @@ -234,7 +226,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -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
}
12 changes: 6 additions & 6 deletions par/visu/Plot_model_PSV.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -241,7 +241,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions par/visu/Plot_model_SH.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -224,7 +224,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion par/visu/Plot_seis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit de2e180

Please sign in to comment.