Visualizations for EGU conference work on carbon tracking
These visualizations were developed for EGU 2021 conference work on carbon tracking in Hector (PNNL's simple climate model) and general debugging of Hector's carbon tracking.
Here are the different visualizations you can make using this code with examples of the output.
You will need to have the file path of the Hector output CSV that you want to run. This will only work on the Hector tracking output CSVs, which have names like: "tracking_rcp85.csv". You also need to give the string name of the RCP run on Hector (e.g. "RCP 8.5") so this can be used in making the plot titles.
There are two types of visualizations that are made by running TrackingVisuals.R. The first is stacked area charts for the atmosphere, soil, vegetation, detritus, ocean, and top of the ocean (i.e. the new carbon added over the course of the run). Here is an example of the stacked area plot for atmosphere:
The second type of plot you get from running TrackingVisuals.R is the total size of the atmopshere, soil, vegetation, and detritus carbon pools. This is standard Hector output and meant to be compared to the stacked area plots. Here is the graph:
This requires the filepath of the Hector output CSV that you want to run. This will only work on the Hector tracking output CSVs, which have names like: "tracking_rcp85.csv". You also need to provide the year that you want the treemap generated for.
This script creates treemaps for the atmosphere, soil, vegetation, and ocean pools for a given year. Here is what the atmosphere treemap looks like in year 2100:
The treemaps turn out quite large on the R plots screen so you may need to click on the 'Zoom' to see them at actual size with correct proportions to the legend.
In order to make this animation, there are considerably more inputs. First, like all of the other visualization scripts, it requires the filepath of the Hector output tracking CSV. It then additionally needs the type of the pool you want to create the visualization for, which is a string. The options are: "Atmosphere", "Soil", "Vegetation", and "Ocean". It also needs the string name of the RCP to create the appropriate title for the animation (e.g. "RCP 8.5"). Also, you need the year you want the animation to start in, as well as the width and height of the animation. A word of warning that the timing of these gifs is tricky to work out. The animated the pie charts require two frames per year while the line charts seem to fit their runtime to the number of frames requested. The timing works when we start at 1850, but other starting times have not been tested extensivley.
Here we have a gif that shows the size of the atmosphere pool and its composition over time.
This only needs a filepath of the Hector output tracking CSV.
This visual is used for debugging in the tracking design process, not for pretty visualizations. It shows the difference between the pools sizes after all fluxes are applied versus what Hector's ODE solver calcualtes as the size of the fluxes every timestep. This gives us an idea of how completly the fluxes we currently have implemented account for the change calculated by the solver for those same fluxes. Here is an example output from one point in the design process. As we can see some of the pools have values larger than those calculated by the ODE solver (like soil and atmosphere) and some have values smaller (like detritus).
This is not a visualization script, but rather a script that cleans the input CSVs to give them appropriate string names for printing in legends (e.g. "Atmsophere" instead of "atmos_c"). It also takes out the Diff variables (used above in TrackingDiffs.R).