Skip to main content

A package to visualize AMR data from the RAMSES code

Project description

demo.png

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.

Documentation

The documentation for osyris is hosted on Readthedocs.

Installation

pip install osyris

From within ipython

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

Demo

You can download the sample data here.

import osyris

# Load data
mydata = osyris.RamsesData(nout=71,center="max:density",scale="au")

# Create figure
fig = osyris.plt.figure()
ratio = 0.5
sizex = 20.0
fig.set_size_inches(sizex,ratio*sizex)
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 contours
osyris.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 velocity
mydata.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 outline
osyris.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 streamlines
osyris.plot_slice(mydata.density, direction="y", stream=mydata.B, dx=100,
                  axes=ax3, scalar_args={"cmap": "log"})
# x,y density slice with velocity vectors in color
osyris.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 vectors
osyris.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 snapshot
mydata.update_values(201)
# Re-plot x,y density slice with velocity vectors
osyris.plot_slice(mydata.log_rho, direction="z", vec=mydata.velocity,
                  dx=100, axes=ax6)

fig.savefig("demo.pdf", bbox_inches="tight")

Have a problem or need a new feature?

Submit an issue on Github.

Contributors

  • Neil Vaytet (StarPlan/NBI)
  • Tommaso Grassi (StarPlan/NBI)
  • Matthias Gonzalez (CEA Saclay)
  • Troels Haugbolle (StarPlan/NBI)
  • Lucas Beeres

Logo credit

Icon vector created by frimufilms - www.freepik.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osyris-1.0.4.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

osyris-1.0.4-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

Details for the file osyris-1.0.4.tar.gz.

File metadata

  • Download URL: osyris-1.0.4.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for osyris-1.0.4.tar.gz
Algorithm Hash digest
SHA256 ae99e251ca15869e1a6ac6a471156558a636d162a4feb96bb1f3d1e827b6fde4
MD5 6b6fe9936ba289762fa9f4aa89e3982c
BLAKE2b-256 107d044df7ef4d8cb0b7c2a352347685df4e6db1314185aad858bf2f8dd885c8

See more details on using hashes here.

File details

Details for the file osyris-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: osyris-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 50.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for osyris-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4c03aea03ea0ea0f3b39140dbbb8e4e596084efb6279ef62340ad5e9772b3389
MD5 1e4b1a9e731191d70170bdc7cd97c1be
BLAKE2b-256 0f4c408449706eb4ac221e34794919620edc724f27943dfc6623c076b88ea2c0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page