从拉姆斯码可视化AMR数据的程序包

osyris的Python项目详细描述


Osyris

A python visualization utility for RAMSES data. Its purpose is to plot quick diagnostics while a simulation is running, and also produce publication grade figures.

文件

osyris的文档位于Readthedocs

安装

pip install osyris

一个简短的例子

importosyrismydata=osyris.RamsesData(71,scale="au")osyris.plot_slice(mydata.log_rho,direction="z",vec=mydata.velocity,dx=100)

演示

您可以下载示例数据here

importosyrisimportmatplotlib.pyplotasplt# Load datamydata=osyris.RamsesData(nout=71,center="max:density",scale="au")# Create figurefig=plt.figure(figsize=(20,10))ax1=fig.add_subplot(231)ax2=fig.add_subplot(232)ax3=fig.add_subplot(233)ax4=fig.add_subplot(234)ax5=fig.add_subplot(235)ax6=fig.add_subplot(236)# Density vs B field with AMR level contoursosyris.plot_histogram(mydata.log_rho,mydata.log_B,axes=ax1,scalar=True,scalar_args={"cmap":"log,YlGnBu"},contour=mydata.level,contour_args={"fmt":"%i","label":True,"colors":"k","cmap":None,"levels":range(5,20),"cbar":False})# Create new field with log of velocitymydata.new_field(name="log_vel",operation="np.log10(np.sqrt(velocity_x**2+velocity_y**2+velocity_z**2))",unit="cm/s",label="log(Velocity)")# Density vs log_vel in scatter mode with a grey outlineosyris.plot_histogram(mydata.log_rho,mydata.log_vel,axes=ax2,scatter=mydata.log_T,scatter_args={"iskip":100,"cmap":"gnuplot"},outline=True)#x,z density slice with B field streamlinesosyris.plot_slice(mydata.density,direction="yxz",stream=mydata.B,dx=100,axes=ax3,scalar_args={"cmap":"log"})# x,y density slice with velocity vectors in colorosyris.plot_slice(scalar=mydata.log_rho,direction="z",vec=mydata.velocity,dx=100,axes=ax4,vec_args={"cmap":"seismic","vskip":4})# x,y temperature slice with velocity vectorsosyris.plot_slice(mydata.log_T,direction="z",vec=mydata.velocity,dx=100,axes=ax5,scalar_args={"cmap":"hot"},contour=mydata.level,contour_args={"fmt":"%i","label":True,"colors":"w","cmap":None,"levels":range(9,17)})# Now update values with later snapshotmydata.update_values(201)# Re-plot x,y density slice with velocity vectorsosyris.plot_slice(mydata.log_rho,direction="z",vec=mydata.velocity,dx=100,axes=ax6)fig.savefig("demo.pdf",bbox_inches="tight")

logo

有问题或需要新功能?

Github上提交问题。

贡献者

  • Neil Vaytet(星空计划/NBI)
  • Tommaso Grassi(星图/NBI)
  • 马蒂亚斯·冈萨雷斯(CEA Saclay)
  • 特洛伊尔豪博勒(星图/国家地理信息局)
  • 卢卡斯·比尔斯

徽标积分

Icon vector created by frimufilms - www.freepik.com

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
Java Hibernate@ManyToMany mapping只在一个方向上在数据库中添加记录   java将文件上载到tomcat服务器外部的文件夹   java将摄像头捕获的图像上传到服务器   java如何创建Rest API并为进程添加时间延迟?   springmodulesvalidation0中缺少java注释包。8a源文件   如何在java中打印SOAP头   Spring security中的java自定义消息,包括UserDetailsService实现和异常   java如何使用Htmlunit中的表单数据登录站点   web如何在WildFly上自动运行java文件   java如何从已经使用另一个方法传递的参数的方法中获取返回值?   java我在JFrame上有一个索引越界。setContentPane   java中的循环序列/系列打印   java maven 3 webapp没有要运行的测试吗?   java CORS不允许POST请求   java再次在派生类中的Jackson中添加字段,该字段在基类中被忽略   爪哇坑测试显示仆从由于超时而异常退出   java寻找第10001个素数   java jboss是否更改web应用程序上下文根?