ALFRESCO web GUI powered by R and Shiny
For those of you at or affiliated with SNAP, you are probably aware of our ALFRESCO software for modeling past, present, and projected wildfire behavior in Alaska as well as some of western Canada in the context of climate change. When calibrating the model, it can be necessary to run the model many times, and this can be a bit tedious. After ALFRESCO produces gigabytes of output, that data must be post-processed, analyzed, and interpreted, which is where I use R further. This too can be a bit tedious to do over and over from the Linux command line, nor is that approach accessible to everyone.
I put together a proof of concept web application using R and the
shiny package which allows a user to launch ALFRESCO simulations conveniently from their browser, and post-processing of the simulation results in R with additional scripts (in non-interactive mode of course) is piggybacked on top of this so everything happens sequentially once the entire process is launched from the browser.
For now the app is quite simple, only taking a handful of commands outlining various parameters for the modeling. Of course, ALFRESCO cannot be accessed directly from the world wide web so it is useless to share the app, as it would not do anything. I use it on servers which are private. But I have shared the screenshot above to give you an idea of the app, the convenience, the potential. It has saved me a good deal of time already, having used it to package up several chunks of my workflow.
In a later post I will share another app which is used to conveniently display the results of ALFRESCO simulations which have already been post-processed in R, allowing the user to plot the results in various ways and not be restricted to static outputs not of their choosing. In fact, the final task in the processing chain set in motion by this “launcher” Shiny app is to have the results from R saved to a “results” Shiny app which is created on the fly.
It’s actually not as complicated as it might sound. But in the end you have an app to easily launch a tedious, repetitive chain of processes, culminating in the generation of another app for easily examining the final results. An input and an output Shiny app. The processing can run for many hours, hence the choice not to bring results right back to the launcher app, but to create a results app upon completion and notify the user by email that their Shiny app exists on a web server for them somewhere.
For the more general, usual audience, I’ll also have a post on how I used R to map the varying intensity and peaks of the flames graphic I chose for my background image in order to produce what you see above. The original image file was only a picture of flames. The plot overlays were all plotted in R and a new file was created. Figuring out where to tell it to draw on the picture was quite fun!