Skip to content
Snippets Groups Projects
Commit 88b02d6e authored by Loic Huder's avatar Loic Huder
Browse files

Updated README.md

parent e699840c
No related branches found
No related tags found
No related merge requests found
...@@ -35,31 +35,33 @@ python3 setup install [--user] ...@@ -35,31 +35,33 @@ python3 setup install [--user]
``` ```
Again, put the `--user` if needed. Again, put the `--user` if needed.
Whatever the method used, you can test if the install succeed by importing webgeodyn in python3: Whatever the method used, you can test if the install succeed by importing webgeodyn in Python3:
``` ```
python3 -c "import webgeodyn; print(webgeodyn.__version__)" python3 -c "import webgeodyn; print(webgeodyn.__version__)"
``` ```
This command should return the installed version. This command should return the installed version.
## Running the example ## Running the example
You can give a first try at starting the web server by running the webgeodyn.example: You can give a first try at starting the web server by running the example:
```sh ```sh
python3 webgeodyn/example.py python3 webgeodyn/example.py
``` ```
or in python console: or in the Python console:
```python ```python
import webgeodyn.example >>> import webgeodyn.example
``` ```
This starts the server locally and should open your browser and display a page ressembling the one at https://geodyn.univ-grenoble-alpes.fr/. You can try the different visualisations tools provided on the loaded example model ([CHAOS-6](http://www.space.dtu.dk/english/Research/Scientific_data_and_models/Magnetic_Field_Models)). This starts the server locally and should open your browser and display a page ressembling the one at https://geodyn.univ-grenoble-alpes.fr/. If not, try to type `http://localhost:8080` in your browser.
Note that this example will also try to load the result from the latest `pygeodyn` computation if needed. You can try the different visualisations tools provided on the loaded example model ([CHAOS-6](http://www.space.dtu.dk/english/Research/Scientific_data_and_models/Magnetic_Field_Models)).
Note that this example will also try to load the result from the latest `pygeodyn` computation (if present in `~/pygeodyn_results/Current_computation/`).
## Running the server with your data ## Running the server with your data
The server can be used to load data under a supported format for visualisation. For that, it is necessary to follow the template of `example.py`: 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. - 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`. - Then, the server must be started with the loaded `Models`.
The steps are given in details below: This is shown in details below:
```python ```python
# 0.Import the necessary submodules # 0.Import the necessary submodules
...@@ -73,7 +75,7 @@ models = webgeodyn.models.Models() ...@@ -73,7 +75,7 @@ models = webgeodyn.models.Models()
# Syntax: models.loadModel('/path/to/the/model/directory', "Name of the model", "Format of the model") # Syntax: models.loadModel('/path/to/the/model/directory', "Name of the model", "Format of the model")
models.loadModel('pygeodyn_results/Current_computation', 'Current pygeodyn computation', 'pygeodyn_hdf5') models.loadModel('pygeodyn_results/Current_computation', 'Current pygeodyn computation', 'pygeodyn_hdf5')
# Several models can be loaded. Example for CHAOS # Several models can be loaded. Example for CHAOS
models.loadModel('webgeodyn/example_data/CHAOS-6-x4', 'CHAOS-6-x4 model', 'CHAOS') models.loadModel('webgeodyn/webgeodyn/example_data/CHAOS-6-x4', 'CHAOS-6-x4 model', 'CHAOS')
# 3.Start the server with the loaded Models # 3.Start the server with the loaded Models
webgeodyn.server.startServer(models) webgeodyn.server.startServer(models)
...@@ -81,11 +83,11 @@ webgeodyn.server.startServer(models) ...@@ -81,11 +83,11 @@ 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. 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: 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 - `pygeodyn_hdf5`: to read HDF5 files generated by [pygeodyn](https://gricad-gitlab.univ-grenoble-alpes.fr/Geodynamo/pygeodyn)
- `chaos`: to read [CHAOS](http://www.space.dtu.dk/english/Research/Scientific_data_and_models/Magnetic_Field_Models) splines files - `chaos`: to read [CHAOS](http://www.space.dtu.dk/english/Research/Scientific_data_and_models/Magnetic_Field_Models) splines files
- `covobs`: to read [COVOBS](http://www.space.dtu.dk/english/Research/Scientific_data_and_models/Magnetic_Field_Models) realisations files - `covobs`: to read [COVOBS](http://www.space.dtu.dk/english/Research/Scientific_data_and_models/Magnetic_Field_Models) realisations files
A list of the formats can be displayed by: A list of the formats can be displayed by running:
```python ```python
import webgeodyn.inout import webgeodyn.inout
print(webgeodyn.inout._formats) print(webgeodyn.inout._formats)
...@@ -101,7 +103,7 @@ If [Sphinx](http://www.sphinx-doc.org/) is installed and the files were cloned f ...@@ -101,7 +103,7 @@ If [Sphinx](http://www.sphinx-doc.org/) is installed and the files were cloned f
```bash ```bash
cd doc && ./make_all_doc.sh cd doc && ./make_all_doc.sh
``` ```
The doc will then be available in HTML format for both Python and JavaScript at doc/html/index.html. The documentation will then be available in HTML format for both Python and JavaScript at doc/html/index.html.
## Conditions of use ## Conditions of use
The work is licensed under the [GNU GPLv3](./LICENSE.txt). The work is licensed under the [GNU GPLv3](./LICENSE.txt).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment