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
a02a40a3
Commit
a02a40a3
authored
Apr 07, 2025
by
Nicolas Nunez Barreto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
todo
parent
9b944802
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
Transitorios_osci.py
...0250313_fluorescencecorrelationtests/Transitorios_osci.py
+13
-7
No files found.
analisis/plots/20250313_fluorescencecorrelationtests/Transitorios_osci.py
View file @
a02a40a3
...
...
@@ -152,7 +152,7 @@ T0 = -0.4e-6
#files = [20577,20578,20579,20580,20581] #el 19613 es el que muestra el pico en 48.5 Hz
files
=
[
2058
7
]
#el 19613 es el que muestra el pico en 48.5 Hz
files
=
[
2058
6
]
#el 19613 es el que muestra el pico en 48.5 Hz
def
bin_time_arrivals
(
arrival_times
,
tau
):
"""
...
...
@@ -228,7 +228,7 @@ for i, fname in enumerate(files):
plt
.
xlabel
(
'Frecuencia RF (MHz)'
)
plt
.
ylabel
(
'Amplitud oscilacion'
)
#%%
"""
Grafico temporal replicado 3 veces a la frecuencia dada
"""
...
...
@@ -252,19 +252,23 @@ y_extended = np.tile(hist, 3)
def
sinusoidal
(
x
,
A
,
C
,
D
):
return
A
*
np
.
sin
(
2
*
np
.
pi
*
freqrf
*
x
+
C
)
+
D
def
sinusoidal2
(
x
,
A
,
b
,
C
,
D
,
E
):
return
A
*
((
C
**
2
)
/
(
C
**
2
+
(
D
-
b
*
np
.
sin
(
2
*
np
.
pi
*
freqrf
*
x
))
**
2
))
+
E
def
lorentzian
(
x
,
A
,
b
,
C
,
det
,
fase
,
cte
):
det
=
-
10e6
*
2
*
np
.
pi
return
A
*
((
C
**
2
)
/
(
C
**
2
+
(
det
-
b
*
2
*
np
.
pi
*
freqrf
*
np
.
sin
(
2
*
np
.
pi
*
freqrf
*
x
+
fase
))
**
2
))
+
cte
x_extended_dense
=
np
.
arange
(
np
.
min
(
x_extended
),
np
.
max
(
x_extended
),
0.1
*
(
x_extended
[
1
]
-
x_extended
[
0
]))
params
,
_
=
curve_fit
(
sinusoidal
,
x_extended
,
y_extended
,
p0
=
[
max
(
y_extended
),
0
,
np
.
mean
(
y_extended
)])
#params, _ = curve_fit(sinusoidal, x_extended, y_extended, p0=[max(y_extended), 0, np.mean(y_extended)])
params
,
_
=
curve_fit
(
lorentzian
,
x_extended
,
y_extended
,
p0
=
[
1
,
1
,
1e7
,
1e7
,
1
,
1
])
amps
.
append
(
np
.
abs
(
params
[
0
]))
# Graficar los datos y el ajuste
plt
.
figure
(
figsize
=
(
8
,
4
))
# plt.plot(x_extended, y_extended, marker='o', linestyle='-', label="Datos", color='gray')
plt
.
plot
(
x_extended_dense
,
sinusoidal
(
x_extended_dense
,
*
params
),
linestyle
=
'--'
,
label
=
"Ajuste sinusoidal"
,
color
=
'black'
,
linewidth
=
3
,
zorder
=
2
)
#plt.plot(x_extended_dense, sinusoidal(x_extended_dense, *params), linestyle='--', label="Ajuste sinusoidal", color='black',linewidth=3,zorder=2)
plt
.
plot
(
x_extended_dense
,
lorentzian
(
x_extended_dense
,
*
params
),
linestyle
=
'--'
,
label
=
"Ajuste completo"
,
color
=
'black'
,
linewidth
=
3
,
zorder
=
2
)
for
i
in
range
(
3
):
plt
.
plot
(
bin_edges
[:
-
1
]
+
i
*
taurf
,
hist
,
marker
=
'o'
,
linestyle
=
'-'
,
color
=
colors
[
i
],
markersize
=
3
,
zorder
=
1
)
...
...
@@ -278,3 +282,5 @@ plt.show()
print
(
f
'Amplitud normalizada: {np.abs(round(100*params[0]/params[2],3))}
%
'
)
print
(
f
'Beta: {np.abs(params[1])}'
)
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