2017 eclipse

# 2017 Eclipse Track Demo

This Cesium app uses [NASA data](http://eclipse.gsfc.nasa.gov/SEpath/SEpath2001/SE2017Aug21Tpath.html) to render the track of the great [North American Total Solar Eclipse of 2017](http://eclipse.gsfc.nasa.gov/SEgoogle/SEgoogle2001/SE2017Aug21Tgoogle.html).

![Screenshot of the 2017 Eclipse Track Demo](http://i.imgur.com/F7EJeya.jpg)

## Composition

Eager to build something functional I built this with two files - an HTML and a JS file - right in the the Apps directory of my forked Cesium repository, patterned off of the Hello World example.

The vast majority of the display logic for this app is bundled in `Apps/2017Eclipse.js`.

## Data import

As this is a data-driven demo I needed coordinates for the eclipse track itself. An excellent data set is available from [NASA](http://eclipse.gsfc.nasa.gov/SEpath/SEpath2001/SE2017Aug21Tpath.html) but it's not formatted particularly cleanly.

For the sake of getting a working proof of concept, and given that the data set is relatively small and poorly formatted from the source, I hand edited it down to a CSV formatted string with only times and coordinates for the three components of the eclipse track (north limit, south limit, and central line). I then built a small parsing routine to convert the data into a useful dataset contained in the `eclipseTracks` object.

## Next steps

### Cleaner data import

Initially I was able to produce a proof-of-concept CZML document that handled the clock drew polylines. However, upon realizing I would need to format the data set for proper import into a CZML file I reverted back to doing it with JavaScript strings to start. Admittedly this is a dirtier way to do it, but I wanted to get a good feel for the Cesium API in native JavaScript *before* diving full bore into CZML.

### Animated moon shadow

Having the clock constrain to the time of the eclipse event is only useful with some animation. I've begun reading documentation regarding how I might animate a shadow running through the eclipse track. While the original data set from NASA does provide a track width value at each time interval, facilitating rendering an ellipse at each interval in the right spot at the right size, an accurate representation would also show the eccentricity of the shadow's ellipse as the phase angle changes (i.e. at the end of the tracks the shadow is stretched out, at the center of the track it's essentially circular.

### Deployment

With a working demo now ready to go I plan to get this deployed somewhere on a personal server. Maybe I could find a place for it on [squiggle.city](http://squiggle.city/~frencil/).

### Additional information

The whole point of this app is to provide information about the biggest celestial event of the decade (for North America, that is). Once deployed I'd like to incorporate some text and other information for anyone who wants to use the app to learn more about the eclipse. Links to some choice third parties would be goo to, such as [EclipseMaps.com](http://www.eclipse-maps.com/Eclipse-Maps/Welcome.html), [NASA](http://eclipse.gsfc.nasa.gov/SEgoogle/SEgoogle2001/SE2017Aug21Tgoogle.html), and info about solar eclipse viewing glasses and/or solar filters for telescopes.