diff options
author | Aaron LI <aly@aaronly.me> | 2017-06-11 22:09:08 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-06-11 22:09:08 +0800 |
commit | a427998442d55bde843fd4f2f2bd70bc8c4f24f2 (patch) | |
tree | e31219ba96a3fc9a7c38f586e670f7d35703f80d | |
parent | fa8208c993f5d74e67f506ed963b33bf4342401d (diff) | |
download | atoolbox-a427998442d55bde843fd4f2f2bd70bc8c4f24f2.tar.bz2 |
astro/21cm/get_slice_zfreq.py: Fix header keywords usage
-rwxr-xr-x | astro/21cm/get_slice_zfreq.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/astro/21cm/get_slice_zfreq.py b/astro/21cm/get_slice_zfreq.py index c67d513..6805b4a 100755 --- a/astro/21cm/get_slice_zfreq.py +++ b/astro/21cm/get_slice_zfreq.py @@ -97,7 +97,16 @@ def main(): print("z=%05.2f, freq=%06.2f MHz : %s" % (z, f, outfile)) zslice = cube.get_slice(z) header = fits.Header() - header["BUNIT"] = cube.header.get("BUNIT") + try: + header["BUNIT"] = (cube.header["BUNIT"], + cube.header.comments["BUNIT"]) + except KeyError: + pass + try: + header["LSIDE"] = (cube.header["LSIDE"], + cube.header.comments["LSIDE"]) + except KeyError: + pass header["REDSHIFT"] = (z, "Slice where interpolated") header["FREQ"] = (f, "21cm signal frequency [MHz]") header.add_history(" ".join(sys.argv)) |