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

guppi.py generate_filterbank_header() creates header corruption if not GBT

texadactyl opened this issue · comments

Here is the subject source code segment:

gp_head = self.read_first_header()        
fb_head = {}
telescope_str = gp_head.get("TELESCOP", "unknown")
if telescope_str.upper() in ('GBT', 'GREENBANK'):
            fb_head["telescope_id"] = 6
elif telescope_str.upper() in ('PKS', 'PARKES'):
            fb_head["telescop_id"] = 7
else:
            fb_head["telescop_id"] = 0

The problems are as follows:

  • gp_head.get does not diagnose a missing TELESCOP element. It should at least warn the operator/user.
  • The telescope_id for Parkes should be 4, not 7.
  • If not GBT, the header keyword for "telescope_id" is misspelled, leading to a corrupted filterbank header.

Most likely, this code is never used. It is tested automatically but the result is never checked.

Much of the values being inserted into the header are suspect. Lots of "TODO" comments.