I have a list of 200 Program IDs, and I want to download all the associated Level 2 IRS High-Resolution spectra. How do I do this?
Posted by Vandana Desai on 24 April 2013 02:13 PM
For such a long list of Program IDs (PIDs), you will want to write a script. For each PID, the script should:
1. Search the SHA for all Level 2 products associated with the PID. For example,
% wget "http://sha.ipac.caltech.edu/applications/Spitzer/SHA/servlet/DataService?PID=105&VERB=3&DATASET=ivo%3A%2F%2Firsa.ipac%2Fspitzer.level2" -O output.file
For more details on constructing the URL, see http://irsa.ipac.caltech.edu/onlinehelp/heritage/api.html
2. Choose only the rows with a "wavelength" column consistent with a High-Resolution observation (e.g. "IRS SH 9.9-19.6um").
3. If there are any High-Resolution observations, use the column "externalname" to find the name of the associated Level 2 pbcd product (e.g. r12256512/ch1/pbcd/SPITZER_S1_12256512_0007_8_E7359549_tune.tbl) and the column "accessUrl" to learn the URLs that you need to visit to download that product (e.g. http://sha.ipac.caltech.edu/applications/Spitzer/SHA/servlet/ProductDownload?DATASET=level2&ID=7359549).
4. Download any High-Resolution observations found:
%wget "http://sha.ipac.caltech.edu/applications/Spitzer/SHA/servlet/ProductDownload?DATASET=level2&ID=7359549" -O SPITZER_S1_12256512_0007_8_E7359549_tune.tbl
Your script will have to loop over the above 4 steps to get through all of your 200 PIDs.