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
3ebe2682
Commit
3ebe2682
authored
Aug 17, 2023
by
Nicolas Nunez Barreto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://code.df.uba.ar/nnunez/artiq_experiments
parents
f4b0d599
09f1e042
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
717 additions
and
0 deletions
+717
-0
RDS_location2_lolo.py
.../20230815_RotationalDopplerShift_v3/RDS_location2_lolo.py
+717
-0
config+2-2_colineal_ion_al_costado_compOven.png
...rShift_v3/config+2-2_colineal_ion_al_costado_compOven.png
+0
-0
config+2-2_colineal_ion_al_costado_dcA.png
...opplerShift_v3/config+2-2_colineal_ion_al_costado_dcA.png
+0
-0
config+2-2_colineal_ion_ariba_compOven.png
...opplerShift_v3/config+2-2_colineal_ion_ariba_compOven.png
+0
-0
config+2-2_colineal_ion_ariba_dcA.png
...onalDopplerShift_v3/config+2-2_colineal_ion_ariba_dcA.png
+0
-0
No files found.
analisis/plots/20230815_RotationalDopplerShift_v3/RDS_location2_lolo.py
0 → 100644
View file @
3ebe2682
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
import
interpolate
from
glob
import
glob
#%% Funciones auxiliares
# Función para verificar lectura de archivos
def
SeeKeys
(
files
):
for
i
,
fname
in
enumerate
(
files
):
data
=
h5py
.
File
(
fname
,
'r'
)
# Leo el h5: Recordar que nuestros datos estan en 'datasets'
print
(
fname
)
print
(
list
(
data
[
'datasets'
]
.
keys
()))
def
clean_jumps_below
(
frec
,
amp
,
umbral
=
0
):
"""
función para filtrar los spickes menores a un humbral determinado
"""
frec
=
np
.
array
(
frec
)
amp
=
np
.
array
(
amp
)
return
frec
[
amp
>
umbral
]
,
amp
[
amp
>
umbral
]
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% Carga de datos experimentales
# glob('/home/lolo/tmp/github/artiq_experiments/artiq_master/results/2023-08-16')
DATAFILES
=
sorted
(
glob
(
'../../../artiq_master/results/2023-08-16/*/*.h5'
)
+
glob
(
'../../../artiq_master/results/2023-08-15/*/*.h5'
))
""" Bitácora Nico:
Configuracion +2/-2 colineales, ion al costado del haz:
-desde 14410 hasta 14425: barriendo dcA (las tensiones en cada uno están en el dataset "initialvoltage_dcA",
los medi desordenados pero podés importar también su tensión correspondiente)
-desde 14429 hasta 14439: barriendo compOVEN (lo mismo,
las tensiones estan en el dataset "initialvoltage_compOven")
Configuracion +2/-2 colineales, ion arriba del haz:
-14449 y 14450: barriendo dcA (muchas tensiones por cada medicion, especificadas
en el dataset "scanning_voltages")
-14455, 14456, 14457, 14458: barriendo compOVEN (tres o cuatro tensiones por cada
medicion, tmb especificadas en el dataset "scanning_voltages")
"""
DATAFILES_costado_dcA
=
[
aa
for
aa
in
DATAFILES
for
jj
in
range
(
14410
,
14425
+
1
)
if
f
'{jj}'
in
aa
]
DATAFILES_costado_compOVEN
=
[
aa
for
aa
in
DATAFILES
for
jj
in
range
(
14429
,
14439
+
1
)
if
f
'{jj}'
in
aa
]
DATAFILES_arriba_dcA
=
[
aa
for
aa
in
DATAFILES
for
jj
in
range
(
14449
,
14450
+
1
)
if
f
'{jj}'
in
aa
]
DATAFILES_arriba_compOVEN
=
[
aa
for
aa
in
DATAFILES
for
jj
in
range
(
14455
,
14458
+
1
)
if
f
'{jj}'
in
aa
]
#%% Configuracion +2/-2 colineales, ion al costado del haz dcA
# SeeKeys(DATAFILES_costado_dcA[:1])
# data = h5py.File(DATAFILES_costado_dcA[0], 'r')
# for kk,vv in data['datasets'].items():
# print(f'{kk}:\t',vv)
from
scipy.signal
import
savgol_filter
as
savgol
# Grafico con subplots
fig
,
axx
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
12
,
8
),
constrained_layout
=
True
,
sharey
=
True
)
fig
.
set_constrained_layout_pads
(
w_pad
=
1
/
72
,
h_pad
=
0
,
hspace
=
0
,
wspace
=
0
)
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
I_base_fit
=
np
.
arange
(
0
,
50
)
.
tolist
()
+
np
.
arange
(
230
,
280
)
.
tolist
()
+
np
.
arange
(
450
,
459
)
.
tolist
()
I_base_fit
=
np
.
array
(
I_base_fit
)
ax
=
axx
[
0
]
NORMALIZADO
=
True
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
picos
=
{
0
:[],
1
:[]}
dcA_vec
=
[]
for
data
in
sorted
([
h5py
.
File
(
DataFile
,
'r'
)
for
DataFile
in
DATAFILES_costado_dcA
],
key
=
lambda
x
:
np
.
array
(
x
[
'datasets'
][
'initialvoltage_dcA'
])
):
frecuencia
=
np
.
array
(
data
[
'datasets'
][
'IR1_Frequencies'
])
*
2e-6
cuentas
=
np
.
array
(
data
[
'datasets'
][
'counts_spectrum'
])
amplitudes
=
np
.
array
(
data
[
'datasets'
][
'IR1_Amplitudes'
])
dcA
=
np
.
array
(
data
[
'datasets'
][
'initialvoltage_dcA'
])
dcA_vec
.
append
(
dcA
)
frecuencia
,
cuentas
=
clean_jumps_below
(
frecuencia
,
cuentas
,
400
)
cuentas_suave
=
savgol
(
cuentas
,
13
,
2
)
I_base_fit
=
np
.
arange
(
len
(
frecuencia
))[:
50
]
.
tolist
()
I_base_fit
+=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>=
439
)
&
(
frecuencia
<=
442
)]
.
tolist
()
I_base_fit
+=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>=
500
)
&
(
frecuencia
<=
442
)]
.
tolist
()
I_base_fit
=
np
.
array
(
I_base_fit
)
mm
=
np
.
polyfit
(
frecuencia
[
I_base_fit
],
cuentas
[
I_base_fit
],
1
)
if
NORMALIZADO
:
base
=
np
.
polyval
(
mm
,
frecuencia
)
ax
.
plot
(
frecuencia
,
cuentas
/
base
,
'.'
,
alpha
=
0.5
)
ax
.
plot
(
frecuencia
,
cuentas_suave
/
base
,
'-'
,
alpha
=
0.9
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
())
else
:
ax
.
plot
(
frecuencia
,
cuentas
,
'.'
,
alpha
=
0.5
)
ax
.
plot
(
frecuencia
,
cuentas_suave
,
'-'
,
alpha
=
0.9
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
())
# ax.plot(frecuencia[I_base_fit],cuentas[I_base_fit], '.', alpha=1)
ax
.
plot
(
[
420
,
460
],
np
.
polyval
(
mm
,[
420
,
460
])
,
'-'
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
(),
alpha
=
0.5
)
for
jj
,
rango
in
enumerate
([
rango_dr1
,
rango_dr2
]):
I
=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>
rango
.
min
())
&
(
frecuencia
<
rango
.
max
())]
idx
=
cuentas_suave
[
I
]
.
argmin
()
+
I
[
0
]
ax
.
plot
(
frecuencia
[
idx
],
cuentas_suave
[
idx
]
/
base
[
idx
],
'o'
,
ms
=
12
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
(),
zorder
=
10
)
Base
=
np
.
polyval
(
mm
,
rango
.
mean
())
val_pico
=
cuentas_suave
[
I
]
.
min
()
picos
[
jj
]
.
append
(
(
Base
-
val_pico
)
/
Base
)
print
(
(
Base
-
val_pico
)
/
Base
,
end
=
"
\t
"
)
print
(
''
)
# ax.plot(frecuencia,cuentas , label=dcA)
# plt.pause(2)
# plt.cla()
# ax.plot(cuentas , label=dcA)
# plt.plot(frecuencia,amplitudes )
ax
.
legend
()
ax
=
axx
[
1
]
ax
.
plot
(
dcA_vec
,
picos
[
0
]
,
'.-'
)
ax
.
plot
(
dcA_vec
,
picos
[
1
]
,
'.-'
)
#%% Configuracion +2/-2 colineales, ion al costado del haz dcA version INSPECCIÓN
# SeeKeys(DATAFILES_costado_dcA[:1])
# data = h5py.File(DATAFILES_costado_dcA[0], 'r')
# for kk,vv in data['datasets'].items():
# print(f'{kk}:\t',vv)
from
scipy.signal
import
savgol_filter
as
savgol
# Grafico con subplots
fig
,
axx
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
12
,
8
),
constrained_layout
=
True
,
sharey
=
True
)
fig
.
set_constrained_layout_pads
(
w_pad
=
1
/
72
,
h_pad
=
0
,
hspace
=
0
,
wspace
=
0
)
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
I_base_fit
=
np
.
arange
(
0
,
50
)
.
tolist
()
+
np
.
arange
(
230
,
280
)
.
tolist
()
+
np
.
arange
(
450
,
459
)
.
tolist
()
I_base_fit
=
np
.
array
(
I_base_fit
)
ax
=
axx
[
0
]
# plt.figure()
# ax = plt.gca()
NORMALIZADO
=
True
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
picos
=
{
0
:[],
1
:[]}
dcA_vec
=
[]
for
data
in
sorted
([
h5py
.
File
(
DataFile
,
'r'
)
for
DataFile
in
DATAFILES_costado_dcA
],
key
=
lambda
x
:
np
.
array
(
x
[
'datasets'
][
'initialvoltage_dcA'
])
):
frecuencia
=
np
.
array
(
data
[
'datasets'
][
'IR1_Frequencies'
])
*
2e-6
cuentas
=
np
.
array
(
data
[
'datasets'
][
'counts_spectrum'
])
amplitudes
=
np
.
array
(
data
[
'datasets'
][
'IR1_Amplitudes'
])
dcA
=
np
.
array
(
data
[
'datasets'
][
'initialvoltage_dcA'
])
dcA_vec
.
append
(
dcA
.
tolist
()
)
frecuencia
,
cuentas
=
clean_jumps_below
(
frecuencia
,
cuentas
,
400
)
cuentas_suave
=
savgol
(
cuentas
,
13
,
2
)
I_base_fit
=
np
.
arange
(
len
(
frecuencia
))[:
50
]
.
tolist
()
I_base_fit
+=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>=
439
)
&
(
frecuencia
<=
442
)]
.
tolist
()
# I_base_fit += np.arange(len(frecuencia))[(frecuencia>=500)&(frecuencia<=442)].tolist()
I_base_fit
=
np
.
array
(
I_base_fit
)
mm
=
np
.
polyfit
(
frecuencia
[
I_base_fit
],
cuentas
[
I_base_fit
],
1
)
base
=
np
.
polyval
(
mm
,
frecuencia
)
CURVA
=
(
cuentas
/
base
-
1
)
/
5
+
dcA
CURVA_SUAVE
=
(
cuentas_suave
/
base
-
1
)
/
5
+
dcA
ax
.
plot
(
frecuencia
,
CURVA
,
'.'
,
alpha
=
0.1
)
ax
.
plot
(
frecuencia
,
CURVA_SUAVE
,
'-'
,
alpha
=
0.9
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
())
for
jj
,
rango
in
enumerate
([
rango_dr1
,
rango_dr2
]):
I
=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>
rango
.
min
())
&
(
frecuencia
<
rango
.
max
())]
idx
=
cuentas_suave
[
I
]
.
argmin
()
+
I
[
0
]
ax
.
plot
(
frecuencia
[
idx
],(
cuentas_suave
[
idx
]
/
base
[
idx
]
-
1
)
/
5
+
dcA
,
'o'
,
ms
=
6
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
(),
zorder
=
10
)
Base
=
np
.
polyval
(
mm
,
rango
.
mean
())
val_pico
=
cuentas_suave
[
I
]
.
min
()
picos
[
jj
]
.
append
(
(
Base
-
val_pico
)
/
Base
)
print
(
(
Base
-
val_pico
)
/
Base
,
end
=
"
\t
"
)
print
(
''
)
# ax.plot(frecuencia,cuentas , label=dcA)
# plt.pause(2)
# plt.cla()
# ax.plot(cuentas , label=dcA)
# plt.plot(frecuencia,amplitudes )
ax
.
legend
()
ax
=
axx
[
1
]
ax
.
plot
(
picos
[
0
]
,
dcA_vec
,
'.'
)
ax
.
plot
(
picos
[
1
]
,
dcA_vec
,
'o'
)
profundidad_mean
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
dcA_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
dcA_vec
==
val
]
.
tolist
())
.
mean
()
for
val
in
np
.
unique
(
dcA_vec
)
]
profundidad_dev
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
dcA_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
dcA_vec
==
val
]
.
tolist
())
.
std
()
for
val
in
np
.
unique
(
dcA_vec
)
]
dcA_uniq
=
np
.
unique
(
dcA_vec
)
ax
.
plot
(
profundidad_mean
,
dcA_uniq
,
'o-'
,
color
=
'gray'
,
alpha
=
0.5
)
ax
.
errorbar
(
profundidad_mean
,
dcA_uniq
,
xerr
=
profundidad_dev
,
color
=
'gray'
,
capsize
=
5
)
ax
.
set_xlabel
(
'Profundidad'
)
axx
[
0
]
.
set_ylabel
(
'dcA [mV]'
)
axx
[
0
]
.
set_xlabel
(
'frecuencia [kHz]'
)
for
ax
in
axx
:
ax
.
grid
(
b
=
True
,
linestyle
=
':'
,
color
=
'lightgray'
)
ax
.
set_xlim
(
0
,
ax
.
get_xlim
()[
1
]
)
fig
.
suptitle
(
"Configuracion +2/-2 colineales, ion al costado del haz dcA"
)
# fig.savefig("config+2-2_colineal_ion_al_costado_dcA.png")
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% Configuracion +2/-2 colineales, ion al costado del haz compOVEN version INSPECCIÓN
# SeeKeys(DATAFILES_costado_dcA[:1])
# data = h5py.File(DATAFILES_costado_dcA[0], 'r')
# for kk,vv in data['datasets'].items():
# print(f'{kk}:\t',vv)
from
scipy.signal
import
savgol_filter
as
savgol
# Grafico con subplots
fig
,
axx
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
12
,
8
),
constrained_layout
=
True
,
sharey
=
True
)
fig
.
set_constrained_layout_pads
(
w_pad
=
1
/
72
,
h_pad
=
0
,
hspace
=
0
,
wspace
=
0
)
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
ax
=
axx
[
0
]
NORMALIZADO
=
True
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
picos
=
{
0
:[],
1
:[]}
compOven_vec
=
[]
for
data
in
sorted
([
h5py
.
File
(
DataFile
,
'r'
)
for
DataFile
in
DATAFILES_costado_compOVEN
],
key
=
lambda
x
:
np
.
array
(
x
[
'datasets'
][
'initialvoltage_dcA'
])
):
frecuencia
=
np
.
array
(
data
[
'datasets'
][
'IR1_Frequencies'
])
*
2e-6
cuentas
=
np
.
array
(
data
[
'datasets'
][
'counts_spectrum'
])
amplitudes
=
np
.
array
(
data
[
'datasets'
][
'IR1_Amplitudes'
])
compOven
=
np
.
array
(
data
[
'datasets'
][
'initialvoltage_compOven'
])
compOven_vec
.
append
(
compOven
.
tolist
()
)
frecuencia
,
cuentas
=
clean_jumps_below
(
frecuencia
,
cuentas
,
400
)
cuentas_suave
=
savgol
(
cuentas
,
13
,
2
)
I_base_fit
=
np
.
arange
(
len
(
frecuencia
))[:
50
]
.
tolist
()
I_base_fit
+=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>=
439
)
&
(
frecuencia
<=
442
)]
.
tolist
()
# I_base_fit += np.arange(len(frecuencia))[(frecuencia>=500)&(frecuencia<=442)].tolist()
I_base_fit
=
np
.
array
(
I_base_fit
)
mm
=
np
.
polyfit
(
frecuencia
[
I_base_fit
],
cuentas
[
I_base_fit
],
1
)
base
=
np
.
polyval
(
mm
,
frecuencia
)
CURVA
=
(
cuentas
/
base
-
1
)
/
5
+
compOven
CURVA_SUAVE
=
(
cuentas_suave
/
base
-
1
)
/
5
+
compOven
ax
.
plot
(
frecuencia
,
CURVA
,
'.'
,
alpha
=
0.1
)
ax
.
plot
(
frecuencia
,
CURVA_SUAVE
,
'-'
,
alpha
=
0.9
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
())
for
jj
,
rango
in
enumerate
([
rango_dr1
,
rango_dr2
]):
I
=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>
rango
.
min
())
&
(
frecuencia
<
rango
.
max
())]
idx
=
cuentas_suave
[
I
]
.
argmin
()
+
I
[
0
]
ax
.
plot
(
frecuencia
[
idx
],(
cuentas_suave
[
idx
]
/
base
[
idx
]
-
1
)
/
5
+
compOven
,
'o'
,
ms
=
6
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
(),
zorder
=
10
)
Base
=
np
.
polyval
(
mm
,
rango
.
mean
())
val_pico
=
cuentas_suave
[
I
]
.
min
()
picos
[
jj
]
.
append
(
(
Base
-
val_pico
)
/
Base
)
print
(
(
Base
-
val_pico
)
/
Base
,
end
=
"
\t
"
)
print
(
''
)
ax
.
legend
()
ax
=
axx
[
1
]
ax
.
plot
(
picos
[
0
]
,
compOven_vec
,
'.'
)
ax
.
plot
(
picos
[
1
]
,
compOven_vec
,
'o'
)
profundidad_mean
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
compOven_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
compOven_vec
==
val
]
.
tolist
())
.
mean
()
for
val
in
np
.
unique
(
compOven_vec
)
]
profundidad_dev
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
compOven_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
compOven_vec
==
val
]
.
tolist
())
.
std
()
for
val
in
np
.
unique
(
compOven_vec
)
]
compOven_uniq
=
np
.
unique
(
compOven_vec
)
ax
.
plot
(
profundidad_mean
,
compOven_uniq
,
'o-'
,
color
=
'gray'
,
alpha
=
0.5
)
ax
.
errorbar
(
profundidad_mean
,
compOven_uniq
,
xerr
=
profundidad_dev
,
color
=
'gray'
,
capsize
=
5
)
ax
.
set_xlabel
(
'Profundidad'
)
axx
[
0
]
.
set_ylabel
(
'compOven [V]'
)
axx
[
0
]
.
set_xlabel
(
'frecuencia [kHz]'
)
for
ax
in
axx
:
ax
.
grid
(
b
=
True
,
linestyle
=
':'
,
color
=
'lightgray'
)
ax
.
set_xlim
(
0
,
ax
.
get_xlim
()[
1
]
)
fig
.
suptitle
(
"Configuracion +2/-2 colineales, ion al costado del haz compOven"
)
# fig.savefig("config+2-2_colineal_ion_al_costado_compOven.png")
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% Configuracion +2/-2 colineales, ion arriba del haz dcA version INSPECCIÓN
from
scipy.signal
import
savgol_filter
as
savgol
# Grafico con subplots
fig
,
axx
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
12
,
8
),
constrained_layout
=
True
,
sharey
=
True
)
fig
.
set_constrained_layout_pads
(
w_pad
=
1
/
72
,
h_pad
=
0
,
hspace
=
0
,
wspace
=
0
)
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
I_base_fit
=
np
.
arange
(
0
,
50
)
.
tolist
()
+
np
.
arange
(
230
,
280
)
.
tolist
()
+
np
.
arange
(
450
,
459
)
.
tolist
()
I_base_fit
=
np
.
array
(
I_base_fit
)
ax
=
axx
[
0
]
# plt.figure()
# ax = plt.gca()
NORMALIZADO
=
True
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
picos
=
{
0
:[],
1
:[]}
dcA_vec
=
[]
for
data
in
sorted
([
h5py
.
File
(
DataFile
,
'r'
)
for
DataFile
in
DATAFILES_arriba_dcA
],
key
=
lambda
x
:
np
.
array
(
x
[
'datasets'
][
'initialvoltage_dcA'
])
):
frecuencia
=
np
.
array
(
data
[
'datasets'
][
'IR1_Frequencies'
])
*
2e-6
voltages
=
np
.
array
(
data
[
'datasets'
][
'scanning_voltages'
])
for
kk
,
dcA
in
enumerate
(
voltages
):
# cuentas = np.array(data['datasets']['data_array'])
cuentas
=
np
.
array
(
data
[
'datasets'
][
'data_array'
])
.
reshape
(
len
(
voltages
),
-
1
)[
kk
][
0
:
len
(
frecuencia
)]
amplitudes
=
np
.
array
(
data
[
'datasets'
][
'IR1_Amplitudes'
])
# dcA = np.array(data['datasets']['initialvoltage_dcA'])
dcA_vec
.
append
(
dcA
.
tolist
()
)
frecuencia
,
cuentas
=
clean_jumps_below
(
frecuencia
,
cuentas
,
320
)
cuentas_suave
=
savgol
(
cuentas
,
13
,
2
)
I_base_fit
=
np
.
arange
(
len
(
frecuencia
))[:
50
]
.
tolist
()
I_base_fit
+=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>=
439
)
&
(
frecuencia
<=
442
)]
.
tolist
()
# I_base_fit += np.arange(len(frecuencia))[(frecuencia>=500)&(frecuencia<=442)].tolist()
I_base_fit
=
np
.
array
(
I_base_fit
)
mm
=
np
.
polyfit
(
frecuencia
[
I_base_fit
],
cuentas
[
I_base_fit
],
1
)
base
=
np
.
polyval
(
mm
,
frecuencia
)
CURVA
=
(
cuentas
/
base
-
1
)
/
5
+
dcA
CURVA_SUAVE
=
(
cuentas_suave
/
base
-
1
)
/
5
+
dcA
ax
.
plot
(
frecuencia
,
CURVA
,
'.'
,
alpha
=
0.1
)
ax
.
plot
(
frecuencia
,
CURVA_SUAVE
,
'-'
,
alpha
=
0.9
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
())
for
jj
,
rango
in
enumerate
([
rango_dr1
,
rango_dr2
]):
I
=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>
rango
.
min
())
&
(
frecuencia
<
rango
.
max
())]
idx
=
cuentas_suave
[
I
]
.
argmin
()
+
I
[
0
]
ax
.
plot
(
frecuencia
[
idx
],(
cuentas_suave
[
idx
]
/
base
[
idx
]
-
1
)
/
5
+
dcA
,
'o'
,
ms
=
6
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
(),
zorder
=
10
)
Base
=
np
.
polyval
(
mm
,
rango
.
mean
())
val_pico
=
cuentas_suave
[
I
]
.
min
()
picos
[
jj
]
.
append
(
(
Base
-
val_pico
)
/
Base
)
print
(
(
Base
-
val_pico
)
/
Base
,
end
=
"
\t
"
)
print
(
''
)
# ax.plot(frecuencia,cuentas , label=dcA)
# plt.pause(2)
# plt.cla()
# ax.plot(cuentas , label=dcA)
# plt.plot(frecuencia,amplitudes )
ax
.
legend
()
ax
=
axx
[
1
]
ax
.
plot
(
picos
[
0
]
,
dcA_vec
,
'.'
)
ax
.
plot
(
picos
[
1
]
,
dcA_vec
,
'o'
)
profundidad_mean
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
dcA_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
dcA_vec
==
val
]
.
tolist
())
.
mean
()
for
val
in
np
.
unique
(
dcA_vec
)
]
profundidad_dev
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
dcA_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
dcA_vec
==
val
]
.
tolist
())
.
std
()
for
val
in
np
.
unique
(
dcA_vec
)
]
dcA_uniq
=
np
.
unique
(
dcA_vec
)
ax
.
plot
(
profundidad_mean
,
dcA_uniq
,
'o-'
,
color
=
'gray'
,
alpha
=
0.5
)
ax
.
errorbar
(
profundidad_mean
,
dcA_uniq
,
xerr
=
profundidad_dev
,
color
=
'gray'
,
capsize
=
5
)
ax
.
set_xlabel
(
'Profundidad'
)
axx
[
0
]
.
set_ylabel
(
'dcA [mV]'
)
axx
[
0
]
.
set_xlabel
(
'frecuencia [kHz]'
)
for
ax
in
axx
:
ax
.
grid
(
b
=
True
,
linestyle
=
':'
,
color
=
'lightgray'
)
ax
.
set_xlim
(
0
,
ax
.
get_xlim
()[
1
]
)
fig
.
suptitle
(
"Configuracion +2/-2 colineales, ion arriba del haz dcA"
)
fig
.
savefig
(
"config+2-2_colineal_ion_ariba_dcA.png"
)
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#%% Configuracion +2/-2 colineales, ion arriba del haz compOVEN version INSPECCIÓN
from
scipy.signal
import
savgol_filter
as
savgol
# Grafico con subplots
fig
,
axx
=
plt
.
subplots
(
1
,
2
,
figsize
=
(
12
,
8
),
constrained_layout
=
True
,
sharey
=
True
)
fig
.
set_constrained_layout_pads
(
w_pad
=
1
/
72
,
h_pad
=
0
,
hspace
=
0
,
wspace
=
0
)
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
I_base_fit
=
np
.
arange
(
0
,
50
)
.
tolist
()
+
np
.
arange
(
230
,
280
)
.
tolist
()
+
np
.
arange
(
450
,
459
)
.
tolist
()
I_base_fit
=
np
.
array
(
I_base_fit
)
ax
=
axx
[
0
]
# plt.figure()
# ax = plt.gca()
NORMALIZADO
=
True
rango_dr1
=
np
.
array
([
435
,
437
])
rango_dr2
=
np
.
array
([
443
,
445
])
picos
=
{
0
:[],
1
:[]}
dcA_vec
=
[]
for
data
in
sorted
([
h5py
.
File
(
DataFile
,
'r'
)
for
DataFile
in
DATAFILES_arriba_compOVEN
],
key
=
lambda
x
:
np
.
array
(
x
[
'datasets'
][
'initialvoltage_dcA'
])
):
frecuencia
=
np
.
array
(
data
[
'datasets'
][
'IR1_Frequencies'
])
*
2e-6
voltages
=
np
.
array
(
data
[
'datasets'
][
'scanning_voltages'
])
for
kk
,
dcA
in
enumerate
(
voltages
):
# cuentas = np.array(data['datasets']['data_array'])
cuentas
=
np
.
array
(
data
[
'datasets'
][
'data_array'
])
.
reshape
(
len
(
voltages
),
-
1
)[
kk
][
0
:
len
(
frecuencia
)]
amplitudes
=
np
.
array
(
data
[
'datasets'
][
'IR1_Amplitudes'
])
# dcA = np.array(data['datasets']['initialvoltage_dcA'])
dcA_vec
.
append
(
dcA
.
tolist
()
)
frecuencia
,
cuentas
=
clean_jumps_below
(
frecuencia
,
cuentas
,
320
)
cuentas_suave
=
savgol
(
cuentas
,
13
,
2
)
I_base_fit
=
np
.
arange
(
len
(
frecuencia
))[:
50
]
.
tolist
()
I_base_fit
+=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>=
439
)
&
(
frecuencia
<=
442
)]
.
tolist
()
# I_base_fit += np.arange(len(frecuencia))[(frecuencia>=500)&(frecuencia<=442)].tolist()
I_base_fit
=
np
.
array
(
I_base_fit
)
mm
=
np
.
polyfit
(
frecuencia
[
I_base_fit
],
cuentas
[
I_base_fit
],
1
)
base
=
np
.
polyval
(
mm
,
frecuencia
)
CURVA
=
(
cuentas
/
base
-
1
)
/
5
+
dcA
CURVA_SUAVE
=
(
cuentas_suave
/
base
-
1
)
/
5
+
dcA
ax
.
plot
(
frecuencia
,
CURVA
,
'.'
,
alpha
=
0.1
)
ax
.
plot
(
frecuencia
,
CURVA_SUAVE
,
'-'
,
alpha
=
0.9
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
())
for
jj
,
rango
in
enumerate
([
rango_dr1
,
rango_dr2
]):
I
=
np
.
arange
(
len
(
frecuencia
))[(
frecuencia
>
rango
.
min
())
&
(
frecuencia
<
rango
.
max
())]
idx
=
cuentas_suave
[
I
]
.
argmin
()
+
I
[
0
]
ax
.
plot
(
frecuencia
[
idx
],(
cuentas_suave
[
idx
]
/
base
[
idx
]
-
1
)
/
5
+
dcA
,
'o'
,
ms
=
6
,
color
=
ax
.
get_lines
()[
-
1
]
.
get_color
(),
zorder
=
10
)
Base
=
np
.
polyval
(
mm
,
rango
.
mean
())
val_pico
=
cuentas_suave
[
I
]
.
min
()
picos
[
jj
]
.
append
(
(
Base
-
val_pico
)
/
Base
)
print
(
(
Base
-
val_pico
)
/
Base
,
end
=
"
\t
"
)
print
(
''
)
# ax.plot(frecuencia,cuentas , label=dcA)
# plt.pause(2)
# plt.cla()
# ax.plot(cuentas , label=dcA)
# plt.plot(frecuencia,amplitudes )
ax
.
legend
()
ax
=
axx
[
1
]
ax
.
plot
(
picos
[
0
]
,
dcA_vec
,
'.-'
)
ax
.
plot
(
picos
[
1
]
,
dcA_vec
,
'o-'
)
profundidad_mean
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
dcA_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
dcA_vec
==
val
]
.
tolist
())
.
mean
()
for
val
in
np
.
unique
(
dcA_vec
)
]
profundidad_dev
=
[
np
.
array
(
np
.
array
(
picos
[
0
])[
dcA_vec
==
val
]
.
tolist
()
+
np
.
array
(
picos
[
1
])[
dcA_vec
==
val
]
.
tolist
())
.
std
()
for
val
in
np
.
unique
(
dcA_vec
)
]
dcA_uniq
=
np
.
unique
(
dcA_vec
)
# ax.plot( profundidad_mean , dcA_uniq , 'o-', color='gray' , alpha=0.5 )
# ax.errorbar( profundidad_mean , dcA_uniq , xerr=profundidad_dev , color='gray' ,capsize=5)
ax
.
set_xlabel
(
'Profundidad'
)
axx
[
0
]
.
set_ylabel
(
'compOven [V]'
)
axx
[
0
]
.
set_xlabel
(
'frecuencia [kHz]'
)
for
ax
in
axx
:
ax
.
grid
(
b
=
True
,
linestyle
=
':'
,
color
=
'lightgray'
)
ax
.
set_xlim
(
0
,
ax
.
get_xlim
()[
1
]
)
fig
.
suptitle
(
"Configuracion +2/-2 colineales, ion arriba del haz compOven"
)
fig
.
savefig
(
"config+2-2_colineal_ion_ariba_compOven.png"
)
analisis/plots/20230815_RotationalDopplerShift_v3/config+2-2_colineal_ion_al_costado_compOven.png
0 → 100644
View file @
3ebe2682
297 KB
analisis/plots/20230815_RotationalDopplerShift_v3/config+2-2_colineal_ion_al_costado_dcA.png
0 → 100644
View file @
3ebe2682
450 KB
analisis/plots/20230815_RotationalDopplerShift_v3/config+2-2_colineal_ion_ariba_compOven.png
0 → 100644
View file @
3ebe2682
259 KB
analisis/plots/20230815_RotationalDopplerShift_v3/config+2-2_colineal_ion_ariba_dcA.png
0 → 100644
View file @
3ebe2682
353 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