Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Viewer Intensity plotted correctly with slow/faulty files #2488

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MikeSullivan7
Copy link
Collaborator

@MikeSullivan7 MikeSullivan7 commented Jan 29, 2025

Issue Closes #2487

Description

The Live Viewer is now triggered to update images both when an image enters the directory (e.g. when an incomplete file is transferred) and when an image is modified (e.g. when the file has finished transferring). A custom exception class ImageLoadFailError is now used to catch errors involved when attempting to load a faulty file. Exception handling is used to prevent the intensity from being calculated for an incomplete file, both when a file enters and when the ROI is moved.

Developer Testing

Both unit tests and system tests pass on both Windows and Linux

Acceptance Criteria and Reviewer Testing

  • Unit tests pass locally: make check, make test-system
  • Open Live Viewer with the Intensity Plot activated.
  • Run the simulator with slow mode and tiff files, e.g. python scripts/simulate_live_data.py -s /data/imaging/tof/MCP_Fe_Calibration/Fe_Powder_Run1_PH60_Dis50mm_NewShutter/Corrected/ -d /tmp/live_test/ -r 1 --mode slow
  • Check that the intensity is being plotted as expected and no error dialog pops up
  • Move the ROI with faulty files in the directory to check that the intensity plot ignores them and displays correctly

Documentation and Additional Notes

[ ] Release Notes have been updated

@MikeSullivan7 MikeSullivan7 force-pushed the 2497_LV_Intensity_slow_files branch from fbd6721 to c6af5a8 Compare January 30, 2025 09:57
@MikeSullivan7 MikeSullivan7 changed the title 2497 lv intensity slow files Live Viewer Intensity plotted correctly with slow/faulty files Jan 30, 2025
@coveralls
Copy link

coveralls commented Jan 30, 2025

Coverage Status

coverage: 73.058% (-0.02%) from 73.075%
when pulling cabeb6f on 2497_LV_Intensity_slow_files
into dbede8a on main.

@MikeSullivan7 MikeSullivan7 marked this pull request as ready for review January 30, 2025 11:22
@MikeSullivan7 MikeSullivan7 self-assigned this Jan 30, 2025
@@ -50,11 +51,14 @@ def _remove_oldest_image(self) -> None:
def use_loading_function(self, func: typing.Callable) -> None:
self.loading_func = func

def load_image(self, image: Image_Data) -> np.ndarray:
def load_image(self, image: Image_Data) -> np.ndarray | None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be np.ndarray | None, it looks like it either returns the array or raises an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live Viewer Intensity Profile not working with slow/faulty images
3 participants