Skip to content

Commit 3ac92da

Browse files
committed
Need to add tag to gain directory
1 parent 3252c80 commit 3ac92da

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/murfey/server/gain.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ class Camera(Enum):
1818
FALCON = 3
1919

2020

21-
def _sanitise(gain_path: Path) -> Path:
22-
dest = gain_path.parent / "gain" / gain_path.name.replace(" ", "_")
21+
def _sanitise(gain_path: Path, tag: str) -> Path:
22+
if tag:
23+
dest = gain_path.parent / f"gain_{tag}" / gain_path.name.replace(" ", "_")
24+
else:
25+
dest = gain_path.parent / "gain" / gain_path.name.replace(" ", "_")
2326
dest.write_bytes(gain_path.read_bytes())
2427
return dest
2528

@@ -57,7 +60,7 @@ async def prepare_gain(
5760
secure_path(gain_path.parent / f"gain_{tag}").mkdir(exist_ok=True)
5861
else:
5962
secure_path(gain_path.parent / "gain").mkdir(exist_ok=True)
60-
gain_path = _sanitise(gain_path)
63+
gain_path = _sanitise(gain_path, tag)
6164
flip = "flipx" if camera == Camera.K3_FLIPX else "flipy"
6265
gain_path_mrc = gain_path.with_suffix(".mrc")
6366
gain_path_superres = gain_path.parent / (gain_path.name + "_superres.mrc")

0 commit comments

Comments
 (0)