Skip to content

Commit

Permalink
Check if TES data even exists before trying to export it
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtitus committed Nov 12, 2024
1 parent ff6f07b commit a1b3d6b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion export_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from os.path import join
from tiled.client import from_uri
from autoprocess.statelessAnalysis import get_tes_data
from autoprocess.utils import run_is_processed


def initialize_tiled_client(beamline_acronym):
Expand Down Expand Up @@ -125,7 +126,12 @@ def get_run_data(run, omit=[]):
# Add a try-except here after testing
save_directory = join(get_proposal_path(run), "ucal_processing")

rois, tes_data = get_tes_data(run, save_directory)
if run_is_processed(run, save_directory):
rois, tes_data = get_tes_data(run, save_directory)
else:
print(f"No TES Data is Processed for {run.start['scan_id']}")
rois = {}
tes_data = {}
for key in usekeys:
if len(data[key].shape) == 1:
if key in tes_data:
Expand Down

0 comments on commit a1b3d6b

Please sign in to comment.