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
cfdd6617
Commit
cfdd6617
authored
Jul 16, 2021
by
Nicolas Nunez Barreto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modificaciones al archivo de calibrs
parent
cf9323b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
2 deletions
+60
-2
Calibration_tests.py
...sis/plots/20210714_CalibrationsTests/Calibration_tests.py
+60
-2
No files found.
analisis/plots/20210714_CalibrationsTests/Calibration_tests.py
View file @
cfdd6617
...
...
@@ -56,33 +56,91 @@ plt.ylabel('Amplitud Artiq')
plt
.
xlabel
(
"Voltaje fotodiodo (V)"
)
plt
.
legend
()
#%%
def
RemoveZeros
(
calib
,
freqs
):
i
,
j
=
0
,
1
new_calib
=
calib
while
i
<
len
(
calib
):
if
new_calib
[
0
]
==
0
:
new_calib
=
new_calib
[
1
:]
i
=
i
+
1
else
:
init_len
=
len
(
new_calib
)
final_calib
=
new_calib
while
j
<
init_len
:
if
final_calib
[
-
1
]
==
0
:
final_calib
=
final_calib
[:
-
1
]
j
=
j
+
1
else
:
if
j
==
1
:
return
(
i
,
j
),
freqs
[
i
:],
final_calib
else
:
return
(
i
,
j
),
freqs
[
i
:
-
j
+
1
],
final_calib
lista
=
[
0
,
1
,
0
,
1
,
0
,
0
,
1
,
1
,
0
,
0
]
freqs
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
]
tupla
,
new_freqs
,
calib
=
RemoveZeros
(
lista
,
freqs
)
print
(
new_freqs
)
print
(
calib
)
#%%
i
=
15
interpolations
=
[]
interpolations_g
=
[]
for
i
in
range
(
len
(
PD_T
)):
PD
=
np
.
array
(
PD_T
[
i
][
0
])[
0
]
amps
=
Calibration_amps
f
=
interpolate
.
interp1d
(
PD
,
amps
,
kind
=
'quadratic'
)
g
=
interpolate
.
interp1d
(
amps
,
PD
,
kind
=
'quadratic'
)
xs
=
np
.
arange
(
min
(
PD
),
max
(
PD
),
1e-4
)
interpolations
.
append
(
f
)
interpolations_g
.
append
(
g
)
Calibration_PD_value
=
0.2
Calibs
=
[]
for
fi
in
interpolations
:
try
:
Calibs
.
append
(
f
i
(
0.2
))
Calibs
.
append
(
f
loat
(
fi
(
Calibration_PD_value
)
))
except
:
Calibs
.
append
(
0
)
plt
.
plot
(
freqs
,
Calibs
,
'o'
)
fig
,
ax1
=
plt
.
subplots
()
ax2
=
ax1
.
twinx
()
ax1
.
plot
([
f
*
1e-6
for
f
in
freqs
],
Calibs
,
'o'
,
label
=
'Amplitudes a setear'
)
EffectivePD
=
[]
for
i
in
range
(
len
(
Calibs
)):
try
:
EffectivePD
.
append
(
interpolations_g
[
i
](
Calibs
[
i
]))
except
:
EffectivePD
.
append
(
0
)
ax2
.
plot
([
f
*
1e-6
for
f
in
freqs
],
EffectivePD
,
'ro'
,
label
=
'Potencia'
)
ax1
.
set_xlabel
(
'Frecuencia (MHz)'
)
ax1
.
set_ylabel
(
'Amplitudes'
)
ax2
.
set_ylabel
(
'Potencia PD (V)'
)
fig
.
legend
()
h
=
interpolate
.
interp1d
(
freqs
,
Calibs
,
kind
=
'quadratic'
)
xs2
=
np
.
arange
(
min
(
freqs
),
max
(
freqs
),
1e5
)
plt
.
figure
()
plt
.
plot
(
freqs
,
Calibs
,
'o'
)
plt
.
plot
(
xs2
,
h
(
xs2
))
...
...
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