0 votes
by (120 points)
Hi,

I am using SparclClient to download DESI's stellar spectra, with the following code:

client = SparclClient()

out = ['sparcl_id', 'ra', 'dec', 'redshift', 'spectype', 'data_release', 'redshift_err']

ra_range = [0,360]

dec_range = [-90,90] # Just an example of downloading the all-sky spectra.

cons = {'spectype': ['STAR'], 'redshift': [0.0, 0.1],  'ra': ra_range,  'dec': dec_range}      

found_spectra = client.find(outfields=out, constraints=cons, limit=99999)

However, no matter what I set the limit to (greater than 500, e.g., 99999 or None), it will always download at most 500 spectra. I am confused and want to know why. If this has to do with me needing to log in to the Data Lab, where do I go to register?

Thank you very much for your kind answers!

1 Answer

0 votes
by (140 points)

Hi, 

You should be able to find more than 500 records. Which version of the client and server are you using? It should be sparclclient:1.2.2, api:12.0. You can get this info by doing: 

from sparcl.client import SparclClient
client = SparclClient()
client

Also, for future questions about SPARCL, please submit them to datalab-spectro@noirlab.edu

by (120 points)
Yes, the version is indeed sparclclient:1.2.2, api:12.0. Thank you for the information you provided. Later, let me write an email to inquire about this matter.
by (140 points)
This issue was resolved via email exchange. Summary:
The user did not set a limit in the call to client.retrieve(), so it was only returning 500 records (500 is the default limit when limit is not set). Once the user set the limit=24000 (which is the maximum number of records one can retrieve at a time), they were able to download their spectra.
by (120 points)
Yeah! Many thanks to SPARCL team!
Welcome to DESI Data Q&A, where you can ask questions and receive answers about Dark Energy Spectroscopic Instrument (DESI) data from other members of the community.
...