Skip to content

Commit fd3414d

Browse files
committed
Added logs to keep track of atlas image conversion workflow
1 parent 0b24c71 commit fd3414d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/murfey/client/contexts/atlas.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ def post_transfer(
4747
f"{str(environment.url.geturl())}{url_path_for('session_control.spa_router', 'make_atlas_jpg', session_id=environment.murfey_session)}",
4848
json={"path": str(transferred_atlas_name)},
4949
)
50+
logger.info(
51+
f"Submitted request to create JPG image of atlas {str(transferred_atlas_name)!r}"
52+
)

src/murfey/server/api/session_control.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ def get_foil_hole(
352352
def make_atlas_jpg(
353353
session_id: MurfeySessionID, atlas_mrc: StringOfPathModel, db=murfey_db
354354
):
355+
logger.debug(f"Received request to create JPG image of atlas {atlas_mrc.path!r}")
355356
session = db.exec(select(Session).where(Session.id == session_id)).one()
356357
return atlas_jpg_from_mrc(
357358
session.instrument_name, session.visit, Path(atlas_mrc.path)

src/murfey/workflows/spa/atlas.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
from pathlib import Path
23

34
import mrcfile
@@ -6,8 +7,11 @@
67

78
from murfey.util.config import get_machine_config
89

10+
logger = logging.getLogger("murfey.workflows.spa.atlas")
11+
912

1013
def atlas_jpg_from_mrc(instrument_name: str, visit_name: str, atlas_mrc: Path):
14+
logger.debug(f"Starting workflow to create JPG image of atlas {atlas_mrc}")
1115
with mrcfile.read(atlas_mrc) as mrc:
1216
data = mrc.data
1317

@@ -33,3 +37,4 @@ def atlas_jpg_from_mrc(instrument_name: str, visit_name: str, atlas_mrc: Path):
3337

3438
im = PIL.Image.fromarray(data)
3539
im.convert(mode="L").save(atlas_jpg_file)
40+
logger.debug(f"JPG image of atlas saved as {atlas_jpg_file}")

0 commit comments

Comments
 (0)