我正在尝试在python中计算相对涡度(= dU / dX-dV / dY)。我有U,V,lat和lon的一维数组。我的纬度和经度坐标位于网格中,因此其中一些重复。我的数组是:
lon = np.array([-93.640015,-93.599976,-93.56,-93.52002 ,-93.47998,-93.44,-93.400024,-93.359985,-93.32001,-93.28003,-93.640015,-93.599976,-93.56,-93.52002,-93.47998,-93.44,-93.400024,-93.359985,-93.32001,-93.28003])
lat = np.array([29.03153,29.03153,29.03153,29.03153,29.03153,29.03153,29.03153,29.03153,29.03153,29.03153,29.066498,29.066498,29.066498,29.066498,29.066498,29.066498,29.066498,29.066498,29.066498,29.066498])
u = np.array([2.98416703e-02,2.59581834e-02,2.25246690e-02,1.68767605e-02,1.43524449e-02,1.19425484e-02,1.20668322e-02,1.79333987e-02,2.49181638e-02,2.99075051e-02,1.76467458e-02,1.82732993e-02,1.74999971e-02,1.63465894e-02,1.36516073e-02,1.07526695e-02])
v = np.array([0.00950976,0.01046121,0.00958017,0.00939799,0.00809484,0.0064752,0.01117415,0.02004881,0.02532745,0.02617119,0.00813138,0.00966279,0.01056663,0.01148393,0.01069429,0.00952538,0.01084836,0.01592345,0.02085907,0.0230558])
我尝试对每个一维数组使用np.gradient
来获取dU
,dV
,dX
,dY
,但是由于纬度重复在网格中,大多数dY
点为零。计算相对涡度时,有没有办法解决这个问题?