| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
nonos is a Python 2D visualization library for planet-disk numerical simulations.
It supports vtk-formatted data from Pluto and Idefix, and dat-formatted data for Fargo-adsg and Fargo3D.
This page illustrates basic examples. For more, read the documentation !
nonos supports the following data formats
nonos is considered public beta software: we are actively improving the design and API, but we are not at the point where we want to bless the current state as stable yet. We are trying to keep breaking changes to a minimum, and run deprecation cycles to minimize the pain, however they might happen in any minor release, so if you rely on nonos for your own work (thank you !), we strongly encourage you to follow along releases and upgrade frequently, so we have more opportunities to discuss if something breaks.
Get nonos and its minimal set of dependencies as
python -m pip install nonosOptionally, you can install with the companion command line interface too
python -m pip install "nonos[cli]"or, to get all optional dependencies (CLI included)
python -m pip install "nonos[all]"We'll start by defining a GasDataSet object
from nonos.api import GasDataSet
ds = GasDataSet(
43,
geometry="polar",
directory="tests/data/idefix_planet3d",
)We can select the RHO field, reduce it to a vertical slice in the midplane, and derive a Plotable object mapping the cartesian 'x', 'y' plane, all while ensuring the 0th planet lies close to azimuth 0
p = ds["RHO"].vertical_at_midplane().map("x", "y", rotate_with="planet0.dat")Now let's actually visualize our results
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.set_aspect("equal")
p.plot(
fig,
ax,
log=True,
cmap="inferno",
title=r"$\rho_{\rm mid}$",
)This time, we'll reduce the RHO field to a single dimension, via a latitudinal projection, followed by an azimuthal average, and map the result to the radial axis.
fig, ax = plt.subplots()
(
ds["RHO"]
.latitudinal_projection(theta=3 * 0.05)
.azimuthal_average()
.map("R")
.plot(fig, ax, color="black", title=r"$\Sigma$")
)nonos comes with a matplotlib stylesheet, used by nonos-cli, that can be reused programmatically, without importing the package, using matplotlib API
import matplotlib.style
matplotlib.style.use("nonos.default")See matplotlib.style's documentation for more.
| Back | FazBrowse Home | New Git URL |