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 detected --- and NameError: name 'sys' is not defined #36

Closed nespinoza closed 1 year ago

nespinoza commented 1 year ago

Hi folks,

Having issues with the latest version of the software. I'm using the .cfg file that's on the repo, but simply modifying the instrument, the PID to match 1541 (which is a public TSO) and the lookbacktime by doing the following edits:

instrument: niriss/soss
(...)
propIDs_obsnum2outsubdir: 1541
(...)
lookbacktime: 1000.0

I then run via jwst_download.py --propID 1541 --config jwst_query.cfg.

However, when I do this, I get the following:

Loading config file jwst_query.cfg
propID 01541
obsnums [1]
INSTRUMENT: niriss/soss
INFO: MAST API token accepted, welcome Nestor Espinoza [astroquery.mast.auth]
MJD range: 59027.13078453367 60027.230784538275
WARNING: NoResultsWarning: Query returned no results. [astroquery.mast.discovery_portal]
WARNING!! No observations found!!

################################
NO OBSERVATIONS FOUND! exiting....
################################
############## Nothing selected!!!! exiting...
Traceback (most recent call last):
  File "/Users/nespinoza/opt/anaconda3/envs/neonewen/bin/jwst_download.py", line 4, in <module>
    __import__('pkg_resources').run_script('jwst-mast-query==0.0.2.dev15+g44b81de', 'jwst_download.py')
  File "/Users/nespinoza/opt/anaconda3/envs/neonewen/lib/python3.10/site-packages/pkg_resources/__init__.py", line 672, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/nespinoza/opt/anaconda3/envs/neonewen/lib/python3.10/site-packages/pkg_resources/__init__.py", line 1479, in run_script
    exec(script_code, namespace, namespace)
  File "/Users/nespinoza/opt/anaconda3/envs/neonewen/lib/python3.10/site-packages/jwst_mast_query-0.0.2.dev15+g44b81de-py3.10.egg/EGG-INFO/scripts/jwst_download.py", line 45, in <module>
  File "/Users/nespinoza/opt/anaconda3/envs/neonewen/lib/python3.10/site-packages/jwst_mast_query-0.0.2.dev15+g44b81de-py3.10.egg/EGG-INFO/scripts/jwst_download.py", line 37, in main
NameError: name 'sys' is not defined

So, first, no observations are detected (?) and then a sys not defined (perhaps related to this?).

Have folks experimented this? Don't know what is actually going wrong.

Thanks! Néstor

nespinoza commented 1 year ago

Ah, never mind. Setting instrument niriss/image does the trick.

bhilbert4 commented 1 year ago

Note that if you set the instrument to niriss/image, the search won't find any older data that hasn't yet been reprocessed by MAST to use the updated instrument value. So check your results carefully. We're working on some finishing touches, and plan to make a new release to fix this later today.