Skip to main content

A lightweight plotting library for protoplanetary disks simulations

Project description

nonos

PyPI Supported Python Versions Documentation Status uv

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.

For more, read the documentation !

Data Formats

We list here the accepted formats for the data: Pluto and Idefix: data.****.vtk Fargo-adsg: gasdens.dat, gasvy*.dat, gasvx*.dat Fargo3D: same as Fargo-adsg + gasvz*.dat

Development status

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.

Installation

Get nonos and its minimal set of dependencies as

python -m pip install nonos

Optionally, you can install with the companion command line interface too

python -m pip install "nonos[cli]"

or, to also get all optional dependencies (CLI included)

python -m pip install "nonos[all]"

Usage

from nonos.api import GasDataSet
import matplotlib.pyplot as plt

plt.close("all")
# We use GasDataSet which takes as argument the output number of the output file given by idefix/pluto/fargo
# contains in particular a dictionary with the different fields.
ds = GasDataSet(43, geometry="polar", directory="nonos/tests/data/idefix_planet3d")
# We select the GasField "RHO", then
# we perform a vertical slice in the midplane,
# and make the result plotable in the xy plane,
# rotating the grid given the planet number 0
# (which orbit is described in the planet0.dat file).
dsop = ds["RHO"].vertical_at_midplane().map("x", "y", planet_corotation=0)
fig, ax = plt.subplots()
# dsop is now a Plotable object.
# We represent its log10, with a given colormap,
# and we display the colorbar by adding the argument title.
dsop.plot(fig, ax, log=True, cmap="inferno", title=r"$\rho_{\rm mid}$")
ax.set_aspect("equal")

# This time, we perform a latitudinal projection,
# i.e. the integral of "RHO" between -theta and theta,
# and then an azimuthal average,
# before mapping it in the radial ("R") direction.
dsop = ds["RHO"].latitudinal_projection(theta=3*0.05).azimuthal_average().map("R")
fig, ax = plt.subplots()
# We display the y-axis by adding the argument title.
dsop.plot(fig, ax, c="k", title=r"$\Sigma$")
plt.show()

Reusing nonos' style

requires matplotlib >= 3.7

nonos CLI uses a custom style that can be reused programmatically, without importing the package, using matplotlib API

import matplotlib.pyplot as plt
plt.style.use("nonos.default")

See matplotlib.style's documentation for more.

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

nonos-0.19.1.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonos-0.19.1-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file nonos-0.19.1.tar.gz.

File metadata

  • Download URL: nonos-0.19.1.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nonos-0.19.1.tar.gz
Algorithm Hash digest
SHA256 ae83b909c207bec1664c4dd3a57f449feb5dff8b06dd9f98e8fbc5a473530c6f
MD5 3616f714a673c29b86c729de5af1af5c
BLAKE2b-256 165944b6a73bebbeeae0e2066d8c7e292aa6dfb47cea3e0b9416ebf72defd9fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonos-0.19.1.tar.gz:

Publisher: cd.yml on la-niche/nonos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonos-0.19.1-py3-none-any.whl.

File metadata

  • Download URL: nonos-0.19.1-py3-none-any.whl
  • Upload date:
  • Size: 46.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nonos-0.19.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12b14aa5a36c287d3059deee05e1943cadb2a31b10531122966a6fcbc67b6f66
MD5 994eb31e9c6775d73013a852c5c59887
BLAKE2b-256 f405eea320f8018258046abc56da2c71e7a780ab2f3decd4fde8890d103407b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonos-0.19.1-py3-none-any.whl:

Publisher: cd.yml on la-niche/nonos

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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