spacetelescope / jwst_gtvt

Other
10 stars 11 forks source link

no output found for a coordinate with a negative DEC value #90

Closed WeichenStars closed 11 months ago

WeichenStars commented 1 year ago

Hi everyone,

I found this puzzling issue for the new version v1.0.0.

Whenever the DEC value is negative in the input, there will be no output table or figure like the following:

Terminal input: jwst_gtvt 00:44:34.02 -26:11:18.8

Terminal output:

**WARNING**: LOCAL JWST PRD VERSION PRDOPSSOC-059 CANNOT BE CHECKED AGAINST ONLINE VERSION
Usage:
  jwst_gtvt <ra> <dec> [--start_date=<obs_start>] [--end_date=<obs_end>] [--instrument=<inst>] [--target_name=<name>] [--write_ephemeris=<write_path>] [--write_plot=<plot_path>] [--silent]

If instead, the DEC value is positive, for example as follows, the figure and table will all be returned as normal:

Terminal input: jwst_gtvt 00:44:34.02 26:11:18.8

The jwst_gtvt was installed on my mac osx (v12.1, Intel) using the standard pip install approach. I found no such issue with the previous jwst_gtvt version (v0.3.1).

Below is a list of other packages installed in my conda env in case it is useful to look at:

(gtvt) Vincents-MacBook-Air:server vincent$ conda list

# packages in environment at /Users/vincent/anaconda3/envs/gtvt:
#
# Name                    Version                   Build  Channel
alabaster                 0.7.13                   pypi_0    pypi
astropy                   5.3.1                    pypi_0    pypi
astroquery                0.4.6                    pypi_0    pypi
babel                     2.11.0                   pypi_0    pypi
beautifulsoup4            4.11.1                   pypi_0    pypi
ca-certificates           2023.01.10           hecd8cb5_0
certifi                   2022.12.7        py39hecd8cb5_0
charset-normalizer        3.0.1                    pypi_0    pypi
contourpy                 1.0.7                    pypi_0    pypi
cycler                    0.11.0                   pypi_0    pypi
docopt                    0.6.2                    pypi_0    pypi
docutils                  0.19                     pypi_0    pypi
et-xmlfile                1.1.0                    pypi_0    pypi
fonttools                 4.38.0                   pypi_0    pypi
html5lib                  1.1                      pypi_0    pypi
idna                      3.4                      pypi_0    pypi
imagesize                 1.4.1                    pypi_0    pypi
importlib-metadata        6.0.0                    pypi_0    pypi
importlib-resources       6.0.0                    pypi_0    pypi
jaraco-classes            3.2.3                    pypi_0    pypi
jinja2                    3.1.2                    pypi_0    pypi
jwst-gtvt                 1.0.0                    pypi_0    pypi
keyring                   23.13.1                  pypi_0    pypi
kiwisolver                1.4.4                    pypi_0    pypi
libcxx                    14.0.6               h9765a3e_0
libffi                    3.4.2                hecd8cb5_6
lxml                      4.9.2                    pypi_0    pypi
markupsafe                2.1.2                    pypi_0    pypi
matplotlib                3.7.2                    pypi_0    pypi
more-itertools            9.0.0                    pypi_0    pypi
ncurses                   6.4                  hcec6c5f_0
numpy                     1.25.1                   pypi_0    pypi
numpydoc                  1.5.0                    pypi_0    pypi
openpyxl                  3.0.10                   pypi_0    pypi
openssl                   1.1.1s               hca72f7f_0
packaging                 23.0                     pypi_0    pypi
pandas                    2.0.3                    pypi_0    pypi
pillow                    9.4.0                    pypi_0    pypi
pip                       22.3.1           py39hecd8cb5_0
pyerfa                    2.0.0.1                  pypi_0    pypi
pygments                  2.14.0                   pypi_0    pypi
pyparsing                 3.0.9                    pypi_0    pypi
pysiaf                    0.19.1                   pypi_0    pypi
python                    3.9.16               h218abb5_0
python-dateutil           2.8.2                    pypi_0    pypi
pytz                      2022.7.1                 pypi_0    pypi
pyvo                      1.4                      pypi_0    pypi
pyyaml                    6.0                      pypi_0    pypi
readline                  8.2                  hca72f7f_0
requests                  2.28.2                   pypi_0    pypi
scipy                     1.10.0                   pypi_0    pypi
setuptools                65.6.3           py39hecd8cb5_0
six                       1.16.0                   pypi_0    pypi
snowballstemmer           2.2.0                    pypi_0    pypi
soupsieve                 2.3.2.post1              pypi_0    pypi
sphinx                    6.1.3                    pypi_0    pypi
sphinxcontrib-applehelp   1.0.4                    pypi_0    pypi
sphinxcontrib-devhelp     1.0.2                    pypi_0    pypi
sphinxcontrib-htmlhelp    2.0.0                    pypi_0    pypi
sphinxcontrib-jsmath      1.0.1                    pypi_0    pypi
sphinxcontrib-qthelp      1.0.3                    pypi_0    pypi
sphinxcontrib-serializinghtml 1.1.5                    pypi_0    pypi
sqlite                    3.40.1               h880c91c_0
tabulate                  0.9.0                    pypi_0    pypi
tk                        8.6.12               h5d9f67b_0
tzdata                    2023.3                   pypi_0    pypi
urllib3                   1.26.14                  pypi_0    pypi
webencodings              0.5.1                    pypi_0    pypi
wheel                     0.37.1             pyhd3eb1b0_0
xz                        5.2.10               h6c40b1e_1
zipp                      3.11.0                   pypi_0    pypi
zlib                      1.2.13               h4dc903c_0
lboogaard commented 11 months ago

I can confirm, just encountered the same issue on a fresh install

kevinhainline commented 11 months ago

I have also found this to be true with a fresh install.

mfixstsci commented 11 months ago

Hey All -- Sorry for the long reply. I am looking into the issue this morning and found the problem. The issue deals with how our argument parser is handling the - in the <dec> argument. The argument parser can accept arguments preceded by -- (example:--help) for longhand names and - (example:-h) for shorthand names. When faced with - and then a numeric value, the parser doesn't recognize the pattern outlined in the docstring, hence the confusion. I went ahead and made a quick fix in the PR here: #91

Attached is a figure of the target with the ra and dec provided by @WeichenStars

Screen Shot 2023-10-17 at 10 16 41 AM

When this is in, the new commands will look like this: jwst_gtvt --ra=00:44:34.02 --dec=-26:11:18.8

Thank you for your patience!

mfixstsci commented 11 months ago

Hey All -- please see https://pypi.org/project/jwst-gtvt/ for the new version of the tool 1.0.1. This should fix this issue! I am going to close the ticket now.

See https://github.com/spacetelescope/jwst_gtvt#example for examples of how to parse the ra and dec with these new updates. Thanks again for the your patience!

WeichenStars commented 11 months ago

Great, thanks!