Skip to content

Commit

Permalink
find TiffSever directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanmcreynolds committed Mar 15, 2024
1 parent 265c07e commit ce49038
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/tiled_ingestor/activemq/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ def start_consumer():
if scan_listener.messages:
new_file_path = scan_listener.messages.popleft()
try:
logger.info("Received File")
logger.info(f"Ingesting file: {new_file_path}")
# we get a path to the nexus file, but we want the TiffSaver_3 file next to it
# we get a path to the nexus file, but we want the TiffSaver file next to it
nxs_path = Path(new_file_path)
tiff_path = nxs_path.parent / Path("TiffSaver_3")
asyncio.run(process_file(str(tiff_path), tiled_config, path_prefix="reconstructions"))
# Tiffs are in a folder whose name starts with `TiffSaver_` and has an integer appended
tiff_saver_candidates = list(nxs_path.parent.glob("TiffSaver*"))
if len(tiff_saver_candidates) > 0:
asyncio.run(process_file(str(tiff_saver_candidates[0]), tiled_config, path_prefix="reconstructions"))
else:
logger.warning(f"Cannot find Tiffs for nexus file {new_file_path}")
except Exception as e:
print("Failed to process file " + new_file_path)
print(str(e))
Expand Down
3 changes: 2 additions & 1 deletion src/tiled_ingestor/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ async def process_file(
process_file(
# "/dls/k11/data/2024/mg37376-2/processing/mg32801-1/processed/Savu_k11-37074_full_fd_Fresnel_rmrings_vo_AST_tiff/TiffSaver_5",
# "/dls/tmp/mlex/mlex_tomo_framework/data/tiled_storage/recons/rec20240207_120550_test_no_xrays_n257",
"/dls/k11/data/2024/mg37376-1/processed/Savu_k11-38639_3x_fd_vo_AST_tiff/TiffSaver_3",
# "/dls/k11/data/2024/mg37376-1/processed/Savu_k11-38639_3x_fd_vo_AST_tiff/TiffSaver_3",
"/dls/k11/data/2024/mg37376-1/processing/i23_data/tiff",
tiled_config,
path_prefix="reconstructions",
)
Expand Down

0 comments on commit ce49038

Please sign in to comment.