From 251a26ba8ffa1efa99b6b29a160b108e2bfc1b3a Mon Sep 17 00:00:00 2001 From: stefaniagl Date: Fri, 21 Oct 2022 14:54:33 +0700 Subject: [PATCH] Scripts for figures (#321) Improved scripts for figures based on PRA requirements and added final doi. --- examples/papers/2022_bessel/README.md | 4 ++-- examples/papers/2022_bessel/bb_module.py | 12 ++++++------ examples/papers/2022_bessel/fig12_sphere.py | 1 + examples/papers/2022_bessel/fig13_coated_sphere.py | 1 + examples/papers/2022_bessel/fig14_extrapolation.py | 1 + examples/papers/2022_bessel/fig15_cube.py | 1 + examples/papers/README.md | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/papers/2022_bessel/README.md b/examples/papers/2022_bessel/README.md index f29e6d0b..71af9485 100644 --- a/examples/papers/2022_bessel/README.md +++ b/examples/papers/2022_bessel/README.md @@ -1,9 +1,9 @@ -The following Python scripts reproduce the data plotted in four figures of the paper: Glukhova S.A. and Yurkin M.A. Vector Bessel beams: general classification and scattering simulations, [_arXiv_ 2203.16510](https://arxiv.org/abs/2203.16510) (2022). The data was originally produced with ADDA v.1.5.0-alpha (443f00a). +The following Python scripts reproduce the data plotted in four figures of the paper: Glukhova S.A. and Yurkin M.A. Vector Bessel beams: General classification and scattering simulations, [_Phys. Rev. A_ **106**, 033508](https://doi.org/10.1103/PhysRevA.106.033508). (2022). The data was originally produced with ADDA v.1.5.0-alpha (443f00a). The module `bb_module.py` includes common functions, while the following python scripts run ADDA and produce corresponding figures: * `fig12_sphere.py` * `fig13_coated_sphere.py` -* `fig14_extrapolation.py` (requires 8.2 GB of RAM) +* `fig14_extrapolation.py` (requires 8.2 GB of RAM) * `fig15_cube.py` Other folders (some are produced by scripts): diff --git a/examples/papers/2022_bessel/bb_module.py b/examples/papers/2022_bessel/bb_module.py index 68084486..168f974f 100644 --- a/examples/papers/2022_bessel/bb_module.py +++ b/examples/papers/2022_bessel/bb_module.py @@ -173,7 +173,7 @@ def plotData(xv1,yv1,xv2,yv2,flag,ax): plt.minorticks_on() plt.tick_params(which='major',right=True, top=True) plt.tick_params(which='minor',right=True, top=True) - plt.xlabel(r'Scattering angle $\theta$, deg',labelpad=5.) + plt.xlabel(r'Scattering angle $\theta$ [deg]',labelpad=5.) if flag == 1: plt.ylabel(r'Parallel intensity $I_{\parallel}$',labelpad=2.) plt.title('(a)',loc='left', x=0.035,y=0.03) @@ -191,14 +191,14 @@ def plotData(xv1,yv1,xv2,yv2,flag,ax): # fig 15 scattering intensities def plotData4(xv1,yv1,xv2,yv2,xv3,yv3,xv4,yv4,flag,ax): rc('font',**{'family':'sans-serif','sans-serif':['Arial']}) - plt.plot(xv1, yv1, label = r'CS', color = (107/256,18/256,245/256), linewidth = 1) - plt.plot(xv2, yv2, label = "CS'", color = (121/256,251/256,186/256),linewidth=1) - plt.plot(xv3, yv3, label = 'TEL', color = (230/256,139/256,79/256), linewidth = 1) - plt.plot(xv4, yv4, label = 'TML', color = (234/256,56/256,38/256), linewidth = 1) + plt.plot(xv1, yv1, label = r'CS', color = (107/256,18/256,245/256), linewidth=1.5,linestyle='dashed') + plt.plot(xv2, yv2, label = "CS'", color = (121/256,251/256,186/256),linewidth=1.5,linestyle='solid') + plt.plot(xv3, yv3, label = 'TEL', color = (230/256,139/256,79/256), linewidth=1.5,linestyle='dotted') + plt.plot(xv4, yv4, label = 'TML', color = (234/256,56/256,38/256), linewidth=1.5,linestyle='dashdot') plt.minorticks_on() plt.tick_params(which='major',right=True, top=True) plt.tick_params(which='minor',right=True, top=True) - plt.xlabel(r'Scattering angle $\theta$, deg',labelpad=5.) + plt.xlabel(r'Scattering angle $\theta$ [deg]',labelpad=5.) if flag == 1: plt.ylabel(r'Parallel intensity $I_{\parallel}$',labelpad=3.) plt.title('(e)',loc='left', x=0.035,y=0.85) diff --git a/examples/papers/2022_bessel/fig12_sphere.py b/examples/papers/2022_bessel/fig12_sphere.py index 6ca32821..257be804 100644 --- a/examples/papers/2022_bessel/fig12_sphere.py +++ b/examples/papers/2022_bessel/fig12_sphere.py @@ -41,6 +41,7 @@ # data save os.makedirs('saved', exist_ok=True) +#if needed change .pdf on other types (for example .svg) plt.savefig('saved/fig12_sphere.pdf', bbox_inches='tight') plt.show() \ No newline at end of file diff --git a/examples/papers/2022_bessel/fig13_coated_sphere.py b/examples/papers/2022_bessel/fig13_coated_sphere.py index b49f2787..3ba4e251 100644 --- a/examples/papers/2022_bessel/fig13_coated_sphere.py +++ b/examples/papers/2022_bessel/fig13_coated_sphere.py @@ -41,6 +41,7 @@ # data save os.makedirs('saved', exist_ok=True) +#if needed change .pdf on other types (for example .svg) plt.savefig('saved/fig13_coatedsphere.pdf', bbox_inches='tight') plt.show() \ No newline at end of file diff --git a/examples/papers/2022_bessel/fig14_extrapolation.py b/examples/papers/2022_bessel/fig14_extrapolation.py index c5a01ca2..2bd830b0 100644 --- a/examples/papers/2022_bessel/fig14_extrapolation.py +++ b/examples/papers/2022_bessel/fig14_extrapolation.py @@ -44,6 +44,7 @@ # data save os.makedirs('saved', exist_ok=True) +#if needed change .pdf on other types (for example .svg) plt.savefig('saved/fig14_extrapolation.pdf', bbox_inches='tight') plt.show() diff --git a/examples/papers/2022_bessel/fig15_cube.py b/examples/papers/2022_bessel/fig15_cube.py index 40055600..7ff46a73 100644 --- a/examples/papers/2022_bessel/fig15_cube.py +++ b/examples/papers/2022_bessel/fig15_cube.py @@ -55,6 +55,7 @@ # data save os.makedirs('saved', exist_ok=True) +#if needed change .pdf on other types (for example .svg) plt.savefig('saved/fig15_cube.pdf', bbox_inches='tight') plt.show() \ No newline at end of file diff --git a/examples/papers/README.md b/examples/papers/README.md index f8449d62..9d9ab821 100644 --- a/examples/papers/README.md +++ b/examples/papers/README.md @@ -1,3 +1,3 @@ Examples aimed at reproduction of published results (each folder corresponds to a specific paper), but they can also be browsed as illustrations of various applications and adapted to similar cases. * `2021_WKBr/` - "Uniform-over-size approximation of the internal fields for scatterers with low refractive-index contrast", [_JQSRT_ **277**, 107965](http://doi.org/10.1016/j.jqsrt.2021.107965). -* `2022_bessel/` - "Vector Bessel beams: general classification and scattering simulations", [_arXiv_ 2203.16510](https://arxiv.org/abs/2203.16510). +* `2022_bessel/` - "Vector Bessel beams: General classification and scattering simulations", [_Phys. Rev. A_ **106**, 033508](https://doi.org/10.1103/PhysRevA.106.033508).