Rendering the Structure of the Universe in Your Spare Time

The Sloan Digital Sky Survey (SDSS) is an ongoing endeavor to map the sky in great detail, with many different goals. One of the larger objectives is to map the structure of the cosmos by determining the positions of galaxies and their relativistic redshift (basically their distance). Using this data and Mathematica, you can plot the information and reveal the structure of the cosmos.

In my spare time, I queried the SDSS website, which is database driven, and in eight separate queries I was able to get all galaxies in the survey out to a redshift of 0.5. According to Wolfram|Alpha, this corresponds to looking back in time 5.02 billion years ago, or a distance of 6.14 billion light years, when the light we’re now seeing from the most distant galaxies started its journey here. That’s a billion years before our solar system formed. It’s taken this long for the light to reach us.
This animation is of only a tiny fraction of the visible universe, but still more than enough to give you a glimpse of the size and scale of the universe.

Each point represents a galaxy. Our galaxy would be at the very center (no, we aren’t the center of the universe—just the center of this animation). As you can see, galaxies tend to cluster along a web-like structure with “voids” interspersed. The survey images the sky in slices, which form the wedge-like pieces in the animation. These are the areas of the sky imaged so far.

The well-known Hubble Ultra Deep Field, while imaging galaxies to a much greater distance (about 13 billion years ago and redshifts between 7 and 12), covers only a tiny pinprick of the sky (11 arcminutes) and so doesn’t show the structure that this animation does.

This was achieved in Mathematica with a very tiny amount of code:

Here proj is just the collection of triples {x, y, z} obtained from the SDSS data. I then just varied the ViewPoint and exported each frame. Find out more about using Mathematica in the field of astronomy on our Astronomy Solution page.

great stuff, but trying to replicate all I got was a sphrical distribution of the points with a bright line in the middle. Could you please post the SQL code you used to obtain the data and also what distance scale did you use and how you converted from z to distance, here is what I used in the SQL:
select ra,dec,z
from specObj WHERE
z BETWEEN 0.001 AND 0.5

Its been quite a while and I’m not usually a database guy. I didn’t make the database calls from Mathematica since their website didn’t make it obvious how to do that, but I was able to get the data using the following SQL commands:

SELECT
sp.bestObjID as oid,
sp.z as z,
sp.specClass as specClass,
sp.ra as ra,
sp.dec as dec,
sp.mag_0 as mag_g,
sp.mag_1 as mag_r,
sp.mag_2 as mag_i,
gal.expMag_r as emag_r,
gal.expAB_r as AB,
gal.expPhi_r as phi,
gal.expRad_r as rad_r,
gal.expRad_i as rad_i,
gal.petroR90_r / gal.petroR50_r as conc90_50
FROM SpecObj as sp,
Galaxy as gal
WHERE sp.bestObjID = gal.objID
and sp.z = 16000

The last line needs to be tweaked to get a specific batch. Their site times out if the batch is too large. I downloaded each batch to a CSV file and then imported them. Each row had the form: