Skip to content

Commit

Permalink
Fix writing mrc file bug (#40)
Browse files Browse the repository at this point in the history
* Fixes bug if mrc file doesnt exist

* Streamlined

* Update lil_aretomo/utils.py

Co-authored-by: alisterburt <[email protected]>
  • Loading branch information
EuanPyle and alisterburt authored Sep 1, 2022
1 parent 0c3db23 commit e7cea7e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lil_aretomo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e7cea7e

Please sign in to comment.