Where to Start
News and Updates
Data Products
Data Access
Sky Coverage
Data Flow
Known Problems
Help and Feedback

Tutorial: Obtaining Spectra based on Color Constraints

How to Find all Objects with Spectra that Satisfy a Given Set of Color Constraints and then Get the Spectra.

This query, in particular, finds spectra for all objects at the hot end of the WD cooling sequence. For a simple example, this list is defined as objects with g-r <-0.15 and u-g <0.4.  Normally, when querying based on filter or color magnitudes, you should also make sure all the appropriate photo QA flags are set properly (to indicate the object's photometry is trustworthy), but in this case, since all these objects have spectra, we will assume they were targeted and allocated a fiber based on good photometric magnitudes, so we don't bother to check the QA flags.


  1. Go to the SDSS Data Release website: http://www.sdss.org/dr4
  2. Click on Data Access in the left navigation bar.
  3. Select "html" as output format if you want to look at your query results in your browser, or "csv" to save them in a "comma-separated values" file which you can use to retrieve spectra from the Data Archive Server later
  4. Click on Spectro Query Server.
  5. At the first line, enter 0 to have your query return an unlimited number of output rows/objects.
  6. Select "minimal" under "Spectroscopy Parameters" under "Parameters to Return". This will return the MJD, plate, and fiberID that you will need to actually get the spectra from the DAS. (You may ALSO want to select "radec" if you want to get the object coordinates returned as well. For now, the assumption is that you only have "minimal" selected.)
  7. If you want to retrieve not just spectra, but also imaging data for the objects, select "minimal" under imaging parameters as well.
  8. Select the Best radio button between the parameter listboxes.
  9. Under Position Constraints, make sure "No Position Constraint" is selected.
  10. Enter 0.4 in the "u-g max" box.
  11. Enter -0.15 in the "g-r max" box.
  12. Unselect "Extended Sources" and make sure "Point Sources" is selected in the "Object Type" section of the form.
  13. Verify that nothing else is selected.
  14. Click on "Submit Request". Depending on database load, this query takes about half a minute to run and returns 3493 objects.

To get the actual spectra for these objects:

  1. Select csv output and save the csv file to disk.
  2. Go to the DAS retrieval form
  3. Under data product, select spSpec. (You might also want spPlotGif if you want to see simple GIFs of each spectrum.) The spSpec selection will get you the FITS file for each spectrum.
  4. If your file contains at least the "minimal" imaging parameters and a filter name, select fpC and bestTsObj to get the images and object catalogs containing your objects. (Warning: This will cause the query to run for a long time! You may want to retrieve the imaging data in a separate request.)
  5. Select the result csv file from above for upload under step 3.
  6. Since you have a lot of files here, you will get your data via rsync whatever option is selected in step 4.
  7. Click on "Submit Request" in Step 5 of the web form.
  8. If you selected just spectra, your results should come up in about 15 minutes. If the retrieval takes more than 20 minutes, the web server will time out the connection. You can still get your data by accessing the directory whose name is given on the results page - append that directory name to http://das.sdss.org and point your browser there.
  9. Follow the instructions on the page to transfer the data over to your local disk using rsync or an http client such as wget (the http client is recommended for large data sets; if the web server timed out, follow the instructions in the rsync HOWTO).
  10. See the tutorial on "Displaying SDSS Spectra" to learn how to display your new SDSS spectra.

Last modified: Thu Aug 4 12:14:09 CDT 2005