计算可沉淀水

我在如何使用metpy的某些命令计算可沉淀水量方面遇到问题。到目前为止,这是我需要的代码:

编辑

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import scipy.ndimage as ndimage
from scipy.ndimage.filters import minimum_filter,maximum_filter
from mpl_toolkits.basemap import cm
import metpy.calc as mcalc
from metpy.units import units

filename='totalprecipitablewater'
title ='Total Precipitable Water'
cbarlabel = 'Millimeters (mm)'
boundaryColor = 'gray'
frequency = 3                   # frequency in hrs
ticks = np.arange(-10,120,10)
time = 0
pressure = []
vapor_pressure = []
dew_point = []

def plot(variables,prev_vars,pltenv):

    cont_int = 10
    cont_smooth = 0.5
    x = pltenv['x']
    y = pltenv['y']
    m = pltenv['map']

    bbox = dict(boxstyle="square",ec='None',fc=(1,1,0.75))
    mixing_ratio = variables['QVAPOR'][time]
    pressure = (variables['PB'][time] * units.pascals + variables['P'][time] * units.pascals)
    e = mcalc.vapor_pressure(pressure,mixing_ratio)
    td = mcalc.dewpoint(e)

    i = 0
    while i < 300:
      j = 0
      while j < 211:
        tpw = mcalc.precipitable_water(td[:,i,j],pressure[:,bottom=None,top=None)
        j+=1
      i+=1
    print(tpw)

“变量”为我的数据调用WRF模型。 “ tpw”代表总可沉淀水,这是我要计算的。

zhonglin0701 回答:计算可沉淀水

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3089065.html

大家都在问