astropy / astroquery

Functions and classes to access online data resources. Maintainers: @keflavich and @bsipocz and @ceb8
http://astroquery.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
695 stars 396 forks source link

mast query returns only 50000 rows #2788

Open kareemelbadry opened 1 year ago

kareemelbadry commented 1 year ago

I'm trying to query mast for TESS-SPOC light curves using the following code:

from astroquery.mast import Observations
res = Observations.query_criteria(provenance_name="TESS-SPOC", sequence_number = 2)

This returns 50000 results. It should return 159994 results, as

Observations.query_criteria_count(provenance_name="TESS-SPOC", sequence_number = 2)

returns 159994 (and 160,000 is the maximum number of light curves produced per sector).

The maximum number of results seems to be set by the 'pagesize' argument, but

res = Observations.query_criteria(provenance_name="TESS-SPOC", sequence_number = 2, pagesize=160000)

still returns only 50000. Similarly, the 'page' argument has no effect. Is this a bug, or is there some other keyword to use?

This is version 0.4.6 installed via pip. thanks!

sean-lockwood commented 8 months ago

It seems odd that query_criteria_async doesn't pass the page and pagesize parameters to the service_request_async method call, like what happens in query_region_async.

https://github.com/astropy/astroquery/blob/main/astroquery/mast/observations.py#L294

bsipocz commented 8 months ago

cc @astrojimig

astrojimig commented 8 months ago

I could not replicate this issue with 0.4.6

>>> from astroquery.mast import Observations
>>> res = Observations.query_criteria(provenance_name="TESS-SPOC", sequence_number = 2)
>>> len(res)
159994

I can still update query_criteria_async though, it does seem odd that the page parameters aren't used! Although I note query_criteria_count doesn't use it either, so I don't think that was the root of this issue.

sean-lockwood commented 8 months ago

Try setting page=1 and you'll see that it has no effect on the length of the results.