From e7cea7e4f1dd95e5bc0ddd4516e571f26d78d119 Mon Sep 17 00:00:00 2001 From: EuanPyle Date: Thu, 1 Sep 2022 13:57:19 +0100 Subject: [PATCH] Fix writing mrc file bug (#40) * Fixes bug if mrc file doesnt exist * Streamlined * Update lil_aretomo/utils.py Co-authored-by: alisterburt --- lil_aretomo/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lil_aretomo/utils.py b/lil_aretomo/utils.py index 7c30fb8..924594d 100644 --- a/lil_aretomo/utils.py +++ b/lil_aretomo/utils.py @@ -19,6 +19,7 @@ def prepare_output_directory( directory.mkdir(exist_ok=True, parents=True) tilt_series_file = directory / f'{basename}.mrc' + data_on_disk_shape = None if tilt_series_file.exists(): with mrcfile.open(tilt_series_file, header_only=True) as mrc: data_on_disk_shape = (mrc.header.nz, mrc.header.ny, mrc.header.nx)