def test_inplace_add(): uv1a = UVFlag(test_f_file) uv1b = copy.deepcopy(uv1a) uv2 = copy.deepcopy(uv1a) uv2.time_array += 1 uv1a += uv2 nt.assert_true(uv1a.__eq__(uv1b + uv2))
def test_read_write_nocompress_flag(): uv = UVData() uv.read_miriad(test_d_file) uvf = UVFlag(uv, mode='flag', label='test') uvf.write(test_outfile, clobber=True, data_compression=None) uvf2 = UVFlag(test_outfile) # Update history to match expected additions that were made uvf.history += 'Written by ' + hera_qm_version_str uvf.history += ' Read by ' + hera_qm_version_str nt.assert_true(uvf.__eq__(uvf2, check_history=True))
def test_read_write_ant(): uv = UVCal() uv.read_calfits(test_c_file) uvf = UVFlag(uv, mode='flag', label='test') uvf.write(test_outfile, clobber=True) uvf2 = UVFlag(test_outfile) # Update history to match expected additions that were made uvf.history += 'Written by ' + hera_qm_version_str uvf.history += ' Read by ' + hera_qm_version_str nt.assert_true(uvf.__eq__(uvf2, check_history=True))
def test_not_equal(): uvf1 = UVFlag(test_f_file) # different class nt.assert_false(uvf1.__eq__(5)) # different mode uvf2 = uvf1.copy() uvf2.mode = 'flag' nt.assert_false(uvf1.__eq__(uvf2)) # different type uvf2 = uvf1.copy() uvf2.type = 'antenna' nt.assert_false(uvf1.__eq__(uvf2)) # array different uvf2 = uvf1.copy() uvf2.freq_array += 1 nt.assert_false(uvf1.__eq__(uvf2)) # history different uvf2 = uvf1.copy() uvf2.history += 'hello' nt.assert_false(uvf1.__eq__(uvf2, check_history=True))