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

Enhanced Image Stack Loading and Operation Handling for Flat-fielding Tests #2176

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

ashmeigh
Copy link
Collaborator

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

@coveralls
Copy link

coveralls commented May 14, 2024

Coverage Status

coverage: 72.73% (-0.04%) from 72.771%
when pulling 4a8194a on flat_op_test
into fb03173 on main.

Comment on lines 105 to 106
if dark_before is None and dark_after is None:
raise ValueError("Missing stack: dark_before or dark_after is required for 'Both, concatenated'")
Copy link
Collaborator

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.

Comment on lines 129 to 130
else:
dark_avg = np.zeros_like(flat_avg)
Copy link
Collaborator

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.

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a 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.

scripts/operations_tests/operations_tests.py Outdated Show resolved Hide resolved
scripts/operations_tests/operations_tests.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a 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.

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Jun 10, 2024
Merged via the queue into main with commit 42e4167 Jun 10, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the flat_op_test branch June 10, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants