astroquery icon indicating copy to clipboard operation
astroquery copied to clipboard

mast query returns only 50000 rows

Open kareemelbadry opened this issue 1 year ago • 4 comments

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!

kareemelbadry avatar Jul 28 '23 12:07 kareemelbadry

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

sean-lockwood avatar Jan 02 '24 16:01 sean-lockwood

cc @astrojimig

bsipocz avatar Jan 04 '24 18:01 bsipocz

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.

astrojimig avatar Jan 04 '24 19:01 astrojimig

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

sean-lockwood avatar Jan 04 '24 19:01 sean-lockwood