def calculateKDP(phiDP, ran):
# smooth phiDP field and take derivative
numRan = ran.shape[0]
kdp = np.ma.masked_all(phiDP.shape)
smoothPhiDP = smPhiDP(phiDP, ran)
# take derivative of kdp field
winLen = 11
rprof = ran[0:winLen*2-1]/1000.
for i in range(numRan-winLen*3):
numvalid = smoothPhiDP[:,i:i+winLen*2-1].count(axis=1)
max_numv = np.max(numvalid)
if max_numv==(winLen*2-1):
kdp[numvalid==(winLen*2-1),i+winLen] = 0.5*np.polyfit(rprof,
smoothPhiDP[numvalid==(winLen*2-1),i:i+winLen*2-1].transpose(), 1)[0]
return kdp
# function for creating color map
#----------------------------------
评论列表
文章目录