Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
artiq_experiments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Nunez Barreto
artiq_experiments
Commits
7dd29b8b
Commit
7dd29b8b
authored
Jul 09, 2021
by
Nicolas Nunez Barreto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
agrego script para ver el prendido del aom uv
parent
90f70063
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
123 additions
and
0 deletions
+123
-0
Encendido_AOM_UV.py
analisis/plots/20210705_EncendidoAOM_UV/Encendido_AOM_UV.py
+123
-0
encendido_AOM_UV.png
analisis/plots/20210705_EncendidoAOM_UV/encendido_AOM_UV.png
+0
-0
encendido_AOM_UV_bin1ns.png
...lots/20210705_EncendidoAOM_UV/encendido_AOM_UV_bin1ns.png
+0
-0
encendido_AOM_UV_bin5ns.png
...lots/20210705_EncendidoAOM_UV/encendido_AOM_UV_bin5ns.png
+0
-0
estadistica_uvon_uvoff_poissonian.png
...705_EncendidoAOM_UV/estadistica_uvon_uvoff_poissonian.png
+0
-0
full_encendido_AOM_UV_bin1ns.png
...20210705_EncendidoAOM_UV/full_encendido_AOM_UV_bin1ns.png
+0
-0
No files found.
analisis/plots/20210705_EncendidoAOM_UV/Encendido_AOM_UV.py
0 → 100755
View file @
7dd29b8b
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 7 16:12:04 2021
@author: oem
"""
import
h5py
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
sys
import
re
import
ast
from
scipy.optimize
import
curve_fit
import
os
from
scipy.optimize
import
curve_fit
from
scipy.special
import
factorial
from
scipy.stats
import
poisson
# Solo levanto algunos experimentos
ALL_FILES_SP
=
"""000001556-SingleLine.h5
000001558-SingleLine.h5
000001559-SingleLine.h5
000001560-SingleLine.h5"""
#000001514-SingleLine.h5 #este tiene amplitud 0.08 que es muy poquito
BINW
=
1e-9
T0
=
0.0e-6
os
.
chdir
(
'/home/oem/Documentos/Doctorado/Artiq/Repositorio/artiq_experiments/artiq_master/results/2021-07-05/16'
)
fig0
,
ax0
=
plt
.
subplots
()
#ax1_b = ax1_a.twinx()
for
i
,
fname
in
enumerate
(
ALL_FILES_SP
.
split
()):
if
i
==
3
:
print
(
i
)
print
(
fname
)
data
=
h5py
.
File
(
fname
,
'r'
)
# Leo el h5: Recordar que nuestros datos estan en 'datasets'
# Aca hago algo repugnante para poder levantar los strings que dejamos
# que además tenian un error de tipeo al final. Esto no deberá ser necesario
# cuando se solucione el error este del guardado.
laser_UV_amp
=
data
[
'datasets'
][
'laser_UV_amp'
]
laser_UV_freq
=
data
[
'datasets'
][
'laser_UV_freq'
]
counts
=
np
.
array
(
data
[
'datasets'
][
'counts'
])
bines
=
np
.
arange
(
counts
.
min
(),
counts
.
max
()
+
BINW
,
BINW
)
heigs
,
binsf
=
np
.
histogram
(
counts
,
bines
[
bines
>
T0
])
times
=
[
t
*
1e6
for
t
in
binsf
[:
-
1
]]
#ax0.step([t*1e6 for t in binsf[:-1]], heigs, label=f"AMP: {laser_UV_amp}", where='mid', color='blue', lw=1, alpha=0.4)
ax0
.
plot
(
times
,
heigs
,
'o-'
,
color
=
'blue'
,
lw
=
1
)
#ax0.set_xlim(0.95, 1.2)
ti
=
1.045
tf
=
1.1
#ax0.axvline(ti, color='red', linestyle='dashed', linewidth=2)
#ax0.axvline(tf, color='red', linestyle='dashed', linewidth=2)
ax0
.
set_title
(
f
'UV AOM on, 5 M meds, bin {int(BINW*1e9)} ns, turning on: {round((tf-ti)*1000)} ns'
)
ax0
.
set_xlabel
(
'Time (us)'
)
ax0
.
set_ylabel
(
'Counts'
)
ax0
.
grid
()
#%%
"""
Ahora veo el comportamiento estadistico de oscuridad y del laser prendido a ver si es poissoniano
"""
def
fit_function
(
k
,
lamb
):
'''poisson function, parameter lamb is the fit parameter'''
return
poisson
.
pmf
(
k
,
lamb
)
binw
=
1
counts_UVoff
=
heigs
[
0
:
int
(
0.45
*
len
(
heigs
))]
counts_UVon
=
heigs
[
int
(
0.55
*
len
(
heigs
)):]
N
=
len
(
counts_UVoff
)
mediaoff
=
np
.
mean
(
counts_UVoff
)
mediaon
=
np
.
mean
(
counts_UVon
)
binesoff
=
np
.
arange
(
counts_UVoff
.
min
(),
counts_UVoff
.
max
()
+
binw
,
binw
)
bineson
=
np
.
arange
(
counts_UVon
.
min
(),
counts_UVon
.
max
()
+
binw
,
binw
)
heigsoff
,
binsoff
=
np
.
histogram
(
counts_UVoff
,
binesoff
)
heigson
,
binson
=
np
.
histogram
(
counts_UVon
,
bineson
)
#plt.figure()
#plt.plot(binsoff[:-1], heigsoff, 'o-', bineson[:-1], heigson, 'o-')
"""
#Puedo ajustar con poissoniana o directamente plotearle una
parametersoff, cov_matrixoff = curve_fit(fit_function, binsoff[:-1], heigsoff/sum(heigsoff))
parameterson, cov_matrixon = curve_fit(fit_function, binson[:-1], heigson/sum(heigson))
"""
xoff
=
binsoff
[:
-
1
]
xon
=
binson
[:
-
1
]
plt
.
figure
()
plt
.
plot
(
binsoff
[:
-
1
],
heigsoff
/
sum
(
heigsoff
),
'ko'
,
label
=
'Laser UV off'
)
plt
.
plot
(
xoff
,
[
fit_function
(
k
,
np
.
mean
(
counts_UVoff
))
for
k
in
xoff
],
'r'
,
lw
=
3
)
plt
.
plot
(
binson
[:
-
1
],
heigson
/
sum
(
heigson
),
'bo'
,
label
=
'Laser UV on'
)
plt
.
plot
(
xon
,[
fit_function
(
k
,
np
.
mean
(
counts_UVon
))
for
k
in
xon
],
'r'
,
lw
=
3
)
plt
.
xlabel
(
'Counts'
)
plt
.
ylabel
(
'Occurrences'
)
plt
.
title
(
f
'Bin: {binw} ns, {N} measurements, no ions'
)
plt
.
legend
()
analisis/plots/20210705_EncendidoAOM_UV/encendido_AOM_UV.png
0 → 100644
View file @
7dd29b8b
15.9 KB
analisis/plots/20210705_EncendidoAOM_UV/encendido_AOM_UV_bin1ns.png
0 → 100644
View file @
7dd29b8b
21.5 KB
analisis/plots/20210705_EncendidoAOM_UV/encendido_AOM_UV_bin5ns.png
0 → 100644
View file @
7dd29b8b
16 KB
analisis/plots/20210705_EncendidoAOM_UV/estadistica_uvon_uvoff_poissonian.png
0 → 100644
View file @
7dd29b8b
16.5 KB
analisis/plots/20210705_EncendidoAOM_UV/full_encendido_AOM_UV_bin1ns.png
0 → 100644
View file @
7dd29b8b
17.5 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment