当前位置:蜗牛素材网>综合资讯>科技>正文

sci论文三维图,高端SCI论文三维数据可视化图终极解决方案之Tecplot

人气:325 ℃/2024-04-16 05:14:33

高水平科研结果必须要用高水平数据可视化方式展现给编辑、审稿人和读者!尤其是三维数据可视化尤为重要,如果能用严谨、准确、美观的方式将你研究成果的三维数据呈现出来,那无疑是加分项,有可能也是打动编辑和审稿人的一个法宝!

三维数据可视化的普适方法

「三维数据可视化的终极解决方案就是通过非结构化网格数据表达,然后就可以很容易的用一些三维可视化软件进行作图」。本人主要推荐的三维可视化四小龙:「Tecplot, Paraview, Python, GMT。」 Nature子刊作者手把手教学,推出三维数据可视化系列教程,附带约三小时4K教学视频和全部代码。通过本文底部的了解更多按钮观看全部精讲视频。本文是系列教程的第三部分。Tecplot部分和Paraview部分很类似,分开的原因是为了因人而异选择自己喜欢的一个。Tecplot的一大优势就是图片导出功能更强大,可以导出矢量图,而且非常容易。相比之下Paraview就稍有逊色,几乎无法导出高质量图片。国外一些学者偷懒的做法就是直接截屏(不管咋样,开心就好)。

幻灯片预览

Tecplot三维绘图实例截屏

这里的幻灯片预览效果不好,只能放一张片子,请通过「了解更多」按钮体验更好的效果。

视频预览重点和难点

「重点」是数据格式的转换,「难点」是对VTK的非结构化网格数据格式VTU的理解。如果是第一次听说这个概念,得花点时间看看我的视频或者上网搜索一些资料学习一下。而且在文末的全部视频教程里面,详细讲解了如何将xyz三维坐标转换为VTU的格式,并附带了相应的代码可供参考和学习。

三角网格的强大和通用性规则网格转VTU的关键代码预览

每个人遇到的情况都不一样,「必须将自己的数据转换或保存为通用的三维数据格式(比如VTU格式)」 才能被一些三维软件读取、才能愉快的玩耍。所以,学一点点编程技能,对于自定义转换自己数据的格式有很大帮助。

defconvertDEM2VTU(DEMgrd,scale_z=10,scale_coord=1):ext=DEMgrd.split('.')[-1]fname=DEMgrd[0:len(DEMgrd)-len(ext)-1]#1.grdtoxyzos.system('gmtgrd2xyz' DEMgrd '>' fname '.xyz')cmd_lonlat2UTM=str("awk'{print$1,$2,$3*%f,$3}'%s.xyz|cs2cs proj=latlon to proj=tmerc datum=potsdam lon_0=%f lat_0=%f x_0=%f y_0=%f>%s_UTM.xyz"%(scale_z,fname,lon0,lat0,x0,y0,fname))os.system(cmd_lonlat2UTM)#3.xyztovtuprint('3.xyztovtuStart')os.system('gmtgrdinfo' DEMgrd '>tmp.info')grdinfo=linecache.getlines('tmp.info')os.system('rmtmp.info')linecache.clearcache()nrows=0ncols=0forstr_lineingrdinfo:if('n_columns'instr_line):ncols=int(str_line.split('n_columns:')[-1])if('n_rows'instr_line):nrows=int(str_line.split('n_rows:')[-1])#loadxyzdataprint(fname '_UTM.xyz')data=np.loadtxt(fname '_UTM.xyz')x=data[:,0]*scale_coordy=data[:,1]*scale_coordz=data[:,2]*scale_coorddem=data[:,3]*scale_coordnpoints=len(x)nCells=(ncols-1)*(nrows-1)VTK_CELLTYPE=9#四边形np_per_cell=4#writevtuvtufile=fname '_UTM.vtu'fpout=open(vtufile,'w')fpout.write('<VTKFiletype="UnstructuredGrid"version="1.0"byte_order="LittleEndian"header_type="UInt64">\n')fpout.write('<UnstructuredGrid>\n')fpout.write('<PieceNumberOfPoints="%.0f"NumberOfCells="%.0f">\n'%(npoints,nCells))fpout.write('<PointDataScalars="DEM">\n')fpout.write('<DataArraytype="Float64"Name="DEM"format="ascii">\n')fpout.write('')foriinrange(0,len(dem)):fpout.write('%f'%(dem[i]))fpout.write('\n</DataArray>\n')fpout.write('</PointData>\n')fpout.write('<CellData>\n')fpout.write('</CellData>\n')fpout.write('<Points>\n')fpout.write('<DataArraytype="Float32"Name="Points"NumberOfComponents="3"format="ascii">\n')foriinrange(0,len(x)):fpout.write('%f%f%f\n'%(x[i],y[i],z[i]))fpout.write('</DataArray>\n')fpout.write('</Points>\n')fpout.write('<Cells>\n')fpout.write('<DataArraytype="Int64"Name="connectivity"format="ascii">\n')fornrowinrange(0,nrows-1):forncolinrange(0,ncols-1):LL=ncol nrow*ncolsfpout.write('%.0f%.0f%.0f%.0f\n'%(LL,LL 1,LL 1 ncols,LL ncols))fpout.write('</DataArray>\n')fpout.write('<DataArraytype="Int64"Name="offsets"format="ascii">\n')fpout.write('')foriinrange(0,nCells):fpout.write('%.0f'%(i*np_per_cell))fpout.write('</DataArray>\n')fpout.write('<DataArraytype="UInt8"Name="types"format="ascii">\n')fpout.write('')foriinrange(0,nCells):fpout.write('%.0f'%(VTK_CELLTYPE))fpout.write('</DataArray>\n')fpout.write('</Cells>\n')fpout.write('</Piece>\n')fpout.write('</UnstructuredGrid>\n')fpout.write('</VTKFile>\n')print('3.xyztovtuDone:',vtufile)fpout.close()os.system('meshio-binary' vtufile)全部视频和相应的代码

通过本文底部的了解更多按钮观看全部精讲视频和下载涉及到的一点点shell和python脚本

搜索更多有关“sci论文三维图,高端SCI论文三维数据可视化图终极解决方案之Tecplot”的信息 [百度搜索] [SoGou搜索] [头条搜索] [360搜索]
本网站部分内容、图文来自于网络,如有侵犯您的合法权益,请及时与我们联系,我们将第一时间安排核实及删除!
CopyRight © 2008-2024 蜗牛素材网 All Rights Reserved. 手机版