Site Map

Random Objects Tutorial

Back to Tutorials

How do I...

Get a random 1% (or x%) subset of the SDSS data?

The SDSS catalog database is about a terabyte (1,000,000 MB) - far too big for you to download and work with it all at once. But you can get a random subset of the data using an SQL Search. To learn more about SQL, see SkyServer's SQL Tutorial and guide to Using SQL with SkyServer.

  1. Go to the SQL Search page. From the astronomers' main page, look under Search Tools. From the public main page, look under SkyServer Tools, then Search.
  2. In the large textbox, type the following SQL query:

    SELECT u, g, r, i, z
    FROM Galaxy
    WHERE htmid*37 & 0x000000000000FFFF < (650 * 1)
    
  3. The query will return a 1% subset of the data. To return a different percentage subset of the data, change the final 1 to a different number (for example, for a random 0.5% subset of the data, change it to 0.5).
  4. The query will return the magnitudes of a 1% subset of the data. You can also return other data, such as positions and object IDs.