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

Fix problematic resample step unit test #8506

Closed
stscijgbot-jp opened this issue May 24, 2024 · 4 comments · Fixed by #8620
Closed

Fix problematic resample step unit test #8506

stscijgbot-jp opened this issue May 24, 2024 · 4 comments · Fixed by #8620

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3634 was created on JIRA by Howard Bushouse:

While testing #8488 it was discovered that the unit test jwst/resample/tests/test_resample_step.py::test_custom_refwcs_resample_imaging

does not seem to do anything sensical. Using the given input param settings to the resample step, along with the size and WCS definitions of the "nircam_rate" test image, the resulting resampled product is zero-filled in all of the SCI, CON, and WHT arrays, indicating that no input pixels contribute to any output pixels. Something is clearly wrong with the definitions in the test setup that don't seem to match the WCS of the input image. This needs fixing or the test just needs to be retired.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Mihai Cara on JIRA:

I do not see anything wrong with this test but it appears that I am the one who designed it and so, maybe I am biased, or maybe I am thinking the same (wrong) way as I was thinking a year ago.

The test is set-up in the following way:

resample data to create an output image of a size different from the "default" (normal/expected) output size for the given image;

extract that output image WCS;

resample data (2nd attempt) but this time provide the WCS from the previous step as a custom reference WCS

repeat tests with a modified step 3 above in which we override custom WCS shape with user-provided output shape.

check that the output image size is exactly what is expected (either defined by the custom reference image from step 2 or user-provided output shape)

The fact that weight and context and data are all 0s or nan is irrelevant for this test and having some "real" data would not improve the test and just make the test run longer.

This test is checking that the code uses the provided custom reference WCS and that some of the custom reference WCS parameters (such as output shape) can be further overwritten by the user.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Melanie Clarke on JIRA:

I looked at this test as part of developing some new tests for JP-3547. 

It looks to me like the only problem with the test is that the custom CRVAL provided for the first pass resampling places the real data outside the resampled image.  I can send in a PR to use an override value that better matches the input data, and add some checks to make sure the output is both non-trivial and appropriate to the input.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Nadia Dencheva on JIRA:

Melanie Clarke I ran into the same issue while fixing a bug in gwcs. It would be good to have some reasonable values in the test.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Nadia Dencheva on JIRA:

Fixed in #8620

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

Successfully merging a pull request may close this issue.

1 participant