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
405c667a
Commit
405c667a
authored
Jan 08, 2024
by
Marcelo Luda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intentos de ajuste de 3 iones
parent
9f5a811c
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1164 additions
and
18 deletions
+1164
-18
lolo_CPT_plotter_20231123_multi.py
...123_CPTconmicromocion3/lolo_CPT_plotter_20231123_multi.py
+1111
-0
lolo_graficos_pub.py
...is/plots/20231123_CPTconmicromocion3/lolo_graficos_pub.py
+53
-18
No files found.
analisis/plots/20231123_CPTconmicromocion3/lolo_CPT_plotter_20231123_multi.py
0 → 100644
View file @
405c667a
This diff is collapsed.
Click to expand it.
analisis/plots/20231123_CPTconmicromocion3/lolo_graficos_pub.py
View file @
405c667a
...
...
@@ -300,6 +300,9 @@ alpha = 0
voltages_dcA
=
Voltages
[
0
][
SelectedCurveVec
]
def
hiperbola
(
x
,
a
,
y0
,
b
,
x0
):
...
...
@@ -441,14 +444,14 @@ x_hip = np.linspace(-0.23,0.005,200)
ax
=
ax_central
ax
.
errorbar
(
voltages_dcA
[
I
],
Betas_vec
[
I
],
yerr
=
ErrorBetas_vec
[
I
],
fmt
=
'o'
,
capsize
=
4
,
markersize
=
3
,
color
=
'C3'
,
label
=
r'fitted $\beta$'
)
ax
.
plot
(
x_hip
,
hiperbola
(
x
hip
,
*
popthip
),
color
=
'C0'
,
label
=
r'hyperbola model'
)
ax
.
plot
(
x_hip
,
hiperbola
(
x
_hip
,
*
param
),
color
=
'C0'
,
label
=
r'hyperbola model'
)
ax
.
set_ylabel
(
r'Modulation factor $\beta$'
,
labelpad
=-
5
)
ax
.
set_ylim
(
-
0.05
,
3
)
ax
.
set_xlim
(
-
0.22
,
0
)
ax
.
set_title
(
f
'(g)'
,
x
=
0.95
,
y
=
0.006
,
color
=
'gray'
)
ax
=
ax_res
ax
.
errorbar
(
voltages_dcA
[
I
],
Betas_vec
[
I
]
-
hiperbola
(
voltages_dcA
[
I
],
*
p
opthip
),
ax
.
errorbar
(
voltages_dcA
[
I
],
Betas_vec
[
I
]
-
hiperbola
(
voltages_dcA
[
I
],
*
p
aram
),
yerr
=
ErrorBetas_vec
[
I
],
fmt
=
'o'
,
capsize
=
4
,
markersize
=
3
,
color
=
'C3'
)
ax
.
axhline
(
0
,
color
=
'C0'
)
ax
.
set_ylabel
(
'Res.'
,
labelpad
=-
5
)
...
...
@@ -479,9 +482,9 @@ for jj,ax in zip(selection,axes_vec):
# Leyenda ##############################
h1
,
l1
=
ax_central
.
get_legend_handles_labels
()
h2
,
l2
=
axx
[
0
,
0
]
.
get_legend_handles_labels
()
ax_central
.
legend
(
h1
+
h2
,
l1
+
l2
,
loc
=
'upper left'
)
#
h1, l1 = ax_central.get_legend_handles_labels()
#
h2, l2 = axx[0,0].get_legend_handles_labels()
#
ax_central.legend(h1+h2, l1+l2, loc='upper left')
...
...
@@ -495,7 +498,7 @@ fig.savefig('grafico_central_opcion_A.pdf')
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% Gráfico central OPCION
A
#%% Gráfico central OPCION
B
import
matplotlib.pyplot
as
plt
plt
.
rcParams
.
update
({
'font.size'
:
8
})
...
...
@@ -533,7 +536,7 @@ gs2 = gridspec.GridSpec(4,3, width_ratios=width_ratios,left=0.16,right=0.9,botto
ax_central
=
fig
.
add_subplot
(
gs2
[
1
:
-
1
,
1
])
ax_dib
=
fig
.
add_subplot
(
gs2
[
0
,
1
])
ax_dib
=
fig
.
add_subplot
(
gs2
[
0
,
1
]
,
sharex
=
ax_res
)
ax_dib
.
spines
[:]
.
set_visible
(
False
)
ax_dib
.
xaxis
.
set_tick_params
(
labelbottom
=
False
)
ax_dib
.
yaxis
.
set_tick_params
(
labelleft
=
False
)
...
...
@@ -560,12 +563,29 @@ tmp_datos=(Detuningsshort_vec[selection,:],
np
.
array
(
selection
)
+
1
,
axes_vec
,
'abcfed'
)
from
scipy.signal
import
savgol_filter
as
savgol
for
Detunings_3_SA_short
,
CountsDR
,
Detunings_3_SA_long
,
FittedEITpi_3_SA_long
,
selectedcurve
,
ax
,
le
in
zip
(
*
tmp_datos
):
ax
.
errorbar
(
Detunings_3_SA_short
,
CountsDR
,
yerr
=
2
*
np
.
sqrt
(
CountsDR
),
fmt
=
'o'
,
color
=
'darkgreen'
,
alpha
=
0.2
,
capsize
=
2
,
markersize
=
2
,
label
=
'measured data'
)
# ax.errorbar(Detunings_3_SA_short, CountsDR, yerr=2*np.sqrt(CountsDR),
# fmt='o', color='darkgreen', alpha=0.2, capsize=2,
# markersize=2, label='measured data')
yerr_max
=
CountsDR
+
2
*
np
.
sqrt
(
CountsDR
)
yerr_min
=
CountsDR
-
2
*
np
.
sqrt
(
CountsDR
)
yerr_max
=
savgol
(
yerr_max
,
3
,
2
)
yerr_min
=
savgol
(
yerr_min
,
3
,
2
)
ax
.
fill_between
(
Detunings_3_SA_short
,
yerr_max
,
yerr_min
,
color
=
'darkgreen'
,
alpha
=
0.2
)
ax
.
plot
(
Detunings_3_SA_short
,
CountsDR
,
'.'
,
ms
=
2
,
color
=
'darkgreen'
,
alpha
=
0.9
)
ax
.
plot
(
Detunings_3_SA_long
,
FittedEITpi_3_SA_long
,
color
=
'black'
,
linewidth
=
2
,
label
=
f
'micromotion model'
,
alpha
=
0.7
)
color
=
'black'
,
linewidth
=
1
,
label
=
f
'micromotion model'
,
alpha
=
0.7
)
ax
.
grid
(
True
,
ls
=
":"
,
color
=
'lightgray'
)
...
...
@@ -597,14 +617,14 @@ x_hip = np.linspace(-0.23,0.005,200)
ax
=
ax_central
ax
.
errorbar
(
voltages_dcA
[
I
],
Betas_vec
[
I
],
yerr
=
ErrorBetas_vec
[
I
],
fmt
=
'o'
,
capsize
=
4
,
markersize
=
3
,
color
=
'C3'
,
label
=
r'fitted $\beta$'
)
ax
.
plot
(
x_hip
,
hiperbola
(
x
hip
,
*
popthip
),
color
=
'C0'
,
label
=
r'hyperbola model'
)
ax
.
plot
(
x_hip
,
hiperbola
(
x
_hip
,
*
param
),
color
=
'C0'
,
label
=
r'hyperbola model'
)
ax
.
set_ylabel
(
r'Modulation factor $\beta$'
,
labelpad
=-
5
)
ax
.
set_ylim
(
-
0.05
,
3
)
ax
.
set_xlim
(
-
0.22
,
0
)
ax
.
set_title
(
f
'(g)'
,
x
=
0.95
,
y
=
0.006
,
color
=
'gray'
)
ax
=
ax_res
ax
.
errorbar
(
voltages_dcA
[
I
],
Betas_vec
[
I
]
-
hiperbola
(
voltages_dcA
[
I
],
*
p
opthip
),
ax
.
errorbar
(
voltages_dcA
[
I
],
Betas_vec
[
I
]
-
hiperbola
(
voltages_dcA
[
I
],
*
p
aram
),
yerr
=
ErrorBetas_vec
[
I
],
fmt
=
'o'
,
capsize
=
4
,
markersize
=
3
,
color
=
'C3'
)
ax
.
axhline
(
0
,
color
=
'C0'
)
ax
.
set_ylabel
(
'Res.'
,
labelpad
=-
5
)
...
...
@@ -638,14 +658,29 @@ for jj,ax in zip(selection,axes_vec):
a
,
y0
,
b
,
x0
=
param
ax_dib
.
plot
(
x_hip
,
x_hip
*
0
+
y0
,
color
=
'gray)
ax_dib.set_ylim(0,y0*1.1'
)
ax_dib
.
plot
(
x_hip
,
x_hip
*
0
+
y0
,
color
=
'gray'
)
ax_dib
.
set_ylim
(
-
y0
*
0.1
,
y0
*
1.2
)
ax_dib
.
plot
(
[
x0
],
[
0
],
'x'
)
ax_dib
.
text
(
x0
+
0.01
,
0
,
'trap center'
,
fontsize
=
8
,
ha
=
'left'
,
va
=
'center'
,
color
=
'C0'
)
ax_dib
.
plot
(
voltages_dcA
[
I
],
voltages_dcA
[
I
]
*
0
+
y0
,
'.'
)
for
Vx
in
voltages_dcA
[
I
]:
ax_dib
.
plot
(
[
Vx
,
x0
],
[
y0
,
0
],
':'
,
color
=
'lightgray'
,
lw
=
1
)
import
matplotlib.patches
as
mpatches
arr
=
mpatches
.
FancyArrowPatch
((
x0
,
y0
*
1.1
),
(
x0
/
2
,
y0
*
1.1
),
arrowstyle
=
'->,head_width=.15'
,
mutation_scale
=
10
,
color
=
'C1'
)
ax_dib
.
add_patch
(
arr
)
ax_dib
.
annotate
(
"ion position"
,
(
.5
,
.5
),
xycoords
=
arr
,
ha
=
'center'
,
va
=
'bottom'
,
color
=
'C1'
)
# Leyenda ##############################
h1
,
l1
=
ax_central
.
get_legend_handles_labels
()
h2
,
l2
=
axx
[
0
,
0
]
.
get_legend_handles_labels
()
ax_central
.
legend
(
h1
+
h2
,
l1
+
l2
,
loc
=
'upper left'
)
#
h1, l1 = ax_central.get_legend_handles_labels()
#
h2, l2 = axx[0,0].get_legend_handles_labels()
#
ax_central.legend(h1+h2, l1+l2, loc='upper left')
...
...
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