diff --git a/TurTLE/test/test_write_filtered.py b/TurTLE/test/test_write_filtered.py new file mode 100644 index 0000000000000000000000000000000000000000..6a4849077f73a1fbd7f710cabed1cc0cafed1f42 --- /dev/null +++ b/TurTLE/test/test_write_filtered.py @@ -0,0 +1,33 @@ +#! /usr/bin/env python + +import numpy as np +import h5py +import sys + +import TurTLE +from TurTLE import TEST + +try: + import matplotlib.pyplot as plt +except: + plt = None + +def main(): + c = TEST() + c.launch( + ['write_filtered_test', + '--simname', 'write_filtered_test', + '--np', '4', + '--ntpp', '1', + '--wd', './'] + + sys.argv[1:]) + df = h5py.File('data_for_write_filtered.h5', 'r') + bla0 = df['scal_field_full/complex/0'][:, 0] + bla1 = df['scal_field_z0slice/complex/0'][...] + assert(np.max(np.abs(bla1 - bla0)) < 1e-5) + print('SUCCESS!!! z=0 slice agrees between different datasets') + return None + +if __name__ == '__main__': + main() +