To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 247e553a authored by Xuqian Yan's avatar Xuqian Yan
Browse files

Added contents for visualization

parent 36edbfa0
......@@ -12,4 +12,5 @@ An integrated energy systems modelling platform | `nexus-e.org <http://nexus-e.o
nexuse_repo_instruction.md
modify_input_data.md
connect_new_module.md
visualization_tool.md
faq.md
\ No newline at end of file
### **Results visualization**
The simulation results from Nexus-e can be interactively viewed through a visualization tool (also called the "**webviewer**"), developed with [Python Dash](https://dash.plotly.com/).
- Repository for the tool: <https://gitlab.ethz.ch/nexus-e/nexus-homepage-dash.git>
- A frontend example: <https://nexus-e.org/results-flexibility-providers/>
This documentation only introduces the general workflow of developing the visualization tool. Detailed instructions can be found in the `README.md` files in the associated repositories.
The visualization of the simulation results is achieved in the workflow shown in the figure. The key processes will be explained in the sub-sections below.
![](images/visualization-workflow.png)
#### Postprocess
After a simulation finishes, selected results are **postprocessed** and uploaded to the output database. This postprocess procedure is carried out in the following two ways. The two ways are designed for different purposes and both are needed.
1. **Embedded** in the `run_Nexuse.m` script
- **Purpose**: Automatically process the results when finishing a simulation, so that the reseacher could promtly see the results of this simulation from the webviewer.
- **How it work**: After the simulation finishes, `run_Nexuse.m` calls the MATLAB script `Shared/resultPostProcess/postProcess.m`. This scripts calls other MATLAB/Python scripts to postprocess the results.
2. **Stand-alone**
- **Purpose**: Batch-process multiple simulations, fine-tune/modify/test the post-process scripts. This stand-alone process provides the final data to the webviewer.
- **How it works**: Run the `postProcess` bash script locally. This bash script loops over multiple simulations and takes configurations (e.g., which simulations to loop through and scenario names for each simulation) from the `Shared/resultPostProcess/postProcess.conf` file.
#### Output database
In the output database (host: itet-psl-s02, port: 3307), each simulation's results is stored in one **schema** named with the simulation **submission date** and the **scenario name** (e.g., the `scenShortName` variable in `run_Nexuse.m`), which looks like "01-dec-2020_baseline".
The output database can be viewed with MySQL Workbench in the same way as introduced [here](setup.html#connect-with-the-input-database).
#### Retrieve & visualize data with a URL
After the postprocessed data has been uploaded to the output database, the data can be retrieved and visualized by **provideing a URL through the webviewer**. Three types of URL are accepted.
1. https://nexus-e.org/results/**JOB-SUBMISSION-DATE_SCENARIO_NAME**, e.g., https://nexus-e.org/results/01-dec-2020_baseline. This will retrieve and visualize only the data from the **exact** MySQL schema named as "JOB-SUBMISSION-DATE_SCENARIO_NAME".
2. https://nexus-e.org/results/**JOB-SUBMISSION-DATE**, e.g. https://nexus-e.org/results/01-dec-2020. This will retrieve and visualize the data from **all** the MySQL schemas whose name start with "JOB-SUBMISSION-DATE". In other words, results from all simulations submitted on the same day will be shown on the website.
3. https://nexus-e.org/results/**MANUALLY_DEFINED_URL**, e.g. https://nexus-e.org/results/project. This will retrieve and visualize the results from **all** simulations associated with the MANUALLY_DEFINED_URL. This is particularly useful if we run multiple scenarios for one project. The mapping of URL and simulations is specified in the `constants.py` in the [repository for the webviewer](https://gitlab.ethz.ch/nexus-e/nexus-homepage-dash).
#### Embed the webviewer into the homepage
The webviewer itself is plainly a Python Dash application without much Nexus-e branding. To change this, it is embedded into the homepage with [iframe](https://www.w3schools.com/html/html_iframe.asp) - a html element to display a nested webpage within another webpage. By doing so, we can easily have the same header, footer and menubar for the visualization tool as in other Nexus-e webpages.
The embedding can only be done by the administrators of the homepage. If you are an administrator, you could [login](https://nexus-e.org/login/) to the homepage and check the backend of [this page](https://nexus-e.org/results-flexibility-providers/) to learn how it is done.
\ No newline at end of file
This documentation is shown on <https://nexus-e.readthedocs.io/en/latest/>.
How to compile the whole documentation locally:
- install python 3.x
- create a virtual environment for better python package management. Here are example codes using conda:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment