Пример #1
0
def SpectralEfficiency(TE, lam, lbg):
    ynum = TE * lam / lbg
    upper = np.amax(lam)
    num = numlib.Integrate(ynum, lam, 1e-9, lbg)
    den = numlib.Integrate(TE, lam, 1e-9, upper)
    SE = num / den
    return SE
Пример #2
0
def Abs_eff(lam, EM, solarconc, T):
    AM = datalib.AM(lam)
    upper = np.amax(lam)
    BBs = datalib.BB(lam, T)
    TE = BBs * EM
    alpha = solarconc * (numlib.Integrate(AM * EM, lam, 100e-9, upper))
    beta = np.pi * numlib.Integrate(TE, lam, 100e-9, upper)
    return (alpha - beta) / (alpha)
Пример #3
0
def Lum_efficiency(lam, TE):
    upper = np.amax(lam)
    ph = datalib.PhLum(lam)
    num = ph*TE
    numerator = numlib.Integrate(num, lam, 0, upper )
    den = TE
    denominator = numlib.Integrate(den, lam, 0, upper)
    return (numerator/denominator)
Пример #4
0
def Lum_efficiency_prime(lam, TE, TE_prime):
    upper = np.amax(lam)
    ph = datalib.PhLum(lam)
    num = ph*TE
    num_prime = ph*TE_prime
    numerator = numlib.Integrate(num, lam, 0, upper )
    numerator_prime = numlib.Integrate(num_prime, lam, 0, upper)
    
    denominator = numlib.Integrate(TE, lam, 0, upper)
    denominator_prime = numlib.Integrate(TE_prime, lam, 0, upper)
    
    return (denominator*numerator_prime - numerator*denominator_prime)/(denominator**2)
Пример #5
0
def ambient_jsc(eps, lam, lbg):
    ### get upper bound of integral
    upper = np.amax(lam)
    ### get AM1.5 spectrum
    AM = datalib.AM(lam)
    ### get spectral response function (currently only Si supported for
    ### traditional PV... more to come soon)
    SR = datalib.SR_Si(lam)
    ### jsc integrand
    integrand = AM * SR * eps
    ### integrate it!
    jsc = numlib.Integrate(integrand, lam, 1e-9, upper)
    return jsc
Пример #6
0
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
Пример #7
0
def p_in(TE, lam):
    integrand = TE * np.pi
    upper = np.amax(lam)
    p = numlib.Integrate(integrand, lam, 1e-9, upper)
    return p
Пример #8
0
def Pwr_den(TE, lam, lbg):
    PDA = (lam / lbg) * TE
    PD = numlib.Integrate(PDA, lam, 1e-9, lbg)
    return PD * np.pi
Пример #9
0
def integrated_solar_power(lam):
    AM = datalib.AM(lam)
    upper = np.amax(lam)

    p_in = numlib.Integrate(AM, lam, 1e-9, upper)
    return p_in
Пример #10
0
def RGB_FromSpec(TE, lam):

    ### get color response functions 
    cie = datalib.CIE(lam)
    
    ### get X from TE spectrum 
    X = numlib.Integrate(TE*cie['xbar'], lam, 380e-9, 780e-9)

    ### get Y from TE spectrum
    Y = numlib.Integrate(TE*cie['ybar'], lam, 380e-9, 780e-9)
    
    ### get Z from TE spectrum
    Z = numlib.Integrate(TE*cie['zbar'], lam, 380e-9, 780e-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
Пример #11
0
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