Esempio n. 1
0
 def test_rotated_antennas(self):
     objective_file = os.path.join(
         DATA_PATH, 'zen.2457555.42443.xx.HH.uvcA.first.calfits')
     xx_vis = os.path.join(DATA_PATH, 'zen.2457555.42443.xx.HH.uvcA')
     o = firstcal.firstcal_option_parser()
     cmd = "-p xx -C {0} --ex_ants=22,81 {1}".format(calfile, xx_vis)
     opts, files = o.parse_args(cmd.split())
     history = 'history'
     firstcal.firstcal_run(files, opts, history)
     nt.assert_true(os.path.exists(objective_file))
     os.remove(objective_file)
     return
Esempio n. 2
0
 def test_single_file_execution_nocalfile(self):
     objective_file = os.path.join(
         DATA_PATH, 'zen.2457999.76839.xx.HH.uvA.first.calfits')
     xx_vis = os.path.join(DATA_PATH, 'zen.2457999.76839.xx.HH.uvA')
     if os.path.exists(objective_file):
         os.remove(objective_file)
     o = firstcal.firstcal_option_parser()
     cmd = "-p xx {0}".format(xx_vis)
     opts, files = o.parse_args(cmd.split())
     history = 'history'
     firstcal.firstcal_run(files, opts, history)
     nt.assert_true(os.path.exists(objective_file))
     os.remove(objective_file)
     return
Esempio n. 3
0
 def test_single_file_execution(self):
     objective_file = os.path.join(
         DATA_PATH, 'zen.2457698.40355.xx.HH.uvcAA.first.calfits')
     xx_vis4real = os.path.join(DATA_PATH, xx_vis)
     if os.path.exists(objective_file):
         os.remove(objective_file)
     o = firstcal.firstcal_option_parser()
     cmd = "-C {0} -p xx --ex_ants=81 {1}".format(calfile, xx_vis4real)
     opts, files = o.parse_args(cmd.split())
     history = 'history'
     firstcal.firstcal_run(files, opts, history)
     nt.assert_true(os.path.exists(objective_file))
     os.remove(objective_file)
     return
Esempio n. 4
0
 def test_overwrite(self):
     objective_file = os.path.join(
         DATA_PATH, 'zen.2457698.40355.xx.HH.uvcAA.first.calfits')
     xx_vis4real = os.path.join(DATA_PATH, xx_vis)
     if os.path.exists(objective_file):
         os.remove(objective_file)
     _ = open(objective_file, 'a').close()
     o = firstcal.firstcal_option_parser()
     cmd = "-C {0} -p xx --overwrite {1}".format(calfile, xx_vis4real)
     opts, files = o.parse_args(cmd.split())
     history = 'history'
     firstcal.firstcal_run(files, opts, history)
     # check its a calfits file
     uvc = UVCal()
     uvc.read_calfits(objective_file)
     # check a metadata column for accuracy
     nt.assert_equal(uvc.Nants_data, 19)
     # remove file
     os.remove(objective_file)
     return
Esempio n. 5
0
#!/usr/bin/env python2.7

import sys
from hera_cal.firstcal import firstcal_run, firstcal_option_parser

o = firstcal_option_parser()
opts, files = o.parse_args(sys.argv[1:])
history = ' '.join(sys.argv)

firstcal_run(files, opts, history)