CPT_plotter_20211026.py 4.91 KB
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

#C:\Users\Usuario\Documents\artiq\artiq_experiments\analisis\plots\20211026_CPT_DosLaseres_v02\Data

ALL_FILES = """000004758-IR_Scan_withcal_optimized
000004759-IR_Scan_withcal_optimized
000004760-IR_Scan_withcal_optimized
000004761-IR_Scan_withcal_optimized
000004762-IR_Scan_withcal_optimized
000004768-IR_Scan_withcal_optimized
000004769-IR_Scan_withcal_optimized
000004770-IR_Scan_withcal_optimized
000004771-IR_Scan_withcal_optimized
000004800-IR_Scan_withcal_optimized
000004801-IR_Scan_withcal_optimized
000004802-IR_Scan_withcal_optimized
000004805-IR_Scan_withcal_optimized
000004806-IR_Scan_withcal_optimized
000004807-IR_Scan_withcal_optimized
000004808-IR_Scan_withcal_optimized
000004809-IR_Scan_withcal_optimized
000004810-IR_Scan_withcal_optimized
000004811-IR_Scan_withcal_optimized_superfine
000004812-IR_Scan_withcal_optimized_superfine
000004813-IR_Scan_withcal_optimized_superfine
000004814-IR_Scan_withcal_optimized_superfine
000004815-IR_Scan_withcal_optimized_superfine
000004816-IR_Scan_withcal_optimized""" 

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()))

print(SeeKeys(ALL_FILES))
#carpeta pc nico labo escritorio:
#C:\Users\Usuario\Documents\artiq\artiq_experiments\artiq_master\results\2021-07-14\16

Counts = []
Freqs = []

AmpTisa = []
No_measures = []

for i, fname in enumerate(ALL_FILES.split()):
    print(i)
    print(fname)
    data = h5py.File(fname+'.h5', 'r') # Leo el h5: Recordar que nuestros datos estan en 'datasets'

    # Aca hago algo repugnante para poder levantar los strings que dejamos
    # que además tenian un error de tipeo al final. Esto no deberá ser necesario
    # cuando se solucione el error este del guardado.
    Freqs.append(np.array(data['datasets']['IR_Frequencies']))
    Counts.append(np.array(data['datasets']['counts_spectrum']))
    AmpTisa.append(np.array(data['datasets']['TISA_CPT_amp']))
    No_measures.append(np.array(data['datasets']['no_measures']))

#%%

j = 0 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.3

plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.3')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')


j = 1 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')
plt.legend()



j = 2 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.3

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.3')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')

#%%
j = 3 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')

j = 4 
 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')

plt.legend()


#%%
j = 5 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')

j = 6 
 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')


j = 7 
 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')

j = 8
 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')

#plt.legend()

#%%

#Variando pot repump de menos a mas


j = 9
 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')

j = 10
 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

#plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')


#%%

#Variando pot repump de menos a mas


j = 2
 #Amp tisa = 0, amp cpt uv = 0.3, cooling amp uv = 0.26

plt.figure()
plt.plot([2*f*1e-6 for f in Freqs[j]], Counts[j], 'o-', label='Cooling amp uv = 0.26')
plt.xlabel('Frecuencia MHz)')
plt.ylabel('counts')