Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Weird error while downloading GRB skymaps #19

Open
virajkaram opened this issue May 2, 2023 · 0 comments
Open

BUG: Weird error while downloading GRB skymaps #19

virajkaram opened this issue May 2, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@virajkaram
Copy link
Collaborator

Describe the bug
I try running snipergw for a GRB230430A and it throws an uninformative error when it attempts to download the map - it is not clear whether no map is available or there is a bug in the code.

To Reproduce
Steps to reproduce the behavior:

  1. Run python -m snipergw -e GRB230430A
  2. See error -
INFO:snipergw.skymap:Found multiple events. Will choose the one corresponding the GRB letter A
https://heasarc.gsfc.nasa.gov/FTP/fermi/data/gbm/triggers/2023/bn230430196/current/ ['?C=N;O=D', '?C=M;O=A', '?C=S;O=A', '?C=D;O=A', '/FTP/fermi/data/gbm/triggers/2023/bn230430196/', 'glg_cspec_b0_bn230430196_v00.pha', 'glg_cspec_b1_bn230430196_v00.pha', 'glg_cspec_n0_bn230430196_v00.pha', 'glg_cspec_n1_bn230430196_v00.pha', 'glg_cspec_n2_bn230430196_v00.pha', 'glg_cspec_n3_bn230430196_v00.pha', 'glg_cspec_n4_bn230430196_v00.pha', 'glg_cspec_n5_bn230430196_v00.pha', 'glg_cspec_n6_bn230430196_v00.pha', 'glg_cspec_n7_bn230430196_v00.pha', 'glg_cspec_n8_bn230430196_v00.pha', 'glg_cspec_n9_bn230430196_v00.pha', 'glg_cspec_na_bn230430196_v00.pha', 'glg_cspec_nb_bn230430196_v00.pha', 'glg_ctime_b0_bn230430196_v00.pha', 'glg_ctime_b1_bn230430196_v00.pha', 'glg_ctime_n0_bn230430196_v00.pha', 'glg_ctime_n1_bn230430196_v00.pha', 'glg_ctime_n2_bn230430196_v00.pha', 'glg_ctime_n3_bn230430196_v00.pha', 'glg_ctime_n4_bn230430196_v00.pha', 'glg_ctime_n5_bn230430196_v00.pha', 'glg_ctime_n6_bn230430196_v00.pha', 'glg_ctime_n7_bn230430196_v00.pha', 'glg_ctime_n8_bn230430196_v00.pha', 'glg_ctime_n9_bn230430196_v00.pha', 'glg_ctime_na_bn230430196_v00.pha', 'glg_ctime_nb_bn230430196_v00.pha', 'glg_lc_all_bn230430196_v01.gif', 'glg_lc_chan12_bn230430196_v01.pdf', 'glg_lc_chan34_bn230430196_v01.pdf', 'glg_lc_chan567_bn230430196_v01.pdf', 'glg_lc_chantot_bn230430196_v01.pdf', 'glg_lc_hires12_bn230430196_v01.gif', 'glg_lc_hires34_bn230430196_v01.gif', 'glg_lc_hires567_bn230430196_v01.gif', 'glg_lc_lores12_bn230430196_v01.gif', 'glg_lc_lores34_bn230430196_v01.gif', 'glg_lc_lores567_bn230430196_v01.gif', 'glg_lc_medres12_bn230430196_v01.gif', 'glg_lc_medres34_bn230430196_v01.gif', 'glg_lc_medres567_bn230430196_v01.gif', 'glg_lc_tot_bn230430196_v01.pdf', 'glg_lc_zxradec_bn230430196_v01.gif', 'glg_tcat_all_bn230430196_v00.fit', 'glg_trigdat_all_bn230430196_v02.fit', 'glg_tte_b0_bn230430196_v00.fit', 'glg_tte_b1_bn230430196_v00.fit', 'glg_tte_n0_bn230430196_v00.fit', 'glg_tte_n1_bn230430196_v00.fit', 'glg_tte_n2_bn230430196_v00.fit', 'glg_tte_n3_bn230430196_v00.fit', 'glg_tte_n4_bn230430196_v00.fit', 'glg_tte_n5_bn230430196_v00.fit', 'glg_tte_n6_bn230430196_v00.fit', 'glg_tte_n7_bn230430196_v00.fit', 'glg_tte_n8_bn230430196_v00.fit', 'glg_tte_n9_bn230430196_v00.fit', 'glg_tte_na_bn230430196_v00.fit', 'glg_tte_nb_bn230430196_v00.fit']
INFO:snipergw.skymap:Downloading skymap and saving to /Users/viraj/Data/snipergw/skymaps/glg_tte_nb_bn230430196_v00.fit
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/viraj/snipergw/snipergw/__main__.py", line 48, in <module>
    run_snipergw(
  File "/Users/viraj/snipergw/snipergw/run.py", line 36, in run_snipergw
    skymap = Skymap(event_config=event)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/viraj/snipergw/snipergw/skymap.py", line 57, in __init__
    self.skymap_path, self.event_name = self.get_grb_skymap(
                                        ^^^^^^^^^^^^^^^^^^^^
  File "/Users/viraj/snipergw/snipergw/skymap.py", line 156, in get_grb_skymap
    wget.download(final_link, str(skymap_path))
                  ^^^^^^^^^^
UnboundLocalError: cannot access local variable 'final_link' where it is not associated with a value

Expected behavior
Downloads map, or raises a reasonable exception if not available.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@virajkaram virajkaram added the bug Something isn't working label May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant