https://github.com/RadioAstronomySoftwareGroup/pyuvdata
Revision 10f3e966d031c3df7734c8458da56a2389c275ef authored by pyxieloustar on 17 November 2021, 16:24:26 UTC, committed by pyxieloustar on 19 November 2021, 06:01:31 UTC
1 parent 856d228
Tip revision: 10f3e966d031c3df7734c8458da56a2389c275ef authored by pyxieloustar on 17 November 2021, 16:24:26 UTC
move corrections into functions; only correct in-range values
move corrections into functions; only correct in-range values
Tip revision: 10f3e96
readwrite_uvfits.py
#! /usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Read in a uvfits file and write a new one out."""
import argparse
import os.path as op
from pyuvdata import UVData
parser = argparse.ArgumentParser()
parser.add_argument("uvfits_read", help="name of a uvfits file to read in")
parser.add_argument("uvfits_write", help="name of a uvfits file to write out")
args = parser.parse_args()
uvfits_file_in = args.uvfits_read
if not op.isfile(uvfits_file_in):
raise IOError("There is no file named {}".format(args.uvfits_file_in))
uvfits_file_out = args.uvfits_write
this_uv = UVData()
this_uv.read_uvfits(uvfits_file_in)
this_uv.write_uvfits(uvfits_file_out)
del this_uv
Computing file changes ...