Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
models
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
documentation
models
Commits
18bb0367
Commit
18bb0367
authored
2 years ago
by
Guillaume Demesy
Browse files
Options
Downloads
Patches
Plain Diff
clean up again
parent
e4806545
No related branches found
No related tags found
1 merge request
!7
pillar + check Mmatrix again
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
DiffractionGratings/grating3D_parallel_Mmatrix.sh
+5
-2
5 additions, 2 deletions
DiffractionGratings/grating3D_parallel_Mmatrix.sh
DiffractionGratings/grating3D_postplot_Mmatrix.py
+21
-27
21 additions, 27 deletions
DiffractionGratings/grating3D_postplot_Mmatrix.py
with
26 additions
and
29 deletions
DiffractionGratings/grating3D_parallel_Mmatrix.sh
+
5
−
2
View file @
18bb0367
...
@@ -3,18 +3,21 @@ export OPENBLAS_NUM_THREADS=1
...
@@ -3,18 +3,21 @@ export OPENBLAS_NUM_THREADS=1
export
OMP_NUM_THREADS
=
1
export
OMP_NUM_THREADS
=
1
export
NPROC
=
96
export
NPROC
=
96
### choose configuration
### theta loop study for the pillar case
export
flag_angle_study
=
"theta"
export
flag_angle_study
=
"theta"
export
loop_angle_max
=
50
export
loop_angle_max
=
50
export
fixed_angle
=
90
export
fixed_angle
=
90
export
GRATING_CASE
=
"pillar"
export
GRATING_CASE
=
"pillar"
### phi loop study for the half_ellipsoid case
# export flag_angle_study="phi"
# export flag_angle_study="phi"
# export loop_angle_max=360
# export loop_angle_max=360
# export fixed_angle=50
# export fixed_angle=50
# export GRATING_CASE="half_ellipsoid"
# export GRATING_CASE="half_ellipsoid"
export
nb_angle
=
2
export
nb_angle
=
2
0
export
nb_lam
=
2
export
nb_lam
=
100
export
lambda_min
=
400
export
lambda_min
=
400
export
lambda_max
=
1200
export
lambda_max
=
1200
export
FLAG_TOTAL
=
0
export
FLAG_TOTAL
=
0
...
...
This diff is collapsed.
Click to expand it.
DiffractionGratings/grating3D_postplot_Mmatrix.py
+
21
−
27
View file @
18bb0367
...
@@ -3,28 +3,6 @@ import matplotlib.pyplot as plt
...
@@ -3,28 +3,6 @@ import matplotlib.pyplot as plt
import
matplotlib
as
mpl
import
matplotlib
as
mpl
import
scipy.constants
as
scc
import
scipy.constants
as
scc
import
argparse
import
argparse
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
-flag_angle_study
"
,
help
=
"
flag_angle_study
"
,
type
=
str
,
default
=
'
phi
'
)
parser
.
add_argument
(
"
-nb_angle
"
,
help
=
"
nb_angle
"
,
type
=
int
,
default
=
2
)
parser
.
add_argument
(
"
-loop_angle_max
"
,
help
=
"
loop_angle_max
"
,
type
=
float
,
default
=
360
)
parser
.
add_argument
(
"
-fixed_angle
"
,
help
=
"
fixed_angle
"
,
type
=
float
,
default
=
50
)
parser
.
add_argument
(
"
-nb_lam
"
,
help
=
"
nb_lam
"
,
type
=
int
,
default
=
2
)
parser
.
add_argument
(
"
-lambda_min
"
,
help
=
"
lambda_min
"
,
type
=
float
,
default
=
400
)
parser
.
add_argument
(
"
-lambda_max
"
,
help
=
"
lambda_max
"
,
type
=
float
,
default
=
1200
)
args
=
parser
.
parse_args
()
flag_angle_study
=
args
.
flag_angle_study
nb_angle
=
args
.
nb_angle
loop_angle_max
=
args
.
loop_angle_max
fixed_angle
=
args
.
fixed_angle
nb_lam
=
args
.
nb_lam
lambda_min
=
args
.
lambda_min
lambda_max
=
args
.
lambda_max
FLAG_TOT
=
0
plt
.
rcParams
.
update
({
"
text.usetex
"
:
True
,
"
font.family
"
:
"
serif
"
})
plt
.
rcParams
.
update
({
"
text.usetex
"
:
True
,
"
font.family
"
:
"
serif
"
})
def
add_colorbar
(
mappable
):
def
add_colorbar
(
mappable
):
...
@@ -46,6 +24,27 @@ def load_getdp_integral(fname):
...
@@ -46,6 +24,27 @@ def load_getdp_integral(fname):
else
:
else
:
return
temp
[:,
1
]
+
1j
*
temp
[:,
2
]
return
temp
[:,
1
]
+
1j
*
temp
[:,
2
]
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
-flag_angle_study
"
,
help
=
"
flag_angle_study
"
,
type
=
str
,
default
=
'
theta
'
)
parser
.
add_argument
(
"
-nb_angle
"
,
help
=
"
nb_angle
"
,
type
=
int
,
default
=
20
)
parser
.
add_argument
(
"
-loop_angle_max
"
,
help
=
"
loop_angle_max
"
,
type
=
float
,
default
=
50
)
parser
.
add_argument
(
"
-fixed_angle
"
,
help
=
"
fixed_angle
"
,
type
=
float
,
default
=
90
)
parser
.
add_argument
(
"
-nb_lam
"
,
help
=
"
nb_lam
"
,
type
=
int
,
default
=
100
)
parser
.
add_argument
(
"
-lambda_min
"
,
help
=
"
lambda_min
"
,
type
=
float
,
default
=
400
)
parser
.
add_argument
(
"
-lambda_max
"
,
help
=
"
lambda_max
"
,
type
=
float
,
default
=
1200
)
args
=
parser
.
parse_args
()
flag_angle_study
=
args
.
flag_angle_study
nb_angle
=
args
.
nb_angle
loop_angle_max
=
args
.
loop_angle_max
fixed_angle
=
args
.
fixed_angle
nb_lam
=
args
.
nb_lam
lambda_min
=
args
.
lambda_min
lambda_max
=
args
.
lambda_max
FLAG_TOT
=
0
str_reftrans
=
'
r
'
respath
=
'
res_Matrix_nb_lam%g_nb_%s%g_total0/
'
%
(
nb_lam
,
flag_angle_study
,
nb_angle
)
respath
=
'
res_Matrix_nb_lam%g_nb_%s%g_total0/
'
%
(
nb_lam
,
flag_angle_study
,
nb_angle
)
rpp
=
np
.
zeros
((
nb_lam
,
nb_angle
),
dtype
=
complex
)
rpp
=
np
.
zeros
((
nb_lam
,
nb_angle
),
dtype
=
complex
)
...
@@ -68,7 +67,6 @@ tab_angle = np.linspace(0,loop_angle_max,nb_angle)
...
@@ -68,7 +67,6 @@ tab_angle = np.linspace(0,loop_angle_max,nb_angle)
tab_hnu
=
2
*
scc
.
pi
*
scc
.
c
/
(
tab_lam
*
1e-9
/
scc
.
hbar
*
scc
.
eV
)
tab_hnu
=
2
*
scc
.
pi
*
scc
.
c
/
(
tab_lam
*
1e-9
/
scc
.
hbar
*
scc
.
eV
)
M
=
np
.
zeros
((
4
,
4
,
nb_lam
,
nb_angle
),
dtype
=
complex
)
M
=
np
.
zeros
((
4
,
4
,
nb_lam
,
nb_angle
),
dtype
=
complex
)
### Convention used e.g. in https://doi.org/10.1364/JOSAB.36.000E78
### Convention used e.g. in https://doi.org/10.1364/JOSAB.36.000E78
# [Ep] [ rpp rps ] [Ep]
# [Ep] [ rpp rps ] [Ep]
# [ ] = [ ] [ ]
# [ ] = [ ] [ ]
...
@@ -77,8 +75,6 @@ M = np.zeros((4,4,nb_lam,nb_angle),dtype=complex)
...
@@ -77,8 +75,6 @@ M = np.zeros((4,4,nb_lam,nb_angle),dtype=complex)
# that are parallel (resp. perpendicular) to the plane of incidence
# that are parallel (resp. perpendicular) to the plane of incidence
# rps : send Es_inc (s-in), project the reflected field along p (p-out)
# rps : send Es_inc (s-in), project the reflected field along p (p-out)
str_reftrans
=
'
r
'
for
i
in
range
(
nb_lam
):
for
i
in
range
(
nb_lam
):
print
(
i
)
print
(
i
)
for
j
in
range
(
nb_angle
):
for
j
in
range
(
nb_angle
):
...
@@ -167,8 +163,6 @@ ax=axes[1,1];zplot = ax.pcolormesh(L,P,R00_pin.real );add_colorbar(zplot);ax.ti
...
@@ -167,8 +163,6 @@ ax=axes[1,1];zplot = ax.pcolormesh(L,P,R00_pin.real );add_colorbar(zplot);ax.ti
ax
=
axes
[
2
,
1
];
zplot
=
ax
.
pcolormesh
(
L
,
P
,
Qscat_pin
.
real
);
add_colorbar
(
zplot
);
ax
.
title
.
set_text
(
'
Abs pin
'
)
ax
=
axes
[
2
,
1
];
zplot
=
ax
.
pcolormesh
(
L
,
P
,
Qscat_pin
.
real
);
add_colorbar
(
zplot
);
ax
.
title
.
set_text
(
'
Abs pin
'
)
plt
.
savefig
(
'
BALANCE_new_code.jpg
'
)
plt
.
savefig
(
'
BALANCE_new_code.jpg
'
)
fig
,
axes
=
plt
.
subplots
(
4
,
4
,
subplot_kw
=
dict
(
projection
=
'
polar
'
)
,
figsize
=
(
12
,
12
))
fig
,
axes
=
plt
.
subplots
(
4
,
4
,
subplot_kw
=
dict
(
projection
=
'
polar
'
)
,
figsize
=
(
12
,
12
))
flag_lam
=
False
flag_lam
=
False
rlabel
=
r
"
$\hbar \nu$
"
if
not
flag_lam
else
r
"
$\lambda_0$
"
rlabel
=
r
"
$\hbar \nu$
"
if
not
flag_lam
else
r
"
$\lambda_0$
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment