Highly specialized, and perhaps not as transferable (nor computationally intensive):
SHIP:
SHIP[:,:] = (CAPE_MU[:,:]*Q_MU[:,:]*LAPSE[:,:]*-T500[:,:]*S06[:,:])/42000000.
for i in range(0,nx):
for j in range(0,ny):
if(CAPE_MU[j,i]<1300.):
SHIP[j,i] = SHIP[j,i]*(CAPE_MU[j,i]/1300.)
if(LAPSE[j,i]<5.8):
SHIP[j,i] = SHIP[j,i]*(LAPSE[j,i]/5.8)
if(FZL[j,i]<2400.):
SHIP[j,i] = SHIP[j,i]*(FZL[j,i]/2400)
STP and SCP:
#Calculate Supercell/STP parameters
# term1: cape term #
term1 = CAPE_SB / 1500.
# term2: LCL term #
term2 = (2000. - SBLCL) / 1000.
#set term2 values to 1 or 0 based on lcl height
term2[SBLCL < 1000.] = 1.
term2[SBLCL > 2000.] = 0.
# term3: SRH term #
term3 = srh1km / 150.
# term4: 0-6km shear term #
term4 = S06 / 20.
#cap term4 when 0-6km bwd > 30. m/s
term4[S06 > 30.] = 1.5
#set term4 to zero where 0-6km bwd < 12.5 m/s
term4[S06 < 12.5] = 0.
#cin mask
term5 = np.fabs(CIN_SB)
term5[np.fabs(CIN_SB)>125]=0.
term5[np.fabs(CIN_SB)<=125]=1.
# calc STP #
STP = term1 * term2 * term3 * term4 * term5
#calculate SCP#
scp1 = CAPE_SB/1000.
scp2 = srh3km/100.
scp3 = S06/20.
SCP = scp1*scp2*scp3*term5
EHI
EHI3 = ((CAPE)*(SRH3))/(1.6*10**5)
EHI1 = ((CAPE)*(SRH1))/(1.6*10**5)
SHERB/MOSHE (Requires Theta E calculation, and input of W):
MOSH = (((LAPSE_3km-4.)**2)/4.)*((S15-8.)/10.)*((lsf+10.)/9.)
MOSH[MOSH<0]=0.0
#Calculate SHERB
SHERB = ((S03/26.0)*(LAPSE_3km/5.2)*(LAPSE/5.6))
Highly specialized, and perhaps not as transferable (nor computationally intensive):
SHIP:
STP and SCP:
EHI
SHERB/MOSHE (Requires Theta E calculation, and input of W):