Skip to main content

A web-based plot tool to visualize Earth core flows

Project description

https://gricad-gitlab.univ-grenoble-alpes.fr/Geodynamo/webgeodyn/badges/master/build.svg https://img.shields.io/website/https/geodynamo.gricad-pages.univ-grenoble-alpes.fr/webgeodyn/index.html.svg?label=documentation&up_color=cyan https://img.shields.io/pypi/v/webgeodyn.svg

webgeodyn is a web-based plot tool to visualize Earth core flows and scalar fields at the Core Mantle Boundary (CMB). It consists in a Tornado web server, that can be started locally, that provides a set of visualisation tools on a variety of data formats.

Installation

Requirements

The installation of webgeodyn requires Python 3 to be installed.

The other dependencies will be automatically installed by the next step but are listed here for the sake of completeness:

  • numpy

  • scipy (version > 1.1)

  • h5py

  • tornado

Installing the package

webgeodyn can be installed

  • from pip:

pip3 install webgeodyn [--user]

Put the --user flag if you are not installing in a virtual environment.

  • from the git repository :

Clone first the webgeodyn repository

git clone https://gricad-gitlab.univ-grenoble-alpes.fr/Geodynamo/webgeodyn

Then install the package:

cd webgeodyn
python3 setup install [--user]

Again, put the --user flag if needed.

Whatever the method used, you can test if the install succeed by importing webgeodyn in Python3:

python3 -c "import webgeodyn; print(webgeodyn.__version__)"

This command should return the installed version.

Running the example

You can give a first try at starting the web server by running the example:

python3 webgeodyn/example.py

or in the Python console:

>>> import webgeodyn.example
>>> webgeodyn.example.run()

This starts the server locally and should open your browser and display a page resembling the one at https://geodyn.univ-grenoble-alpes.fr/. If not, try to type http://localhost:8080 in your browser.

You can try the different visualisations tools provided on the loaded example model (CHAOS-6).

Note that this example will also try to load the result from the latest pygeodyn (geomagnetic data assimilation Python package also developed in our group) computation (if present in ~/pygeodyn_results/Current_computation/).

Running the server with your data

The server can be used to visualise any data of supported format. For that, it is necessary to follow the template of example.py:

  • First, load the data under the form of Model objects, of a given name and format, in a Models dictionary.

  • Then, the server must be started with the loaded Models.

This is shown in details below:

# 0.Import the necessary submodules
import webgeodyn.server
import webgeodyn.models

# 1.Initialising the Models dictionary
models = webgeodyn.models.Models()

# 2.Loading your data in the Models dictionary
# Syntax: models.loadModel('/path/to/the/model/directory', "Name of the model", "Format of the model")
# Example for pygeodyn:
models.loadModel('pygeodyn_results/Current_computation', 'Current pygeodyn computation', 'pygeodyn_hdf5')
# Several models can be loaded at once. Example for CHAOS:
models.loadModel('webgeodyn/webgeodyn/example_data/CHAOS-6-x4', 'CHAOS-6-x4 model', 'CHAOS')

# 3.Start the server with the loaded Models
webgeodyn.server.startServer(models)

By copying this code in a Python file of your own, you should be able to use the visualisation tools on data of supported formats.

The format of the models, that define the format of the files to read, are the modules of webgeodyn.inout. Here are a few:

  • pygeodyn_hdf5: to read HDF5 files generated by pygeodyn

  • chaos: to read CHAOS splines files

  • covobs: to read COVOBS realisations files

A list of the formats can be displayed by running:

>>> import webgeodyn.inout
>>> print(webgeodyn.inout._formats)

If you need the support of a new format of file, you can follow the templates given in the documentation of webgeodyn.inout to implement your own loading function. Otherwise, you can contact us using the information given below.

Developer documentation

Documentation of the submodules of the package are available on line.

If Sphinx is installed and the files were cloned from the repository, it is possible to generate the documentation locally using:

cd doc && ./make_all_doc.sh

The documentation will then be available in HTML format for both Python and JavaScript at doc/html/index.html.

Conditions of use

The work is licensed under the GNU GPLv3.

Git repository

The source code is stored on a Git repository (https://gricad-gitlab.univ-grenoble-alpes.fr/Geodynamo/webgeodyn) which can also be used to give feedbacks through Issues.

Contact information

For scientific inquiries, contact Nicolas Gillet. For technical problems, contact Loïc Huder or Franck Thollard.

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

webgeodyn-0.9.2.tar.gz (10.0 MB view details)

Uploaded Source

Built Distribution

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

webgeodyn-0.9.2-py3-none-any.whl (10.3 MB view details)

Uploaded Python 3

File details

Details for the file webgeodyn-0.9.2.tar.gz.

File metadata

  • Download URL: webgeodyn-0.9.2.tar.gz
  • Upload date:
  • Size: 10.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for webgeodyn-0.9.2.tar.gz
Algorithm Hash digest
SHA256 698403a0e045af0f1ba8bf03b72704799ab530791aad6536e0e3c33e52efa20c
MD5 e7366c90e88db95ef3acd3c3540e046b
BLAKE2b-256 5419c2b1ab3442a61e0f15d63b03e5724ac35de2adb0dae05748787d5a25f0bb

See more details on using hashes here.

File details

Details for the file webgeodyn-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: webgeodyn-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for webgeodyn-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d97a6008ad763a793c72ceb519c28026197a505b6da3cc71ff39a5b3b3f7b7c0
MD5 46a00c4f88642ab53c5f41cba4cef69f
BLAKE2b-256 28d4157153cbc49d246cb7c1373124e916564b074da3bf4b33bd87976c30da4a

See more details on using hashes here.

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