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
c92cb850
Commit
c92cb850
authored
May 03, 2022
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
5daa40e5
cb2ccce0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
0 deletions
+74
-0
000007155-UV_Scan_withcalib_Haeffner.h5
...trosUVnuevos/Data/000007155-UV_Scan_withcalib_Haeffner.h5
+0
-0
000007160-UV_Scan_withcalib_Haeffner.h5
...trosUVnuevos/Data/000007160-UV_Scan_withcalib_Haeffner.h5
+0
-0
UV_spectrums.py
analisis/plots/20220503_EspectrosUVnuevos/UV_spectrums.py
+74
-0
No files found.
analisis/plots/20220503_EspectrosUVnuevos/Data/000007155-UV_Scan_withcalib_Haeffner.h5
0 → 100644
View file @
c92cb850
File added
analisis/plots/20220503_EspectrosUVnuevos/Data/000007160-UV_Scan_withcalib_Haeffner.h5
0 → 100644
View file @
c92cb850
File added
analisis/plots/20220503_EspectrosUVnuevos/UV_spectrums.py
0 → 100644
View file @
c92cb850
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
# Solo levanto algunos experimentos
Calib_Files
=
"""000007155-UV_Scan_withcalib_Haeffner
000007160-UV_Scan_withcalib_Haeffner"""
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20220503_EspectrosUVnuevos\Data
def
SeeKeys
(
files
):
for
i
,
fname
in
enumerate
(
files
.
split
()):
data
=
h5py
.
File
(
fname
+
'.h5'
,
'r'
)
# Leo el h5: Recordar que nuestros datos estan en 'datasets'
print
(
fname
)
print
(
list
(
data
[
'datasets'
]
.
keys
()))
#%%
Amps
=
[]
Freqs
=
[]
Counts
=
[]
for
i
,
fname
in
enumerate
(
Calib_Files
.
split
()):
print
(
SeeKeys
(
Calib_Files
))
print
(
i
)
print
(
fname
)
data
=
h5py
.
File
(
fname
+
'.h5'
,
'r'
)
# Leo el h5: Recordar que nuestros datos estan en 'datasets'
print
(
list
(
data
[
'datasets'
]
.
keys
()))
Amps
.
append
(
np
.
array
(
data
[
'datasets'
][
'UV_Amplitudes'
]))
Freqs
.
append
(
np
.
array
(
data
[
'datasets'
][
'UV_Frequencies'
]))
Counts
.
append
(
np
.
array
(
data
[
'datasets'
][
'counts_spectrum'
]))
#def GetBackground(countsper100ms, )
#%%
def
Lorentzian
(
f
,
A
,
gamma
,
x0
):
return
(
A
/
np
.
pi
)
*
0.5
*
gamma
/
(((
f
-
x0
)
**
2
)
+
((
0.5
*
gamma
)
**
2
))
+
10
#40 es el piso de ruido estimado
j
=
0
#UV_cooling en 90 MHz
FreqsChosen
=
[
2
*
f
*
1e-6
for
f
in
Freqs
[
j
]]
CountsChosen
=
Counts
[
j
]
portion
=
0.
popt
,
pcov
=
curve_fit
(
Lorentzian
,
FreqsChosen
[
int
(
portion
*
len
(
FreqsChosen
)):],
CountsChosen
[
int
(
portion
*
len
(
FreqsChosen
)):])
freqslong
=
np
.
arange
(
min
(
FreqsChosen
)
-
10
,
max
(
FreqsChosen
)
+
10
,
(
FreqsChosen
[
1
]
-
FreqsChosen
[
0
])
*
0.01
)
plt
.
figure
()
plt
.
plot
(
FreqsChosen
,
CountsChosen
,
'o'
,
label
=
'4 uW'
)
plt
.
plot
(
freqslong
,
Lorentzian
(
freqslong
,
*
popt
),
label
=
f
'FWHM {round(popt[1])} MHz'
)
plt
.
axvline
(
popt
[
2
]
-
22.1
,
linestyle
=
'--'
,
linewidth
=
1
)
plt
.
axvline
(
popt
[
2
]
+
22.1
,
linestyle
=
'--'
,
linewidth
=
1
)
plt
.
xlabel
(
'Frecuencia (MHz)'
)
plt
.
ylabel
(
'Cuentas'
)
plt
.
legend
()
print
(
f
'Ancho medido: {round(popt[1])} MHz'
)
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