From 88b02d6eb5bec88bc38285f28ad0512ae8e25516 Mon Sep 17 00:00:00 2001 From: Loic Huder <loic.huder@univ-grenoble-alpes.fr> Date: Mon, 1 Apr 2019 15:52:03 +0200 Subject: [PATCH] Updated README.md --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d6e1b5d..9fbd900 100644 --- a/README.md +++ b/README.md @@ -35,31 +35,33 @@ python3 setup install [--user] ``` 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__)" ``` This command should return the installed version. ## 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 python3 webgeodyn/example.py ``` -or in python console: +or in the Python console: ```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 -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. - Then, the server must be started with the loaded `Models`. -The steps are given in details below: +This is shown in details below: ```python # 0.Import the necessary submodules @@ -73,7 +75,7 @@ models = webgeodyn.models.Models() # 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') # 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 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. 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 - `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 import webgeodyn.inout print(webgeodyn.inout._formats) @@ -101,7 +103,7 @@ If [Sphinx](http://www.sphinx-doc.org/) is installed and the files were cloned f ```bash 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 The work is licensed under the [GNU GPLv3](./LICENSE.txt). -- GitLab