A lightweight plotting library for protoplanetary disks simulations
Project description
nonos
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 !
Data Formats
nonos supports the following data formats
- 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 get all optional dependencies (CLI included)
python -m pip install "nonos[all]"
Examples
Building a 2D map
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}$",
)
Visualizing a 1D graph
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$")
)
Reusing nonos' style
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonos-0.20.0.tar.gz.
File metadata
- Download URL: nonos-0.20.0.tar.gz
- Upload date:
- Size: 49.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57211d0333d59d2f486a5d0789f42b1f3e4e566f8ad8f21a32ed97a218d5be8a
|
|
| MD5 |
488c77ade9f3f13aa31397345f2de109
|
|
| BLAKE2b-256 |
2f0bc4d318b68c45990cd33e8c78c679fc277e74e3b153f0f1b770442e2089ac
|
Provenance
The following attestation bundles were made for nonos-0.20.0.tar.gz:
Publisher:
cd.yml on la-niche/nonos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonos-0.20.0.tar.gz -
Subject digest:
57211d0333d59d2f486a5d0789f42b1f3e4e566f8ad8f21a32ed97a218d5be8a - Sigstore transparency entry: 1003756600
- Sigstore integration time:
-
Permalink:
la-niche/nonos@e15ffd8c1169564aa2e850b43404830298c8007a -
Branch / Tag:
refs/tags/v0.20.0 - Owner: https://github.com/la-niche
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@e15ffd8c1169564aa2e850b43404830298c8007a -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonos-0.20.0-py3-none-any.whl.
File metadata
- Download URL: nonos-0.20.0-py3-none-any.whl
- Upload date:
- Size: 52.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0610c5a8b4e070c38efe157c480fad9e049142bed2d124e4da337618fcee403
|
|
| MD5 |
1d3d3e0099872ec655263e53077f29b2
|
|
| BLAKE2b-256 |
b46ed4a9e9b3b7f275b5ae2904fe051aebf7dc018e2ecfe9d8bfe4439a4fcf27
|
Provenance
The following attestation bundles were made for nonos-0.20.0-py3-none-any.whl:
Publisher:
cd.yml on la-niche/nonos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonos-0.20.0-py3-none-any.whl -
Subject digest:
f0610c5a8b4e070c38efe157c480fad9e049142bed2d124e4da337618fcee403 - Sigstore transparency entry: 1003756608
- Sigstore integration time:
-
Permalink:
la-niche/nonos@e15ffd8c1169564aa2e850b43404830298c8007a -
Branch / Tag:
refs/tags/v0.20.0 - Owner: https://github.com/la-niche
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@e15ffd8c1169564aa2e850b43404830298c8007a -
Trigger Event:
push
-
Statement type: