Skip to content

Commit 684ecea

Browse files
Add more logging (#456)
Co-authored-by: Stephen Riggs <[email protected]>
1 parent 9a76bbc commit 684ecea

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/murfey/client/contexts/spa_metadata.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ def post_transfer(
113113
windows_path = data["EpuSessionXml"]["Samples"]["_items"]["SampleXml"][0][
114114
"AtlasId"
115115
]["#text"]
116+
logger.info(f"Windows path to atlas metadata found: {windows_path}")
116117
visit_index = windows_path.split("\\").index(environment.visit)
117118
partial_path = "/".join(windows_path.split("\\")[visit_index + 1 :])
119+
logger.info("Partial Linux path successfully constructed from Windows path")
118120

119121
source = _get_source(transferred_file, environment)
120122
if not source:
@@ -125,9 +127,13 @@ def post_transfer(
125127

126128
source_visit_dir = source.parent
127129

130+
logger.info(
131+
f"Looking for atlas XML file in metadata directory {str((source_visit_dir / partial_path).parent)}"
132+
)
128133
atlas_xml_path = list(
129134
(source_visit_dir / partial_path).parent.glob("Atlas_*.xml")
130135
)[0]
136+
logger.info(f"Atlas XML path {str(atlas_xml_path)} found")
131137
with open(atlas_xml_path, "rb") as atlas_xml:
132138
atlas_xml_data = xmltodict.parse(atlas_xml)
133139
atlas_original_pixel_size = atlas_xml_data["MicroscopeImage"][
@@ -136,14 +142,15 @@ def post_transfer(
136142

137143
# need to calculate the pixel size of the downscaled image
138144
atlas_pixel_size = atlas_original_pixel_size * 7.8
145+
logger.info(f"Atlas image pixel size determined to be {atlas_pixel_size}")
139146

140147
sample = None
141148
for p in partial_path.split("/"):
142149
if p.startswith("Sample"):
143150
sample = int(p.replace("Sample", ""))
144151
break
145152
else:
146-
logger.warning(f"Sample could not be indetified for {transferred_file}")
153+
logger.warning(f"Sample could not be identified for {transferred_file}")
147154
return
148155
if source:
149156
environment.samples[source] = SampleInfo(

0 commit comments

Comments
 (0)