Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
analysis
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2037-01-11.
Why is this scheduled?
Show more breadcrumbs
Leo Bosse
analysis
Commits
db554f6a
Commit
db554f6a
authored
4 years ago
by
Leo Bosse
Browse files
Options
Downloads
Patches
Plain Diff
MAJOR COMMIT: correct the lockin amplifier simulation ! Lower DOLP
parent
5ca41a56
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rayleigh/__pycache__/simulation.cpython-36.pyc
+0
-0
0 additions, 0 deletions
rayleigh/__pycache__/simulation.cpython-36.pyc
rayleigh/simulation.py
+9
-6
9 additions, 6 deletions
rayleigh/simulation.py
with
9 additions
and
6 deletions
rayleigh/__pycache__/simulation.cpython-36.pyc
+
0
−
0
View file @
db554f6a
No preview for this file type
This diff is collapsed.
Click to expand it.
rayleigh/simulation.py
+
9
−
6
View file @
db554f6a
...
...
@@ -158,13 +158,15 @@ class Simulation:
###Compute the AoLP contribution histogram.
self
.
N_bins
=
180
#bins is the bins limits, so 181 values
self
.
bins
,
self
.
width
=
np
.
linspace
(
-
np
.
pi
/
2
,
np
.
pi
/
2
,
self
.
N_bins
+
1
,
endpoint
=
True
,
retstep
=
True
)
self
.
bins
,
self
.
width
=
np
.
linspace
(
-
np
.
pi
/
2
-
self
.
width
/
2
,
np
.
pi
/
2
+
self
.
width
/
2
,
self
.
N_bins
+
1
,
endpoint
=
True
,
retstep
=
True
)
print
(
"
DEBUG ROT
"
)
self
.
mid_bins
=
[
self
.
bins
[
i
+
1
]
-
self
.
bins
[
i
]
for
i
in
range
(
len
(
self
.
bins
)
-
1
)]
self
.
mid_bins
=
[(
self
.
bins
[
i
+
1
]
+
self
.
bins
[
i
])
/
2.
for
i
in
range
(
len
(
self
.
bins
)
-
1
)]
#self.width = np.pi / self.N_bins
#One value for each bin=180 values
self
.
hst
=
np
.
zeros
(
self
.
N_bins
)
print
(
"
DEBUG ROT
"
,
self
.
N_bins
,
len
(
self
.
bins
),
len
(
self
.
mid_bins
),
len
(
self
.
hst
))
if
sky
:
sky_hst
,
b
=
np
.
histogram
(
self
.
world
.
sky_map
.
AoRD_map
[
time
,
ie_pc
,
ia_pc
,
:,
:],
bins
=
self
.
bins
,
weights
=
self
.
world
.
sky_map
.
scattering_map
[
time
,
ie_pc
,
ia_pc
,
:,
:],
density
=
False
)
...
...
@@ -186,13 +188,14 @@ class Simulation:
filter_orientation
=
np
.
linspace
(
0
,
2
*
np
.
pi
,
Ns
,
endpoint
=
False
)
for
i_f
,
f
in
enumerate
(
filter_orientation
):
for
ihist
,
hist
in
enumerate
(
self
.
hst
):
theta
=
b
[(
ihist
+
1
)
%
len
(
self
.
hst
)]
-
b
[
ihist
]
theta
=
self
.
mid_bins
[
ihist
]
# theta = b[(ihist+1)%len(self.hst)] - b[ihist]
rs_signal
[
i_f
]
+=
hist
*
np
.
cos
(
theta
-
f
)
**
2
# rs_signal[i_f] += hist * np.cos(b[ihist] - f) ** 2 # + 0.5 * self.InonPola
plt
.
plot
(
filter_orientation
,
rs_signal
)
plt
.
plot
(
filter_orientation
,
[
0.5
*
self
.
InonPola
*
(
len
(
self
.
hst
)
)
]
*
Ns
)
plt
.
show
()
#
plt.plot(filter_orientation, rs_signal)
#
plt.plot(filter_orientation, [0.5 * self.InonPola * len(self.hst)]*Ns)
#
plt.show()
self
.
V
=
np
.
average
(
rs_signal
)
self
.
Vcos
=
np
.
average
(
rs_signal
*
np
.
cos
(
2
*
filter_orientation
))
...
...
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