我一直在写一个python脚本,我正在用它来研究WRF模型,我在插值例程方面遇到了一些困难。在我的例子中,我试图绘制一个特定的区域,然而,使用一个全面的压力水平,特别是对于较低的水平(1000850),通常会导致极端的最大值或nan值,因为山区位于地面以下。在
所以,我的想法是写一个脚本来检测地面的压力水平(很容易做到以下几点):
pb = ncFile.variables['PB'][0][0]
p = ncFile.variables['P'][0][0]
sfcPres = pb + p
这将产生一个包含地压的二维阵列表面,然后在这些表面上建立另外两个分别包含50hPa和100hPa压力的场:
^{pr2}$从这里我想给三个数组:sfcPres、medLevel和topLevel作为一个插值函数的高度参数,将每个lat,lon对上的数据集插值到这三个数组中各自的lat,lon对。在
我的问题是,到目前为止,我使用的所有插值例程都只允许插值到压力水平的一个奇异值,正如我前面所述,这导致了边缘极值的问题。在
我希望能够在this function的顺序上做一些事情,其中desiredlevel参数可以采用该2D数组,并在该2D数组中的每个点对3D数据集(数组为[Z,lat,lon])执行插值。在
有没有人知道这样做的一个简单的方法,不涉及使用循环,因为数据集是相当大的,我需要计算平均值函数使用8个组合集约60个文件。在
谢谢!在
没有简单的方法可以做到这一点,它确实涉及到使用循环。我有我自己的WRF程序,线性插值4D变量场到我指定的等高曲面。我相信你应该可以修改压力表面的函数。我一直在工作,虽然WRF的数据困扰着我自己。在
相关问题 更多 >
编程相关推荐