定位shearlines或变形区地图-地球科学堆栈交换江南电子竞技平台江南体育网页版 最近30从www.hoelymoley.com 2023 - 07 - 08 - t04:53:16z //www.hoelymoley.com/feeds/question/16990 https://creativecommons.org/licenses/by-sa/4.0/rdf //www.hoelymoley.com/q/16990 3 定位shearlines或变形区域的地图 Lyndz //www.hoelymoley.com/users/16927 2019 - 05 - 20 - t06:35:17z 2019 - 09 - 05 - t06:38:17z < p >我寻找一种方法来检测shearlines或融合等地区,如下图所示(红色虚线)。< / p > < p >我能够推导出拉伸,剪切和总变形。< / p > < p > shearline正值地区最大拉伸变形。< / p > < p >目前,我画shearline手动。但是我想知道如果有一种方法可以自动检测这条线或变形区。< / p > < p >我想两种方式< / p > < ol > <李> < p >看(即动态变量。、拉伸变形)< / p > < /李> <李> < p >使用Python的模式识别功能来检测这种模式。< / p > < /李> < / ol > < p > <强>问题< /强> < / p > < p >任何建议我可以自动检测到。我不知道如何实现上面的方法。我不确定什么标准设置为了画出shearline。< / p > < p >我也新Python所以我不知道如何实现第二个。< / p > < p >我有风netcdf格式的数据和计算变形。我上传文件到以下链接:< / p > < p > < a href = " https://www.dropbox.com/s/ym5jo07cb7niqkw/T62_ncep_uwnd.nc?dl = 0 nofollow noreferrer“rel = > UWND < / > < / p > < p > < a href = " https://www.dropbox.com/s/m40wu3al7tf32ut/T62_ncep_vwnd.nc?dl = 0 nofollow noreferrer“rel = > VWND < / > < / p > < p > < a href = " https://www.dropbox.com/s/cfcq3awxe2a1tbo/deform.nc?dl = 0 nofollow noreferrer“rel = >链接计算变形参数< / > < / p > < p >变形参数计算:< a href = " https://i.stack.imgur.com/Y7aSt.png " rel = " nofollow noreferrer " > < img src = " https://i.stack.imgur.com/Y7aSt.png " alt = "变形参数" > < / > < / p > < p >中,B,和V是剪切、拉伸,和总变形参数。< / p > < p >变形。nc file, shear_sph(shearing deformation; A in the equation above); stretch_sph(stretching deformation; B in the equation B); deform_sph(total deformation; V in the equation above).

I'll appreciate any help about this matter.

SUMMARY

I am looking for the NCL Shear, stretch, deform functionality in Python. Are there any existing software packages or do I have to write my own ?

//www.hoelymoley.com/questions/16990/-/16993 # 16993 2 答案为定位gansub shearlines或变形区域的地图 gansub //www.hoelymoley.com/users/1066 2019 - 05 - 20 - t12:12:09z 2019 - 07 - 01 - t02:44:11z < p >我不能够充分实际代码在Python中但我希望我可以点你在正确的方向上如果我计算分流和汇合。< / p > < p >可以开始做< a href = " https://matplotlib.org/gallery/images_contours_and_fields/plot_streamplot.html " rel = " nofollow noreferrer " >流线阴谋使用matplotlib < / >。一旦你有了,你需要实际的简化数据中描述这个链接——< a href = " https://matplotlib.org/api/_as_gen/matplotlib.pyplot.streamplot.html " rel = " nofollow noreferrer " > https://matplotlib.org/api/_as_gen/matplotlib.pyplot.streamplot.html < / >, LineCollection给出数据结构。< / p > < p >每简化LineCollection需要计算< a href = " https://scicomp.stackexchange.com/questions/16444/determine-unit-outward-normal-vector-for-a-curve/16445 # 16445 " >切向和法向量< / >基于局部笛卡尔坐标系统的起源的想法集中在某处沿着流线。< / p > < p >一旦你有切向和法向量将需要使用这个方程即散度在自然坐标系< / p > < p > <跨类= " math-container " > $ $ \微分算符。v_h = (e_n \压裂{\部分e_s}{\部分n} * v_h) + \压裂{\部分v_h}{\部分年代}$ $ < / span > < / p > < p >使用结合< a href = " https://en.wikipedia.org/wiki/Frenet%E2%80%93Serret_formulas " rel = " nofollow noreferrer " > Frenet艾史蒂夫公式< / >这可以显示等于< / p > < p > <跨类= " math-container " > $ $ \压裂{| v_h |} {R_n} + \压裂{\部分v_h}{\部分年代}$ $ < / span > < / p > < p >从你的角度你只要第一项方程计算分流和汇合。所以< span class = " math-container " > R_n < / span >是美元的曲率半径法向量(之前你已经计算)。为了计算曲率半径可以使用这个< a href = " https://github.com/bdhammel/least-squares-ellipse-fitting " rel = " nofollow noreferrer " > python代码的最小二乘拟合< / >(使用最小二乘的方法——获得椭圆然后计算半径)。如果半径是积极的我. .e $R_n >0 $ then you have an area of diffluence and negative then confluence.

UPDATE

If you are looking for the exact NCL shear stretch deform in Python what you can do is to use this package in python pyspharm. The data has to be global and then you need to orient the grid in a south to north direction. Once you have that you can use that package to calculate the shear, stretch and deformation parameters by using the pyspharm's getgrad() method to calculate the vector gradient of the wind vectors. If you pass in the components of the wind vectors(both u and v) to getgrad() you will get the zonal and meridional components of the gradient of the wind vectors. Adding and subtracting them will get you the shear and stretch.

Sample code

 from spharm import Spharmt uspectral = Spharmt.grdtospec(u,ntruncation) vspectral = Spharmt.grdtospec(v,ntruncation) dudx,dudy = Spharmt.getgrad(uspectral) dvdx,dvdy = Spharmt.getgrad(vspectral) #shear and stretch shear = dvdx + dudy stretch = dudx - dvdy 
Baidu
map