Analyzing ELM Output in Jupyter Lab (AK K64G Example) - FASSt-simulation/fasst_simulation_tools Wiki

HOW TO run Docker/container of Jupyter NoteBook for Visualizing ELM Output - AK-K64G example

NOTE:

(1) assuming you've already installed Docker and its Desktop App.

(2) assuming you've already run ELM docker for ngee site, 'kougarok', with SITE-CODE of 'AK-K64G'. Such as following instructions in AK K64G Demo Quick Start Guide

AND, The outputs are in docker volume named elmoutput. NOTE: you can name whatever volume you'd like.

STEP 1. Download Docker image of 'fasst_simulation_tools'

Open terminal, and type the following:

docker pull fasstsimulation/fasst_simulation_tools:elmlab_3.3.2

STEP 2. Open Docker Desktop, if installed, and create a Volume for a work directory to save your results.

Suppose that had already run ELM, and saved all outputs in a docker Volume on disk, named elmoutput, like:

Click to open 'elmoutput', and then click UPPER/LEFT Tab DATA, under which ELM output directories will show like following, if unfolded:

NOTE: the slightly-whiten file ELM_output.nc is that merged all outputs,and will be for visualizing.

NOW, click the most LEFT/UPPERVolumes to back to Volumes panel, and click its UPPER/RIGHT button Create+ to create a new volume, named as 'elmwork', which will be used to store your analysis results.

AND, you then should see the following:

STEP 3. Launch/run docker 'fasst_simuation_tools'

In Terminal, type the following command:

docker run -t -i -v elmoutput:/home/jovyan/output/ -v elmwork:/home/jovyan/work/ -p 8888:8888 fasstsimulation/fasst_simulation_tools:fasst_jupyterlab_3.3.2

if successful, the following message will show in your terminal window,

**AS hinted, do one of 3 methods, to lanuch jupyter notebook, in YOUR internet browser. The following will be showing, maybe slightly different in yours. AND thereforward you're going to do visiualization in this browser windows.

STEP 4 - Example A. Make 2 example Figures of publish-quality from ELM outputs.

(1) click-open the script file, run_plot_KG64_ELM_output.ipynb, it shall be showing:

Screen Shot 2022-08-15 at 11 39 07 AM

NOTE: in the above screen-shot, there are 4 click-buttons highlighted in a yellow circle. Those 4 buttons are for running jupyter notebook scripts - if your mouse pointer hover on each one, it will show what would happen when click.

(2) For an example, if click that fast-forward-like button, it will run script in all-steps (blocks of scripts indiced in [], called cells in ipynb) at once.

Screen Shot 2022-08-15 at 11 53 00 AM

And after successfully running script, it will show like following in this example.

Screen Shot 2022-08-15 at 12 07 35 PM

NOTE: You can check if there are 2 images of Figures generated from this script, in Docker Desktop App's VolELM_work directory, AND save them to your local file system if want to.

STEP 4 - Example B. User-interactively visualize ELM variable.

(1) click-open the script file, plot_ELM_variable.ipynb, it shall be showing:

Screen Shot 2022-08-15 at 3 37 37 PM

(2) For an example, if click that fast-forward-like button, it will run script in all-steps at once, and will plot **GPP** by default.

Screen Shot 2022-08-15 at 3 43 31 PM

(3) Interactively choose a variable from a dropdown box.

Scrolling up to move your mouse pointer to cell [4], like Screen Shot 2022-08-15 at 3 36 38 PM

By clicking the dropdown arrow, it will show whole list of variables from ELM outputs, and Choose one, such as TSOI, the soil layered temperature, Screen Shot 2022-08-15 at 3 53 06 PM

AND, then Clicking one-step advance button, image in the upper bar, until end of script, it will plot like following:

Screen Shot 2022-08-15 at 3 58 03 PM

Customizing by editing

 - ```variable_name_user=```, if already known a variable name (i.e. not from the above dropdown list)

 - ```variable_unit```, if don't use that from output, and you know. Usually that from output not known.

 - ```variable_muliplier=',   anything but 1 for better plotting by scaling data

 - ```yr_start=',  year starting to plot (greater than min. year in the output)

 - ```yr_end=', year ending to plot (less than max. year in the output)