def JSC(TE, lam, PV): ### hard-coding view factor for now! F = 0.84 ### get spectral response function for appropriate PV material if (PV == 'InGaAsSb'): SR = datalib.SR_InGaAsSb(lam) elif (PV == 'GaSb'): SR = datalib.SR_GaSb(lam) else: SR = datalib.SR_InGaAsSb(lam) ### get upper limit of lambda array... will integrate over entire ### range, in principle spectral response function will vanish at the ### appropriate boundaries of lambda upper = np.amax(lam) integrand = TE * SR * F * np.pi jshc = numlib.Integrate(integrand, lam, 1e-9, upper) return jshc
def multi_junction_Jsc_1(lam, TE_1, TE_2, PV_1): #PV device 1 choice if (PV_1 == 'InGaAsSb'): SR = datalib.SR_InGaAsSb(lam) elif (PV_1 == 'GaSb'): SR = datalib.SR_GaSb(lam) else: SR = datalib.SR_InGaAsSb(lam) #start Integrals Integrand_1 = TE_1 * SR Integrand_2 = TE_2 * SR upper = np.amax(lam) a = numlib.integrate(Integrand_1, lam, 100e-9, upper) b = numlib.integrate(Integrand_2, lam, 100e-9, upper) Jsc_1 = a + b return Jsc_1
def JSC_EA(TE_p, TE_s, lam, PV, t, w): ### hard-coding view factor for now! F = 0.84 ### get spectral response function for appropriate PV material if (PV == 'InGaAsSb'): SP = datalib.SR_InGaAsSb(lam) elif (PV == 'GaSb'): SP = datalib.SR_GaSb(lam) else: SP = datalib.SR_InGaAsSb(lam) jsch = 0. dl = np.abs(lam[1] - lam[0]) for i in range(0, len(t)): isom = 0. for j in range(0, len(lam)): isom = isom + 0.5 * TE_p[i][j] * SP[j] * F * dl isom = isom + 0.5 * TE_s[i][j] * SP[j] * F * dl jsch = jsch + w[i] * isom * np.sin(t[i]) return jsch * 2 * np.pi
def FalseColor_FromSpec(TE, lam): ### get color response functions #cie = datalib.CIE((lam+1500e-9)*400e-9/2400e-9) SR = datalib.SR_InGaAsSb(lam) #plt.plot(1e9*lam, cie['xbar'], 'red', 1e9*lam, cie['ybar'], 'green', 1e9*lam, cie['zbar'], 'blue') #plt.show() ### This will be the shifted color cone response model for InGaAsSb ### get X from TE spectrum #X = numlib.Integrate(TE*SR*cie['xbar'], lam, 100e-9, 4000e-9) ### get Y from TE spectrum #Y = numlib.Integrate(TE*SR*cie['ybar'], lam, 100e-9, 4000e-9) ### get Z from TE spectrum #Z = numlib.Integrate(TE*SR*cie['zbar'], lam, 100e-9, 4000e-9) ### this will be the step-function model for the response of ### InGaAsSb PV cell ### get X from TE spectrum only - red is a penalty coming from sub-bg emission X = numlib.Integrate(TE, lam, 2250e-9, 10000e-9) ### get Y from TE spectrum weighted by SR function... green is good! Y = numlib.Integrate(TE * SR, lam, 1900e-9, 2250e-9) ### get Z from TE spectrum weighted by SR function... blue is less good! Z = numlib.Integrate(TE * SR, lam, 400e-9, 1900e-9) ### get total magnitude tot = X + Y + Z ### get normalized values x = X / tot y = Y / tot z = Z / tot ## should also be equal to z = 1 - x - y ### array of xr, xg, xb, xw, ..., zr, zg, zb, zw ### use hdtv standard xrgbw = [0.670, 0.210, 0.150, 0.3127] yrgbw = [0.330, 0.710, 0.060, 0.3291] zrgbw = [] for i in range(0, len(xrgbw)): zrgbw.append(1. - xrgbw[i] - yrgbw[i]) #print("zrgbw is ",zrgbw) ## rx = yg*zb - yb*zg rx = yrgbw[1] * zrgbw[2] - yrgbw[2] * zrgbw[1] ## ry = xb*zg - xg*zb ry = xrgbw[2] * zrgbw[1] - xrgbw[1] * zrgbw[2] ## rz = (xg * yb) - (xb * yg) rz = xrgbw[1] * yrgbw[2] - xrgbw[2] * yrgbw[1] ## gx = (yb * zr) - (yr * zb) gx = yrgbw[2] * zrgbw[0] - yrgbw[0] * zrgbw[2] ## gy = (xr * zb) - (xb * zr) gy = xrgbw[0] * zrgbw[2] - xrgbw[2] * zrgbw[0] ## gz = (xb * yr) - (xr * yb) gz = xrgbw[2] * yrgbw[0] - xrgbw[0] * yrgbw[2] ## bx = (yr * zg) - (yg * zr) bx = yrgbw[0] * zrgbw[1] - yrgbw[1] * zrgbw[0] ## by = (xg * zr) - (xr * zg) by = xrgbw[1] * zrgbw[0] - xrgbw[0] * zrgbw[1] ## bz = (xr * yg) - (xg * yr) bz = xrgbw[0] * yrgbw[1] - xrgbw[1] * yrgbw[0] ## rw = ((rx * xw) + (ry * yw) + (rz * zw)) / yw; rw = (rx * xrgbw[3] + ry * yrgbw[3] + rz * zrgbw[3]) / yrgbw[3] ## gw = ((gx * xw) + (gy * yw) + (gz * zw)) / yw; gw = (gx * xrgbw[3] + gy * yrgbw[3] + gz * zrgbw[3]) / yrgbw[3] ## bw = ((bx * xw) + (by * yw) + (bz * zw)) / yw; bw = (bx * xrgbw[3] + by * yrgbw[3] + bz * zrgbw[3]) / yrgbw[3] ## /* xyz -> rgb matrix, correctly scaled to white. */ rx = rx / rw ry = ry / rw rz = rz / rw gx = gx / gw gy = gy / gw gz = gz / gw bx = bx / bw by = by / bw bz = bz / bw ## /* rgb of the desired point */ r = (rx * x) + (ry * y) + (rz * z) g = (gx * x) + (gy * y) + (gz * z) b = (bx * x) + (by * y) + (bz * z) rgblist = [] rgblist.append(r) rgblist.append(g) rgblist.append(b) # are there negative values? w = np.amin(rgblist) if w < 0: rgblist[0] = rgblist[0] - w rgblist[1] = rgblist[1] - w rgblist[2] = rgblist[2] - w # scale things so that max has value of 1 mag = np.amax(rgblist) rgblist[0] = rgblist[0] / mag rgblist[1] = rgblist[1] / mag rgblist[2] = rgblist[2] / mag #rgb = {'r': rgblist[0]/mag, 'g': rgblist[1]/mag, 'b': rgblist[2]/mag } return rgblist