plt.grid(True) plt.legend(loc="upper right") plt.savefig("plots/temperature_resistance.eps") # energy gap plot intrinsic_regime_c = eV/(2*kB*np.array([upperc, lowerc])) intrinsic_regime_h = eV/(2*kB*np.array([upperh, lowerh])) X_polyfitc = Xc[np.logical_and(Xc >= lowerc, Xc <= upperc)] Y_polyfitc = Yc[np.logical_and(Xc >= lowerc, Xc <= upperc)] X_polyfith = Xh[np.logical_and(Xh >= lowerh, Xh <= upperh)] Y_polyfith = Yh[np.logical_and(Xh >= lowerh, Xh <= upperh)] coeffsc = hp.phpolyfit(X_polyfitc, hp.pnumpy.log(Y_polyfitc), 1) E_gc = coeffsc[0] A_c = hp.pnumpy.exp(-copy.copy(coeffsc[1])) coeffsh = hp.phpolyfit(X_polyfith, hp.pnumpy.log(Y_polyfith), 1) E_gh = coeffsh[0] A_h = hp.pnumpy.exp(-copy.copy(coeffsh[1])) #print(E_gc) #print(E_gh) E_gc.sf = 4 E_gh.sf = 4 pc = lambda x: np.polyval(copy.copy(coeffsc), x) xc = np.linspace(6, 16, 10) ph = lambda x: np.polyval(copy.copy(coeffsh), x) xh = np.linspace(6, 20, 10)
k_1 = lambda T: np.polyval(np.polyfit([250.0, 400.0], [401.0, 391.0], 1), T ) # W/mK k_2 = lambda T: np.polyval(np.polyfit([275.0, 400.0], [21.9, 26.6], 1), T ) # W/mK F_1 = np.pi * (0.5 * d_1)**2 # m^2 F_2 = np.pi * (0.5 * d_2)**2 # m^2 # linear polyfit of the reference table of the type k thermocouple C = np.arange(-10, 21, 1) # °C V = np.array([ -0.392, -0.353, -0.314, -0.275, -0.236, -0.197, -0.157, -0.118, -0.079, -0.039, 0.000, 0.039, 0.079, 0.119, 0.158, 0.198, 0.238, 0.277, 0.317, 0.357, 0.397, 0.437, 0.477, 0.517, 0.557, 0.597, 0.637, 0.677, 0.718, 0.758, 0.798 ]) * 10**-3 # V coeffs1 = hp.phpolyfit(V, C, 1) p1 = lambda x: np.polyval(coeffs1, x) hp.replace("thermoFitline", hp.fmt_fit(coeffs1, None, 'V_T')) # order of the colors in the plots colors = { "30": "b", # blue "50": "g", # green "80": "r", # red "110": "c" # cyan } Pi12VTable, Pi12ITable = {}, {} PiI = [] PiV = []
) # W/mK k_2 = lambda T: np.polyval(np.polyfit([275.0, 400.0], [21.9, 26.6], 1), T ) # W/mK F_1 = np.pi * (0.5 * d_1)**2 # m^2 F_2 = np.pi * (0.5 * d_2)**2 # m^2 deltaI_T = 8.5 * 10**-6 # linear polyfit of the reference table of the type k thermocouple C = np.arange(-10, 21, 1) # °C V = np.array([ -0.392, -0.353, -0.314, -0.275, -0.236, -0.197, -0.157, -0.118, -0.079, -0.039, 0.000, 0.039, 0.079, 0.119, 0.158, 0.198, 0.238, 0.277, 0.317, 0.357, 0.397, 0.437, 0.477, 0.517, 0.557, 0.597, 0.637, 0.677, 0.718, 0.758, 0.798 ]) * 10**-3 # V coeffs1 = hp.phpolyfit(V, C, 1) p1 = lambda x: np.polyval(coeffs1, x) # order of the colors in the plots colors = { "30": "b", # blue "50": "g", # green "80": "r", # red "110": "c" # cyan } r1 = hp.physical(10**-7, 10**-8, 1) # Ohm r2 = hp.physical(5.232, 0.21, 4) # Ohm rp = r1 + r2 rm = r1 * r2
delta_z_counts = hp.pnumpy.sqrt( hp.fetch2('data/angle_distribution.xlsx', 'z counts [#]')) z_counts = hp.fetch2('data/angle_distribution.xlsx', 'z counts [#]', delta_z_counts) z_time = hp.fetch2('data/angle_distribution.xlsx', 'z time [s]', time_readoff_error) ctps = z_counts / z_time fx = ctps / omega_D1(X_twiggle) Y = ctps / omega_D1(X_twiggle) logY = hp.pnumpy.log(Y) logX = hp.pnumpy.log(hp.pnumpy.sin(T / 2)) coeffs = hp.phpolyfit( logX, logY, 1, ) a = coeffs[0] C = hp.pnumpy.exp(coeffs[1]) #C = hp.physical(np.exp(0.09), 0.001) b = coeffs[1] hp.replace("fit:b", b) hp.replace("a", a) hp.replace("C", C) fitline2 = lambda theta: hp.pnumpy.log(C) + a * hp.pnumpy.log( hp.pnumpy.sin(0.5 * theta)) fitline = lambda x: np.log(C.n) + a.n * x
#plt.show() #exit() # Plot of linearity of the measurement system if run['system linearity']: i = 1 for det in detectors: print("processing " + det['name'] + "-detector data ...") dE_gamma = np.abs(hp.fetch2(det['file'], 'dC-pos [keV]')) dE_channel = np.abs(hp.fetch2(det['file'], 'dC-pos [ch]')) E_gamma = hp.fetch2(det['file'], 'C-pos [keV]', dE_gamma) E_channel = hp.fetch2(det['file'], 'C-pos [ch]', dE_channel) coeffs = hp.phpolyfit(E_gamma, E_channel, 1) p = lambda x: np.polyval(coeffs, x) pu = lambda x: np.polyval(coeffs.copy() + hp.stddev(coeffs), x) pl = lambda x: np.polyval(coeffs.copy() - hp.stddev(coeffs), x) x = np.linspace(0, 2500, 5) E_gamma_cs = E_gamma[0] E_channel_cs = E_channel[0] E_gamma_eu = E_gamma[1:6] E_channel_eu = E_channel[1:6] E_gamma_co = E_gamma[6:8] E_channel_co = E_channel[6:8] E_gamma_na = E_gamma[8] E_channel_na = E_channel[8] E_gamma_bi = E_gamma[9:] E_channel_bi = E_channel[9:]