-
-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simbad.query_region returns None's when executed in for loop #1205
Comments
Look at |
Dear Adam, many thanks for your suggestion. This is what I get: In [6]: print(Simbad.last_response.text) <title>403 Forbidden</title>ForbiddenYou don't have permission to access /simbad/sim-script on this server. Apache/2.4.7 (Ubuntu) mod_jk/1.2.37 OpenSSL/1.0.1f Server at simbad.u-strasbg.fr Port 80 Which makes no sense to me? Any further ideas? Cheers, Daniel |
Uh, interesting. That does not make any sense to me. Can you access that URL via your browser? If not, raise a question with CDS. |
OK, after talking with the people from CDS, I found the problem: The CDS server apparently only allows 6 queries per second. If there are more requests they are blocked. So, if I add a time delay between each query, it works without problem. |
Actually the simbad module supports vectorized queries since #833, so what I would do is to factor out the astroquery call from your loop, and instead of creating single object SkyCoords build a vector one. |
Hello,
I am using python 2.7.11 with Ipython 3.2, astropy 2.0.6 and astroquery 0.3.9.dev0 (although when I install it, it say package astroquery-0.3.9.dev450.tar.gz) on a MAC OS 10.9.5, and I have the following issue:
I want to do a Simbad.query_region for a long list of objects, so I use a for loop to go over all the objects and do one query per object, and I test this for well-known objects and coordinates (nearby galaxies). Now, the queries return results for the first 10 objects in the loop but then only return "None" for all objects after. If I just execute the script again, now the queries are successful for the first 12 objects, and so on. Also, if I execute query_region commandys individually, it returns the object as expected.
Here is the code:
And the first 30 lines in the "test.csv":
I also attach both files as an archive:
Archive.zip
Any idea what could be the problem, and how I can get it working (I need to query for a few million objects in total, so I need a stable and reliable method).
Many thanks in advance for any help! Also my apologies if I missed some description/solution of this problem!
Best regards,
Daniel
The text was updated successfully, but these errors were encountered: