From 204f83f9b75d56fde6ce66a41ab3a40e9046ba45 Mon Sep 17 00:00:00 2001 From: lauraporta <29216006+lauraporta@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:12:25 +0000 Subject: [PATCH] Expand description of one of the plotting hooks --- derotation/plotting_hooks/for_derotation.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/derotation/plotting_hooks/for_derotation.py b/derotation/plotting_hooks/for_derotation.py index 770ab01..08c42b4 100644 --- a/derotation/plotting_hooks/for_derotation.py +++ b/derotation/plotting_hooks/for_derotation.py @@ -40,12 +40,27 @@ def line_addition( plt.close() -def image_completed(derotated_image_stack, image_counter): +def image_completed( + derotated_image_stack: np.ndarray, + image_counter: int, + frame_of_interest: int = 149, +): """Hook for plotting the maximum projection of the derotated image stack after the first rotation (which ends ~149th frame) and the current derotated image. + + Parameters + ---------- + derotated_image_stack : np.ndarray + The derotated image stack. + image_counter : int + The current frame number. + frame_of_interest : int, optional + A frame number for which the maximum projection will be saved + by cumulating all the frames up to that frame. + Suggestion: set it to the last frame of the first rotation. """ - if image_counter == 149: + if image_counter == frame_of_interest: fig, ax = plt.subplots(1, 1, figsize=(10, 10)) ax.imshow( np.max(derotated_image_stack[:image_counter], axis=0),