MWATelescope / mwax_mover

MWA Correlator (mwax) mover. Gluing components together.
3 stars 0 forks source link

Exception when handling invalid filename instead of graceful handling #25

Closed gsleap closed 3 months ago

gsleap commented 5 months ago

Example output when faced with invalid metafits_ppd filename:


2024-05-24 15:30:54,627, INFO, watch_vis_incoming, Found 25 files
Exception in thread watch_vis_incoming:
Traceback (most recent call last):
  File "/home/mwa/.pyenv/versions/3.11.6/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
2024-05-24 15:30:54,629, INFO, work_sub, /dev/shm/mwax/1400567416_1400571048_61.sub- ignoring due to mode: NO_CAPTURE
    2024-05-24 15:30:54,628, INFO, watch_vis_outgoing, Found 0 files
self.run()
  File "/home/mwa/.pyenv/versions/3.11.6/lib/python3.11/threading.py", line 982, in run
    2024-05-24 15:30:54,629, INFO, watch_cal_outgoing, Found 0 files
self._target(*self._args, **self._kwargs)
  File "/home/mwa/.pyenv/versions/3.11.6/envs/mwax_mover/lib/python3.11/site-packages/mwax_mover/mwax_priority_watcher.py", line 78, in start
2024-05-24 15:30:54,630, INFO, work_sub, /dev/shm/mwax/1400567416_1400571048_61.sub- SubfileProcessor.subfile_handler finished handling.
    2024-05-24 15:30:54,631, INFO, work_sub, Complete. Queue size: 0 Elapsed: 0.01 sec
self.do_watch_loop()
  File "/home/mwa/.pyenv/versions/3.11.6/envs/mwax_mover/lib/python3.11/site-packages/mwax_mover/mwax_priority_watcher.py", line 100, in do_watch_loop
    utils.scan_for_existing_files_and_add_to_priority_queue(
  File "/home/mwa/.pyenv/versions/3.11.6/envs/mwax_mover/lib/python3.11/site-packages/mwax_mover/utils.py", line 511, in scan_for_existing_files_and_add_to_priority_queue
    priority = get_priority(
               ^^^^^^^^^^^^^
  File "/home/mwa/.pyenv/versions/3.11.6/envs/mwax_mover/lib/python3.11/site-packages/mwax_mover/utils.py", line 697, in get_priority
    raise Exception(f"File {filename} is not valid! Reason: {val.validation_message}")
Exception: File /visdata/incoming/1396372208_1396374032_ppds.fits is not valid! Reason: Filename (excluding extension) is not in the correct format (incorrect length (26). Format should be obsid_yyyymmddhhnnss_chXXX_XXX.fits)- ignoring```
gsleap commented 3 months ago

Duplicate of #12