# CALCULATE RATIOS ################### def ratiosFirstRings2(pointSpec): ring1SLW = ['SLWB2','SLWB3','SLWC2','SLWC4','SLWD2','SLWD3'] ring1SSW = ['SSWD3','SSWC3','SSWC4','SSWE4','SSWE3'] #D5 is a dead bolometer offAxisSm = pointSpec # central detectors data SLW freq = offAxisSm['0000']['SLWC3'].wave flux = offAxisSm['0000']['SLWC3'].flux ratiosSLW = Double2d(len(ring1SLW),len(flux)) medianratiosSLW = Double1d() k=0 # For every detector in the first ring of SLW: for detector in ring1SLW: ratios = Double1d() fluxdetector = offAxisSm['0000'][detector].flux for i in range(0,len(fluxdetector)): ratios.append((fluxdetector[i]/flux[i])*100) ratiosSLW[k,:] = ratios k += 1 # Median of the different ratios for each detector # I take out the dependency on frequency medianratiosSLW = medianratiosSLW.append(MEDIAN(ratios)) ratio = ratios #This is the average for all detectors averageSLW = MEDIAN(medianratiosSLW) # central detectors data SSW freq = offAxisSm['0000']['SSWD4'].wave flux = offAxisSm['0000']['SSWD4'].flux ratiosSSW = Double2d(len(ring1SSW),len(flux)) medianratiosSSW = Double1d() k=0 for detector in ring1SSW: ratios = Double1d() fluxdetector = offAxisSm['0000'][detector].flux for i in range(0,len(fluxdetector)): ratios.append((fluxdetector[i]/flux[i])*100) ratiosSSW[k,:] = ratios k += 1 # Median of the different ratios for each detector # I get an array dependent on frequency medianratiosSSW = medianratiosSSW.append(MEDIAN(ratios)) ratio = ratios #This is the average in frequency by taking the Median averageSSW = MEDIAN(medianratiosSSW) return averageSLW, averageSSW