Пример #1
0
def test_writePAPER():
    """Test reading & writing PAPER Miriad file."""
    UV = UVData()
    testfile = os.path.join(DATA_PATH, 'zen.2456865.60537.xy.uvcRREAA')
    write_file = os.path.join(DATA_PATH, 'test/outtest_miriad.uv')
    status = uvtest.checkWarnings(UV.read_miriad, [testfile],
                                  known_warning='miriad')
    UV.write_miriad(write_file, clobber=True)
    nt.assert_true(status)
    del(UV)
Пример #2
0
def test_readWriteReadMiriad():
    """
    PAPER file Miriad loopback test.

    Read in Miriad PAPER file, write out as new Miriad file, read back in and
    check for object equality.
    """
    uv_in = UVData()
    uv_out = UVData()
    testfile = os.path.join(DATA_PATH, 'zen.2456865.60537.xy.uvcRREAA')
    write_file = os.path.join(DATA_PATH, 'test/outtest_miriad.uv')
    status = uvtest.checkWarnings(uv_in.read_miriad, [testfile],
                                  known_warning='miriad')
    uv_in.write_miriad(write_file, clobber=True)
    uv_out.read_miriad(write_file)

    nt.assert_true(status)
    nt.assert_equal(uv_in, uv_out)
    del(uv_in)
    del(uv_out)
Пример #3
0
def test_ReadUVFitsWriteMiriad():
    """
    read uvfits, write miriad test.
    Read in uvfits file, write out as miriad, read back in and check for
    object equality.
    """
    uvfits_uv = UVData()
    miriad_uv = UVData()
    uvfits_file = os.path.join(DATA_PATH, 'day2_TDEM0003_10s_norx_1src_1spw.uvfits')
    testfile = os.path.join(DATA_PATH, 'test/outtest_miriad')
    read_status = uvtest.checkWarnings(uvfits_uv.read_uvfits, [uvfits_file],
                                       message='Telescope EVLA is not')
    uvfits_uv.write_miriad(testfile, clobber=True)
    miriad_read_status = uvtest.checkWarnings(miriad_uv.read_miriad, [testfile],
                                              message='Telescope EVLA is not')
    nt.assert_true(read_status)
    nt.assert_true(miriad_read_status)

    nt.assert_equal(miriad_uv, uvfits_uv)
    del(uvfits_uv)
    del(miriad_uv)