Пример #1
0
def test_getting_coordinates_for_the_last_read_record_should_not_fail():
    r = None
    try:

        r = MultiRPN(in_path)
        rec = r.get_first_record_for_name("I5")
        lons, lats = r.get_longitudes_and_latitudes_of_the_last_read_rec()
        tools.assert_equals(lons.shape, lats.shape, "Shapes of lon and lat arrays should be the same.")

    finally:
        if r is not None:
            r.close()

        delete_files()
Пример #2
0
def test_should_find_all_records():
    r = None
    try:

        create_files()
        r = MultiRPN("test_?.rpn")

        for fn in range(len(FILE_NAMES)):
            rec = r.get_first_record_for_name("T{}".format(fn))
            print("file {} - OK".format(fn))
            print(rec.mean(), rec.shape)

    finally:
        if r is not None:
            r.close()

        delete_files()