-
Notifications
You must be signed in to change notification settings - Fork 6
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
Enhanced Image Stack Loading and Operation Handling for Flat-fielding Tests #2176
Conversation
if dark_before is None and dark_after is None: | ||
raise ValueError("Missing stack: dark_before or dark_after is required for 'Both, concatenated'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be inside the if use_dark:
a few lines below. Otherwise its check for dark even when its not needed.
Also should be or
, because if either is missing it is a problem.
else: | ||
dark_avg = np.zeros_like(flat_avg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the multiple dark_avg = np.zeros_like(flat_avg)
stay outside the big if statement, so that its only needed once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This working and looking good. A few small changes to avoid adding print statements.
Also this will need a rebase once #2215 is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All working well now. Code looks good.
Description
Conditional Loading: The load_image_stack function has been modified to conditionally load flat and dark images along with the main image stack if the test case is for "Flat-fielding".
FilenameGroup Integration: Utilizes FilenameGroup for managing file paths and ensuring that required files (e.g., log files, flat, and dark images) are correctly loaded.
Enhanced Parameter Handling: Parameters for the operations are dynamically updated to include loaded flats and darks which are essential for "Flat-fielding".
Testing
Flat-fielding with Complete Data: All required flats and darks are specified and available. The function should correctly load these images and use them in the operation.
Acceptance Criteria
Run tests using both "Flat-fielding" and other operations to ensure the function reacts appropriately.
Specifically, test with missing files for "Flat-fielding" to see that the function handles errors as expected.
Integration Check: Confirm that changes do not disrupt the existing setup and integrate cleanly with the current test suite