This is a guest post by Dr. Stefano Meschiari, a W. J. McDonald Postdoctoral Fellow at the University of Texas at Austin. His research focuses on planet formation, exoplanet detection, and all-around software development for fun and outreach.
Outreach has become an essential part of our job as astronomers. A considerable portion of astronomy outreach is carried out online, where it can reach a global audience and get students, teachers and the general public excited about our research. Over the past few years, online outreach efforts have grown into full-fledged and engaging apps. These apps let enthusiasts and amateurs understand, and even participate in, the process of scientific discovery. As an added bonus, web apps generally work on smartphones and tablets with only minor tweaks, further expanding their reach.
Examples of successful citizen science projects abound, most famously the Zooniverse family of web apps (my personal favorite being Planet Hunters). My personal contribution to this movement has been the development of Systemic, an open-source application devoted to the analysis of exoplanetary data. I then worked on converting my scientific code into a web app, Systemic Live; Systemic Live is now used at several universities as a “virtual lab” for students. Most recently, I created a gravity game, Super Planet Crash, a proof-of-concept edutainment app to entice players into learning more about exoplanets and gravity. It has been played more than 9,000,000 times.
Thanks to the recent renaissance of Web technologies, it is now easier than ever for the average astronomer to condense their research and scientific code into small, yet interesting web apps. Various libraries and frameworks can do a lot of the grunt work, papering over some of the idiosyncrasies of web development and accelerating the time it takes to go from idea to finished app. At the same time, much of this technology is still young. In fact, there is arguably a “Cambrian Explosion” of web development tools, with new projects constantly being announced and superseded.
The state of web development tools is not yet at the “Just Add Science” level — some assembly is required. Below, I have collected a list of links to web development tools for the busy astronomer.
The Basic Tools
Initializr can be used to create the boilerplate to get your project started. You can use the “Bootstrap” configuration and download a .zip archive that will contain a skeleton structure and a few libraries for your project. Other libraries (such as Underscore.js, or the plotting libraries below) can either be downloaded and installed inside the project structure, or linked from your web page using a service that will host the files (e.g. cdnjs).
Editing and Running Your Files
There are several incredible libraries for creating cool visualizations and plots inside a web browser. The most famous may be D3.js, which can create really stunning pages, but has a substantial learning curve. For more mundane plotting needs, I found Highcharts to be a great turn-key library for plotting (especially for simple line/scatter/histogram charts). Their demo page has some helpful example plots.
Animations can offer a more accessible and visual experience than plots to the layperson. For simple animations, Paper.js offers a very simple interface, substantially easier to use than other alternatives. I used Paper.js to animate the orbits in Super Planet Crash.
Running Your Scientific Code on the Browser
I used Emscripten to convert the Systemic code (part of a regular application) into code that was folded into Systemic Live (a web app). The process can be as easy as adding a new entry in your project’s Makefile.
In this post, I attempted to assemble an opinionated list of links to useful tools that will get you up and running with your first interactive web app. AstroBetter users, are you interested in creating online outreach projects? What tools would you use? What astronomy concept would you like to see explained in a web app?