Skip to main content

A tool to analyze results from idefix/pluto simulations (for protoplanetary disks more specifically)

Project description

nonos

PyPI pre-commit.ci status Code style: black Imports: isort

nonos is a 2D visualization command line application for planet-disk hydro simulations, as well as a Python library. It works seamlessly with vtu-formatted data from Pluto, Fargo3D and Idefix.

:construction: This project and documentation are under construction :construction:

Ongoing progress

  • spherical coordinates
  • error: streamlines & rz=True -> not yet implemented
  • warning: isPlanet=False & corotate=True -> we don't rotate the grid if there is no planet for now. omegagrid = 0.
  • warning: geometry="polar" & rz=True -> plot not optimized for now in the (R,z) plane in polar.

Installation

:warning: Nonos requires Python 3.8 or newer. The easiest installation method is

$ pip install nonos

Usage

1. On the command line

The nonos CLI gets its parameters from three sources:

  • command line parameters
  • a configuration file
  • default values

Command line parameters take priority over the configuration file, which itself takes priority over default values.

To get help, run

$ nonos --help
usage: nonos [-h] [-dir DATADIR] [-field {RHO,VX1,VX2,VX3}] [-vmin VMIN]
             [-vmax VMAX] [-cpu NCPU] [-on ON [ON ...] | -all] [-diff] [-log]
             [-isp] [-corotate] [-grid] [-streamlines] [-rz] [-noavr] [-pbar]
             [-stype {random,fixed,lic}] [-srmin RMINSTREAM]
             [-srmax RMAXSTREAM] [-sn NSTREAMLINES]
             [-geom {cartesian,polar} | -pol] [-dim {1,2}] [-ft FONTSIZE]
             [-cmap CMAP] [-fmt FORMAT] [-dpi DPI] [-input INPUT | -isolated]
             [-d | -version | -logo | -config]

Analysis tool for idefix/pluto/fargo3d simulations (in polar coordinates).

optional arguments:
  -h, --help            show this help message and exit
  -dir DATADIR          location of output files and param files (default:
                        '.').
  -field {RHO,VX1,VX2,VX3}
                        name of field to plot (default: 'RHO').
  -plane {rphi,rz,rtheta,xy,xz,yz}
                        name of plane of projection (default: 'xy').
  -range RANGE [RANGE ...]
                        range of matplotlib window (default: unset)
                        example: x x -2 2
  -vmin VMIN            min value in -diff mode (default: -0.5)
  -vmax VMAX            max value in -diff mode (default: -0.5)
  -cpu NCPU, -ncpu NCPU
                        number of parallel processes (default: 1).
  -on ON [ON ...]       output number(s) (on) to plot. This can be a single
                        value or a range (start, end, [step]) where both ends
                        are inclusive. (default: last output available).
  -all                  save an image for every available snapshot (this will
                        force show=False).
  -dim {1,2}            dimensionality in projection: 1 for a line plot, 2
                        (default) for a map.
  -ft FONTSIZE          fontsize in the graph (default: 11).
  -cmap CMAP            choice of colormap for the -dim 2 maps (default:
                        'RdYlBu_r').
  -scaling SCALING      scale the overall sizes of features in the graph (fonts, linewidth...)
                        (default: 1).
  -dpi DPI              image file resolution (default: DEFAULTS['dpi'])

boolean flags:
  -diff                 plot the relative perturbation of the field f, i.e.
                        (f-f0)/f0.
  -log                  plot the log10 of the field f, i.e. log(f).
  -isp                  is there a planet in the grid ?
  -corotate             does the grid corotate? Works in pair with -isp.
  -grid                 show the computational grid.
  -noavr, -noaverage    do not perform averaging along the third dimension.
  -pbar                 display a progress bar

streamlines options:
  -lic {V,B}            which vector field for lic streamlines (default: 'unset')
  -dpilic DPILIC        lic interpolation cell refinement (default: DEFAULTS['dpilic'])

CLI-only options:
  -input INPUT, -i INPUT
                        specify a configuration file.
  -isolated             ignore any existing 'nonos.toml' file.
  -d, -display          open a graphic window with the plot (only works with a
                        single image)
  -version, --version   show raw version number and exit
  -logo                 show Nonos logo with version number, and exit.
  -config               show configuration and exit.
  -v, -verbose, --verbose
                        increase output verbosity (-v: info, -vv: debug).

Using a configuration file

The CLI will read parameters from a local file named nonos.toml if it exists, or any other name specified using the -i/-input parameter. To ignore any existing nonos.toml file, use the -isolated flag.

One way to configure nonos is to use

$ nonos -config

which prints the current configuration to stdout. You can then redirect it to get a working configuration file as

$ nonos -config > nonos.toml

This method can also be used to store a complete configuration file from command line arguments:

$ nonos -ncpu 8 -cmap viridis -rz -diff -vmin=-10 -vmax=+100 -config

As of Nonos 0.2.0, this will print

# Generated with nonos 0.2.0
datadir               =  "."
field                 =  "RHO"
dimensionality        =  2
on                    =  "unset"
diff                  =  true
log                   =  false
vmin                  =  -10.0
vmax                  =  100.0
rz                    =  true
noaverage             =  false
streamtype            =  "unset"
rminStream            =  0.7
rmaxStream            =  1.3
nstreamlines          =  50
progressBar           =  false
grid                  =  false
geometry              =  "cartesian"
isPlanet              =  false
corotate              =  false
ncpu                  =  8
fontsize              =  11
cmap                  =  "viridis"
dpi                   =  200

2. Programmatic usage

We are still working on nonos' api.

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.4.0.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

nonos-0.4.0-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonos-0.4.0.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for nonos-0.4.0.tar.gz
Algorithm Hash digest
SHA256 794b399a471e3075e825ccca88dbb71647610a941893159d874f6bbbfd5ce5f8
MD5 b61202cb781180a56ced2c0a6cc198da
BLAKE2b-256 95f7034737f20e2ecbe087f3c4266037d5c2c48bb56eca8537691d56c5cbc2a8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonos-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for nonos-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b80095931f04f0f228f0d396e34894c95e7a321661f27bf0fab6c1105268903
MD5 4d1d56d29aeed3fbd9b8e740a3735f33
BLAKE2b-256 720e490712dd796b8b9c3d8952605a969a8d331d47ebbafdbf7b8773f191b032

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