| import os | |
| import numpy as np | |
| input_dir = "./ns_split_3" | |
| output_path = "./NS-Re500_T300_id0.npy" | |
| part_files = sorted([ | |
| os.path.join(input_dir, f) for f in os.listdir(input_dir) | |
| if f.endswith(".npy") and f.startswith("ns_part_") | |
| ]) | |
| arrays = [np.load(path) for path in part_files] | |
| merged = np.concatenate(arrays, axis=0) | |
| np.save(output_path, merged) | |
| print(f"Merged file saved to: {output_path}") | |