import numpy as np import argparse parser = argparse.ArgumentParser() parser.add_argument('obs') parser.add_argument('inpath') parser.add_argument('outpath') args = parser.parse_args() ss = SS(inpath=args.inpath, outpath=args.outpath, obs=args.obs, flag_choice='original', bad_time_indices=[0, -1, -2, -3, -4, -5], read_kwargs={'ant_str': 'cross'}) ss.INS_prepare() ss.INS.save() cp.INS_plot(ss.INS) for sig_thresh in [5, 10, 20, 40, 80]: ss.MF_prepare(sig_thresh=sig_thresh, N_thresh=15, shape_dict={ 'TV6': [1.74e8, 1.81e8], 'TV7': [1.81e8, 1.88e8], 'TV8': [1.88e8, 1.95e8], 'broad6': [1.72e8, 1.83e8], 'broad7': [1.79e8, 1.9e8], 'broad8': [1.86e8, 1.97e8] }) ss.MF.apply_match_test() cp.INS_plot(ss.INS, sig_thresh=sig_thresh)
UV.read(args.inpath, file_type='uvfits') JD = np.unique(UV.time_array)[-2] where = np.where(UV.time_array == JD) UV.flag_array[where] = 1 auto_bl = np.where(UV.ant_1_array == UV.ant_2_array) UV.flag_array[auto_bl] = 1 return (UV) UV = UV_construct(args) shape_dict = { 'TV6': [1.74e8, 1.81e8], 'TV7': [1.81e8, 1.88e8], 'TV8': [1.88e8, 1.95e8], 'broad6': [1.72e8, 1.83e8], 'broad7': [1.79e8, 1.9e8], 'broad8': [1.86e8, 1.97e8] } sky_sub = SS(obs=args.obs, UV=UV, outpath=args.outpath, flag_choice='original') sky_sub.INS_prepare() sky_sub.MF_prepare(sig_thresh=5, shape_dict=shape_dict, N_thresh=15) sky_sub.MF.apply_match_test(apply_N_thresh=True) sky_sub.apply_flags(choice='INS', INS=sky_sub.INS) sky_sub.write('%s/%s.uvfits' % (args.outpath, args.obs), 'uvfits', UV=UV_construct(args))