Eat your greens!

Actually, I am a rocket scientist
Home » astronomy » Searching the sky with YQL Execute

Searching the sky with YQL Execute

Posted in astronomy, geekage, yql

I was fortunate enough to win one of the prizes at Open Hack London this weekend. I ported the javascript from my astronomy photo browser to YQL Execute, creating a new open data table which returns celestial coordinates for astrotagged flickr photos. Essentially, my hack extends the flickr API to, hopefully, enable location-based searching in the sky.

Since I only wrote my hack in about an hour, during breakfast on Sunday, I returned to it this evening and finished it off. I’ve defined an open data table at http://eatyourgreens.org.uk/yql/flickr.photos.astro.xml which returns all machine tag info in the astro: namespace for the 50 most recently tagged photos. For convenience, it also returns the photo owner, title, url and root url for thumbnail images.

There is a demo, where you can try searching based on Right Ascension and Declination (both expressed in degrees). Please try it out and leave feedback in the comments here.

Demo URL: http://eatyourgreens.org.uk/testapps/yql/locationsearch.html

Example queries

The Carina Nebula

        select * from flickr.photos.astro
        where ra > 155 and ra < 165
        and dec > -65 and dec < -55

The Orion Nebula and surroundings

        select * from flickr.photos.astro
        where ra > 70 and ra < 100
        and dec > -20 and dec < 10

Get lots of photos of Orion (may be slow)

        select * from flickr.photos.astro(0,200)
        where ra > 70 and ra < 100
        and dec > -20 and dec < 10

Find nebulae from the New General Catalogue (names beginning NGC)

      select * from flickr.photos.astro
      where name like 'NGC%'

Find nebulae from the Messier catalogue (names beginning with M )

     select id, title, url, imgroot, username, ra, dec, fov, orientation, name
      from flickr.photos.astro(40)
      where name like 'M %'

Find all photos of the Rosette nebula

      select * from flickr.photos.astro(0,200)
        where name = 'Rosette nebula'

Explicitly declare all the table columns

      select id, title, url, imgroot, username, ra, dec, fov, orientation, name
      from flickr.photos.astro