Chrome developer tools + js2-mode and web-mode in Emacs
I’ll be blogging more about this topic in the short term, but here are a few things I’ve been looking at that people might find interesting:
Languages that convert to JavaScript: I find the constant context switching between the different programming languages I use for my work very annoying. I’ve used Emscripten for converting my C code into JavaScript to minimize the amount of code rewriting. I’m actively looking at languages that compile to JavaScript — the most famous is probably CoffeeScript, but I’m keeping an eye out for Kotlin. Kotlin is a budding language that primarily runs on the Java Virtual Machine (JVM), but can also be compiled to JS. Since I do use Java and the JVM ecosystem for a substantial amount of my code, it looks very promising. Now, if only there was a kotlin-mode for Emacs I’d be very happy 🙂
Three-dimensional visualizations: three.js looks cool but daunting. I’ve been trying to think of a small project to do using the isometric engine Obelisk.js — I’m just enamoured with things that look retro.
Cogito.org, a magazine for young students interested in science, published a short interview with me about how I came to be an astronomer, and why I developed Super Planet Crash. Read it here!
This week has been quite the ride. Super Planet Crash has been featured on io9, Huffington Post, space.com, Motherboard, and other online publications, and it “suffered” from repeated surges of traffic from imgur. Not bad for a game hacked together over the weekend! It overjoyed me to receive emails, and pictures!, by people enjoying the game, especially from the younger generation.
More than 2,000,000 games have been played as of today, and hopefully a fraction of those players will want to know more about exoplanets. I would also encourage everyone who enjoys this little free game to donate to science education funds, such as McDonald Observatory’s Science Education Fund. I would be oh so happy to have bragging rights due to planet crashers donating en masse!
I’m slowly trying to work through some of the feature requests. Not all are feasible on a short timescale (science is my full-time job, after all!), but I will strive to at least try to address the lowest-hanging fruit. One pet peeve shared by many was the inability to see the high-scoring games. In trying to address this, I discovered two bugs in the implementation of the high-scores.
The first is that the server relied too much on trusting the high-scores that were sent from the client (i.e. the Javascript running in the web-browser). Although I had tried to mitigate it somewhat, several fake high-scores were submitted. I added some stricter checks that should further help address the problem. The right solution would be to run the system on the server in order to check for any shenanigans. Unfortunately, this is unfeasible, as too many games are being played: it would place an unduly amount of stress on my server.
The second is a bug in the way systems were recorded and sent to the server. Some of the highest-scoring systems attempt to score high on masses, “crowdedness” (how close are the orbits of the bodies to each other) and habitability. They do that by (a) adding a binary companion (the “dwarf star”) and (b) putting a lot of planets in the same orbit within the habitable zone.
The resulting systems are likely highly chaotic, so any small error in recording the state of the system [ref]The state of the system being the current position and velocity of each body.[/ref] will change the outcome very quickly (the so-called “butterfly effect“). Unfortunately, one bug in Super Planet Crash resulted in this exact scenario happening. Any rounding or truncation of the floating point values for the coordinates will also affect the evolution of the system. The most common outcome is that these high-scoring systems will appear to be unstable when replayed. Grrr.
The decision I reached is to clean up the high-score table. The systems should now be recorded the correct way, and everyone will be able to see how the scores were achieved.
I understand this is sad news for the current record holders, so the screenshot at the top of this page will record the brave folks who reached upwards of 300,000,000 points for all posterity. (Just imagine someone unplugged the arcade machine by mistake…)
Next up on my agenda is releasing the game on GitHub. I am cleaning up the last few bits. If you are a programmer, you’ll be able to create pull requests for new features there.
In my next post, I will go into a bit more detail about how I created Super Planet Crash (and so can you!).
Super Planet Crash is a little game born out of some of my work on the online version of Systemic. It is a digital orrery, integrating the motion of massive bodies forward in time according to Newtonian gravity. It works on any recent web browser and modern tablets.
The main goal of the game is to make a planetary system of your own creation be stable (i.e. no planet is ejected, or collides with another body). This is of course exceedingly easy when your system comprises of a few Earth-mass planets, but dynamical instability can quickly set in when adding a lot of heavier bodies (from giant planets, all the way to stellar companions).
The challenge is then to fit as many massive bodies as possible inside 2 AUs (twice the distance between the Earth and the Sun), teetering close to instability but lasting at least 500 years. Accordingly, the game rewards a daring player with more points (proportionally to the mass of each body added to the system). A few simple rules are listed under the “Help” button.
The game always starts with an Earth-mass planet in a random location, but you can also have fun overloading known planetary systems! Clicking on the “Template” dropdown brings up a list of planetary systems to use as starting templates, including the compact system Kepler-11 and the super-eccentric planet HD80606 (more systems to come). You can even share your creations with your friends by copying the URL in the “Share” box.
The game is open-source, and still under active development. The entire code will be downloadable from GitHub (as soon as I get a bit of work done!).In the near future, I will be adding integration with Systemic Live, a longer list of template planetary systems and smartphone support. In the meantime, have fun crashing planets!
Credits
The game was made possible by the wonderful paper.js library, which let me quickly prototype the app despite having little experience in web gaming. The palette draws from the base16 color set.
Disk Detective is the newest Zooniverse citizen science project. Volunteers delve into more than 500,000 objects seen at different wavelengths, and help pick out potential circumstellar disks.
The idea is super cool, the bit of classifying I did was fun, and the website looks great. Outstanding job!
Erika Nesvold has a nice writeup of the project on Astrobites.
[A shorter-form version of this article I wrote has been published on The Conversation UK.]
Last week was a hot week for those interested in circumbinary planets and how they form. Firstly, Kostov et al. discovered Kepler-413b, another Neptune-size circumbinary planet; this one has some interesting dynamical considerations owing to its inclination. Secondly, Lines et al. published a new N-body simulation of the formation environment close to the Kepler-34 binary.
In this post, I will explain in layman’s terms how we think planet formation around binary stars works.
It is quite remarkable to remember that, until less than two decades ago, scientists had no concrete examples of planets orbiting other stars like the Sun. The Solar System was not only the archetype of planetary system, but the only planetary system astronomers knew of.
Since the discovery of a giant planet around the Sun-like star 51 Peg in 1995, the pace of discovery of exoplanets (planets orbiting other stars) has not slowed down. Quite the contrary: the trickle of planet discoveries became a steady stream in the 2000’s, as technology improved and astronomers became more efficient at homing in on stars likely to have planets orbiting them. In 2009, the Kepler space telescope was launched with the express goal of simultaneously surveying hundreds of thousands of stars for the presence of exoplanets.
The advent of Kepler transformed the steady stream into a veritable deluge of planets and planetary systems. Today, more than a thousand exoplanets are known, with thousands of planet candidates waiting for further verification and vetting. Although this quickly expanding “census” of exoplanets has injected new life to the field of planet formation (the study of how planets are born), it has also brought forth many new questions.
A big leap
Our best understanding of how planets form is inextricably linked with our understanding of how stars form. Many different lines of strong evidence point to planets forming inside a thin, gaseous disk surrounding nascent stars. Within this disk, solid particles (evocatively named “dust”) collide and progressively grow to asteroid-sized bodies. These bodies, called planetesimals, are the essential “bricks” of planet formation. Further collisions among planetesimals build protoplanets — rocky, Earth-sized bodies.
Farther out from the central star, water and other compounds “freeze out” and become part of the solid component. At and beyond this location (the “ice line”), protoplanets can grow even larger and amass thick, massive atmospheres. This sharp divide between small, Earth-sized planets close to the central star (Mercury through Mars) and massive giant planets further out (Jupiter through Neptune) is easily recognized in the Solar System, where the ice line is just inside Jupiter’s orbit.
For this theory to work, it demands an incredible feat: through collisions and gravity alone, it requires growth from microscopic dust particles more than a hundred times smaller than a grain of sand, all the way to Jupiter-sized objects. To put things into perspective, it is the same jump in size between a single atom and an average sized human! This is a very delicate process, involving many physical mechanisms, some of which are still poorly understood today.
Double trouble
One of the sticking points is the stage in which planetesimals collide. Planetesimals need to collide surprisingly gingerly in order to accrete; smash them too fast, and they will “break” into smaller rocks. Regions with high-speed collisions become essentially sterile for planet formation, as no further growth happens under normal circumstances.
This is why the recent discovery of circumbinary planets had astronomy theorists raise an eyebrow (or two). Circumbinary planets are planets that orbit a binary star. Such stars are bound together by gravity into an often-tight orbital dance. Kepler-16 ABb, the first circumbinary planet discovered in 2011 by the Kepler spacecraft, orbits both stars A and B (hence the AB monicker; the lowercase b simply means “the first planet discovered in the system”). The recent discovery of Kepler-413b by the team led by Veselin B. Kostov adds another member to the (so far) very exclusive circumbinary club: seven planets have been discovered orbiting binary stars, all giant planets with sizes between Neptune and Saturn.
That these planets, once the purview of sci-fi fare such as “Star Wars” or “Doctor Who”, were detected is alone quite a testament to the power of Kepler and its skilled team: astronomers had to meticulously analyze small variations in brightness of the two stars, caused both by mutual eclipses (each star passing in front of each other) and planetary eclipses (the planet passing in front of one star or the other).
Their very existence, however, is also a testament to the surprising resilience of planet formation. As mentioned before, our models indicate that planetesimals will be destroyed if their impact speeds are too high. But this should be exactly the case around binary stars! Binary stars should gravitationally perturb planetesimals, just like Jupiter perturbs asteroids and comets in the Solar System. These perturbations fling planetesimals into orbits that, when crossing other planetesimals’ orbits, assure high-speed impacts and mutual destruction. Only far away from the central binary, where perturbations are weaker, it is expected that collision speeds would become low enough to resume planetary building.
All things considered, this should be an easily overcome hurdle: as explained in the previous section, far enough from the central star (or stars) is where giant planets form — and all circumbinary planets found so far are giant planets! Is this a spectacular confirmation of theory?
Too close for comfort?
Not so fast, unfortunately: all circumbinary planets discovered so far are also orbiting very close to their parent binary. So close, in fact, that if they were any closer to the binary, their orbit would be destabilized to the point of ejection from the system or collision with one of the two stars. These planets are essentially flirting with disaster, their orbital velocity closely balancing the gravitational attraction of the binary in a dangerous tug of war. Inside their orbit, in the “instability region”, no planet could survive for long.
Reconciling these two apparently incompatible findings (giant planets in a location where they should have never formed) required invoking an old idea: that of planetary migration.
The very first planet discovered, 51 Peg b, was a giant planet orbiting its parent star at a very small distance — smaller than even Mercury. Such a planet could have never formed so close to the star, as the high temperatures would sublimate rocks and ices. Our theory would then predict that there would not be enough bricks (planetesimals) to build a giant planet. Theorists quickly understood what had occurred early on in this system’s history: 51 Peg likely formed further away from the star, and subsequently interacted with the disk in which it was born in such a way to be pushed further in. This process is called “migration”.
Migration could be at play with circumbinary planets as well. Computer models have shown that a giant planet formed far from the central binary will tend to migrate and move inwards. Encouragingly, the migrating planets do not move all the way to the instability region. Rather, they tend to stop at a specific distance, which matches well with their current location.
One last finding of computer models match another observed property of circumbinary planets. While we admittedly discovered only a handful of circumbinary planets, it is tantalizing that all of them are quite a bit smaller than Jupiter. It is surprising as the bigger a planet is, the easier it is to detect: therefore, we should have discovered a few Jupiter-sized circumbinary planets by now. Computer models explain this last piece of the puzzle: migrating Jupiter-sized circumbinary planets end up strongly interacting with the central binary and are subsequently flung out from the system. We would not observe such planets today simply because they did not survive their turbulent beginnings.
Although there are still many details to be worked out, this theoretical framework appears to be in good concordance with Kepler’s discoveries. However, it is possible, even expected, that further planetary discoveries might surprise us once more.
This post is the first in a series of Systemic Live tutorials. You can see all Systemic Live tutorials in this link.
In this post, I will show how to analyze the radial velocity dataset of the the planetary system that started it all, the original gangsta, 51 Peg. I will use the new web application Systemic Live, a simplified version of Systemic that runs in your browser.
51 Peg was announced in 1995 by a Swiss team led by Michel Mayor and Didier Queloz; it was later confirmed by an american team led by Geoff Marcy and Paul Butler at the Lick Observatory. It was the very first exoplanet found to orbit a Sun-like star. Mayor and Queloz’s discovery of the hot Jupiter orbiting 51 Peg was truly a watershed event: their Nature paper has racked up 1225 ADS citations! (These are citations from other astronomical papers.)
We will analyze this data, and follow the same procedure used to unearth the evidence for the first planet orbiting a Sun-like star.
Overview
Launch Systemic Live. Upon launch, you will see a window similar to the one below.[ref]If Systemic suggests your browser might be slow, we recommend to use the Google Chrome browser for maximum performance.[/ref] Click on the blue question mark icons to get help on the various panels in the application.
You can either do the rest of this tutorial by following the instructions, or clicking on Big Blue buttons like these to show the step in Systemic.
The SYSTEM drop down lets you choose which dataset to analyze. The dataset name is the name of the star that was observed to produce the radial velocity data (for example, 14Her.sys is the dataset for 14 Herculis). You can find more information about the star by scrolling to the ABOUT THIS STAR section.
Click on the SYSTEM drop down, type “51peg” to find the dataset for 51 Peg. Choose “51peg.sys”. The data will be loaded, like in the screenshot below. The RADIAL VELOCITY plot shows the radial velocity data: each point is a single measurement. Time is on the x-axis, measured as a Julian Date (a way to indicate time favored by astronomers). Radial velocity measurements, in meters per second, are on the y-axis. See in Systemic
One of the datasets was published by the California-Carnegie Planet Search Team (red points), the other by the Geneva Extrasolar Planet Survey (blue points). The Swiss data set gives a long baseline of coverage, whereas the California-Carnegie dataset contains intensive observations taken mostly over the course of a single observing season in 1996. You can move your mouse over the points to see human-readable dates instead of julian dates.
Scroll down to see the POWER SPECTRUM plot.
The POWER SPECTRUM plot shows which periodicities are present in the data. A prominent periodicity in this plot looks like a tall “peak”; a strong periodicity might be indicative of the presence of a planet orbiting a star at that period.
The peak at 4.23 days
In the case of 51 Peg, the power spectrum periodogram has an impressive tower of power at 4.231 days. This dataset contains a whopping-strong sinusoidal signal at that period! You can see a table of periodicities right under the plot. You can also “zoom in” and look at a more fine periodogram by changing the period interval. (Insert, for instance, 4 to 5 days as the interval and press Set; press Reset to return to the default interval). See in Systemic
Mousing over the power spectrum plot will show the “power” at a given period (the strength of the signal at that period) and also an estimate of the so-called “False Alarm Probability”, the probability that the signal might have arisen by chance (e.g. by an unlucky sequence of noise mimicking a sinusoid). In the case of the peak at 4.2306 days, the False Alarm Probability is astronomically low (10-168, an infinitesimally small probability). The periodicity is definitely there!
To work up the 51 Peg “b” planet, click on “Add planet”. This button will activate a table of orbital parameters: Period (the orbital period of the planet, in days), Mass (the mass of the planet, in Jupiter masses), Mean Anomaly (the phase of the planet at the time of the first measurement, in degrees), Eccentricity (the shape of the orbit) and Longitude of Periastron (the orientation of the orbit, in degrees). Type 4.2306 (the period of the strong peak) in the Period box. You should see something like the plot below. See in Systemic
Systemic plots the radial velocity curve due to the presence of planet(s) as a thick black curve; the better the curve matches the points, the better the model (also called a fit). However, in the case of 51 Peg b, the plot is distorted. The reason is that the observations cover more than 9 years, while the curve has a period of only 4 days: the sinusoid has too many peaks and troughs to plot! A reproachful yellow alert informs you of this limitation.
To get a better plot, switch to the PHASED RADIAL VELOCITY plot. This switches the top plot to a new view. In this new view, the radial velocity points are “folded” to the period of the planet: the data points are shifted to cover the entire period of the planet.
Much better!
Finding the planet parameters
You can now see the full sinusoidal signal caused by the presence of the planet (the thick black line). The sinusoidal shape of the data is also evident. To match the black line (the model) with the points (the data), you would only need to shift it and increase its amplitude. This is done by varying the Mean Anomaly and Mass parameters. To automatically snap to the best values, use the checkboxes next to it to select them and click the Optimize button. The Optimize button automatically cycles to values to find the “best-fit”, the parameters of the model that best match the observations.
The improvement of the fit is measured by the Chi-square value (found under the STATISTICS table). A good fit has a value of Chi-square close to 1. The value of Chi-square for this model is 2.12 – pretty good!
We can do even better. Check all the remaining parameters: the two offsets, Period, Eccentricity and Longitude of periastron. Then, click Optimize. The procedure will give a small improvement in Chi-square (from 2.12 to 2.01).
The final fit parameters for the planet give a period of 4.2308 days, a mass of about 0.5 Jupiter masses, and an eccentricity of 0.014, fully consistent with the original paper! This is what its orbit looks like: See in Systemic
Return to the POWER SPECTRUM plot one last time. The 4.23 days peak has been eliminated by the addition of the planet: the only strong period left is at about 359 days. See in Systemic
This residual peak is strong, though not quite as tall as the original one. Is it evidence for a second (“c”) planet? Not quite. The period of this peak is very close to the Earth’s orbital period (about 365.25 days). Turns out that certain periodicities, connected with the Earth’s and the Moon’s orbital period (among others), can show up in the data as artificial peaks. These spurious periodicities are related to gaps in the time coverage of the data and not due to the presence of exoplanets! From oklo.org’s post:
Aliases are a problem in Doppler surveys because observations are most efficiently done when the star is crossing the meridian, leading to a natural spacing of one sidereal day (23h 56m) between data points. Further periodicities in data-taking arise because RV survey time is usually granted during “bright” time when the Moon is up, and as a consequence of the yearly observing season for non-circumpolar stars. Aliases are minimized when observations are taken randomly, but the nuts and bolts of the celestial cycles impose regularity on the timestamps.
Saving and sharing a fit
You can save your fit by copying the current address (the URL) in your browser, or copying the content of the SHARING panel. It will look something like this:
You can copy and paste this address to your notes in order to save your work, or send it to other people to share your work.
Saving and printing plots
You can save or print each chart by clicking on the icon on the top-right corner:
What’s next?
Now that you have found your first planet with Systemic Live, take it for another spin with the star HD31253. HD31253 is another fish-in-a-barrel dataset for Systemic. It hosts a single planet — try to figure out its period and mass without looking them up!
Look out for the next installment, Trois Neptunes, in a future post. You can see all Systemic Live tutorials in this category.
[This post is an adaptation of the post “51 Pegged?” that originally ran on oklo.org on April 7th, 2006.]
Radial velocity plots can now be “phased” to a given planet. This greatly improves the visualization of radial velocity curves of planets with short period, or multiple planet systems.
You can now run dynamical integrations right in your browser! See how the semi-major axes and eccentricities of a planetary system change with time, and check whether a planetary system is unstable.
You can zoom in the power spectrum; as you zoom in, the periods in the chosen range will be sampled more finely for increased precision. Underneath the plot, a list of strong peaks show the most likely candidate periodicities.
A new “About this star” panel shows some basic information about the selected star (in the future, this will also link to exoplanets.org and similar websites).
The core has been updated with the most recent version of the Systemic2 code, for improved speed and stability.
Enjoy! I will be posting tutorials showing how to find exoplanets using Systemic Live in the next few days.
Celestia is a stunning program for visualizing 3D objects in space, in real-time. It has a large database of astronomical objects (stars, planets, moons, minor bodies, etc.) that are rendered realistically and are positioned accurately in space and time.
One thing I discovered recently is that Celestia is also eminently programmable. What I mean is that, instead of manually zooming, flying-by and orbiting objects, Celestia can run scripts that execute complex macros. These scripts let you create engaging visualizations — either interactively initiated, or recorded into a video. Panning, zooming, orbiting, accelerating and flying through space with a cinematic flair, which makes for great outreach presentations. The scripting language itself is a fully-featured language (Lua, one of my favorite languages!), so math, looping constructs, data structures are all available.
I am using Celestia to prepare a short talk about how the discovery of exoplanets revolutionized planetary science, and shook a lot of the assumptions that were rooted in centuries of observing our Solar System.
Above is the (draft) first slide of the talk. Each planetary slice is a screenshot from Celestia, using one of the planetary objects that will be touched during the talk. The composition of the slide was inspired by a recent posting on Reddit — a beautiful painting of the planets of the Solar System (I would have died of happiness if I got this painting when I was little!)
Another great feature of Celestia is that every single object is defined within a text file (with references to 3D models, textures, etc.) that are easily modifiable and extendable; a bundle of files placed in Celestia’s extras/ folder is loaded at startup, and the astronomical objects come to life.
This spawned another amazing resource for people doing astronomy outreach, the Celestia Motherlode. The Celestia Motherlode is an extensive repository of mods, textures and objects (even fictional ones!) that are freely downloadable. Some are high-resolution textures of the Solar System planets; others are exoplanetary systems that have been discovered since the discovery of Celestia; others still are beautiful renderings of hypothetical systems.
For my talk, I made several videos. Among them, these will be the background as I explain the basics of planet formation.
A zoom into the inner parts of a protoplanetary disk reveals planetesimals and embryos embedded in it…
(Please attribute this website if you’d like to reuse them!). These shots were accomplished using scripts and custom textures and models from Motherlode (this add-on which I heavily modified, and this model for the impacted protoplanet).
Since I found Celestia such an useful, little-know tool, I decided to write a series of blog posts on how to use its scripting facilities and create custom planetary systems. Hopefully they will be useful to fellow astronomers!
In the next post in this blog series, I will show how to create this simple animation that shows the orbits of the planets in the Solar System, and then rotates the view to show that the Solar System is rather flat (planet sizes not to scale, of course!):