UCBerkeleySETI / blimpy

Breakthrough Listen I/O Methods for Python

Home Page:https://blimpy.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fil2h5, h52fil, dice, and bl_scrunch can mangle the output file name

texadactyl opened this issue · comments

In fil2h5, it is possible to mangle the output file name if the input file path has an embedded "fil". In essence, the embedded "fil" will be inadvertently changed to "h5". E.g. "abc.filter.def.fil" --> "abc.h5ter.def.h5" (should be "abc.filter.def.h5"). This was caused by misuse of the string replace function.

Solution:

  • utils.change_the_ext(path, old_ext, new_ext) will change only the final old_ext in the path or append the new_path if there is no old_ext present.
  • fil2h5, h52fil, dice, and bl_scrunch call the new function.
  • Since the function is generic, it can also be leveraged by other projects such as turbo_seti (probably needed!).