Skip to content

Commit

Permalink
Scripts for figures (#321)
Browse files Browse the repository at this point in the history
Improved scripts for figures based on PRA requirements and added final doi.
  • Loading branch information
stefaniagl authored Oct 21, 2022
1 parent ae79c9d commit 251a26b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/papers/2022_bessel/README.md
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
12 changes: 6 additions & 6 deletions examples/papers/2022_bessel/bb_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions examples/papers/2022_bessel/fig12_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 1 addition & 0 deletions examples/papers/2022_bessel/fig13_coated_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 1 addition & 0 deletions examples/papers/2022_bessel/fig14_extrapolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
1 change: 1 addition & 0 deletions examples/papers/2022_bessel/fig15_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/papers/README.md
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit 251a26b

Please sign in to comment.