Skip to content

Commit

Permalink
Symlink into first directory of full path
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalbakshi committed Oct 4, 2023
1 parent 65623c2 commit 472a4f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion element_calcium_imaging/imaging_no_curation.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def make(self, key):
print(outbox_symlink_path)
outbox_symlink_path.mkdir(parents=True, exist_ok=True)
print("folder created.")
np.save((outbox_symlink_path / "bad_frames.npy"), drop_frames)
np.save(pathlib.Path(*outbox_symlink_path.parts[:2]) / "bad_frames.npy", drop_frames)
print("array saved")

raw_image_files = (scan.ScanInfo.ScanFile & key).fetch("file_path")
Expand All @@ -546,6 +546,9 @@ def make(self, key):
else:
image_files.append((outbox_symlink_path / file.name))
continue

if not (pathlib.Path(*outbox_symlink_path.parts[:2]) / "bad_frames.npy").is_symlink():
(pathlib.Path(*outbox_symlink_path.parts[:2]) / "bad_frames.npy").symlink_to(outbox_symlink_path / "bad_frames.npy")
else:
image_files = (scan.ScanInfo.ScanFile & key).fetch("file_path")
image_files = [
Expand Down

0 comments on commit 472a4f4

Please sign in to comment.