spacetelescope / jwst_mast_query

Command line tool for querying MAST and downloading JWST data products
BSD 3-Clause "New" or "Revised" License
18 stars 11 forks source link

"No observations found" error #61

Open Bhavesh012 opened 1 month ago

Bhavesh012 commented 1 month ago

Hey, I am having this issue now while running a tutorial from spaceKLIP package. I am running this command to download the data:

jwst_download.py --propID 1386 -i miri --obsnums 4 5 6 7 8 9 28 29 30 31 --outsubdir data_miri_hd65426/uncal -f uncal

But I am getting this error:

INSTRUMENT:  miri
obsmode:  [None]
propID:  01386
obsnums:  [4, 5, 6, 7, 8, 9, 28, 29, 30, 31]
INFO: MAST API token accepted, welcome Bhavesh Rajpoot [astroquery.mast.auth]
MJD range: 60596.38482971497 60597.48482972325
No obsmode given. Querying for all files for miri.
WARNING: NoResultsWarning: Query returned no results. [astroquery.mast.discovery_portal]
WARNING!! No observations found!!

################################
NO OBSERVATIONS FOUND! exiting....
################################
############## Nothing selected!!!! exiting...

I manually checked on the MAST portal and found that the observations do exist. I also tried defining obsmode, but it didn't work. I don't know what I am doing wrong here.

I also tried for another proposal ID and targets, but again faced the same issue.

Bhavesh012 commented 1 month ago

Okay, found the solution. This error comes up when the --lookbacktime argument is not set. If I set it, let's say, -l 1000 then it works. I thought that if we kept it blank, then it would default to the beginning of the scientific operations of the telescope. I think this should be mentioned somewhere on the README file.

bhilbert4 commented 1 month ago

Thanks for mentioning this. I'll look into it. Maybe there's some problem with setting the default value. I'm not sure how it came up with that MJD range in your original query.

bhilbert4 commented 1 month ago

The default value for lookbacktime is 1 day. I remember now, we decided on this as the default rather than looking back at the entire duration of the mission in order to prevent cases where the query would return thousands of files and possibly run into timeout errors. Another option, which is probably easier when looking for older data, is to use the "date_select" parameter, where you can input starting and ending dates, or just a starting date, for the search.

i agree that when the query is restrictive enough that returning a very large number of files is not an issue, it would be better if the lookbacktime default was adjusted to be the length of the mission. We'll have to think about how to implement that.

Bhavesh012 commented 2 weeks ago

Ah, okay, I see. Makes sense. Thanks for clearing it out, and yeah, having lookback time default to the length of the mission would be convenient.