GNU Astronomy Utilities - Bugs: bug #63171, Strange patterns on warped images
You are not allowed to post comments on this tracker with your current authentication level.
bug #63171: Strange patterns on warped images
Submitter: | Raul Infante-Sainz <infantesainz> | ||
Submitted: | Thu 06 Oct 2022 03:59:57 PM UTC | ||
Category: | Warp | Severity: | 3 - Normal |
Item Group: | Output not reasonable | Status: | Fixed |
Privacy: | Public | Assigned to: | pedram |
Open/Closed: | Closed |
Jump to the original submission
Mon 24 Oct 2022 08:00:41 AM UTC, comment #19: |
Pedram Ashofteh-Ardakani <pedram> |
Mon 17 Oct 2022 04:25:47 PM UTC, comment #18: While I was talking about this feature (Moiré pattern) with David Muniesa (at CEFCA), he mentioned that the SWarp manual also talks about it in Figure 7 on page 20 (of the latest version from December 17, 2010). The proposed solution there is also oversampling!
|
Mohammad Akhlaghi <makhlaghi> |
Sun 16 Oct 2022 04:29:20 PM UTC, comment #17: Hi there everyone, I've added the '--pixareaonwcs' option as Mohammad suggested. Here is the result for the two images you shared here, the JPLUS 'm51.fits' and Raul's 'img.fits'.
|
Pedram Ashofteh-Ardakani <pedram> |
Wed 12 Oct 2022 09:18:19 AM UTC, comment #16: Nice catch Raul! I forgot about '--envseed' 🤦
|
Pedram Ashofteh-Ardakani <pedram> |
Wed 12 Oct 2022 07:07:19 AM UTC, comment #15: I solved my previous doubts. Pedram, just by using your code the noise image is different each time. You need also to use the option '--envseed' and specify the type of the random seed generator. So, something like:
|
Raul Infante-Sainz <infantesainz> |
Wed 12 Oct 2022 06:59:02 AM UTC, comment #14: Thanks a lot Pedram and Mohammad.
|
Raul Infante-Sainz <infantesainz> |
Tue 11 Oct 2022 08:16:02 PM UTC, comment #13: ;; This buffer is for text that is not saved, and for Lisp evaluation.
|
Pedram Ashofteh-Ardakani <pedram> |
Tue 11 Oct 2022 03:26:33 PM UTC, comment #12: Thanks for the nice tests Pedram and Raul.
|
Mohammad Akhlaghi <makhlaghi> |
Mon 10 Oct 2022 10:16:35 PM UTC, comment #11: Thanks a lot for investigating this Pedram! You are right, I have been playing a bit with the images and I can clearly see the same pattern on SWarped images. But the effect is less strong so we didn't notice that until now.
|
Raul Infante-Sainz <infantesainz> |
Mon 10 Oct 2022 05:22:49 PM UTC, comment #10: SWarp is showing the same pattern in the JPLUS M51 image as well (comment #5)! If you can't spot it, download the image and look more closer (it is visible, but Warp has more pronounced intensity). Here are the steps to make these images so you'd be able to play with it yourselves 🤩
|
Pedram Ashofteh-Ardakani <pedram> |
Mon 10 Oct 2022 04:27:37 PM UTC, comment #9: I thought maybe we can spot some difference between Warp and SWarp. So I made these two images:
|
Pedram Ashofteh-Ardakani <pedram> |
Mon 10 Oct 2022 04:06:31 PM UTC, comment #8: I've compared the Original image with SWarp and Warp in the 'bug_63171.jpg' file. It looks like this pattern emerges around '100' value. So the scale is set from 50 to 150 where this is best visible.
|
Pedram Ashofteh-Ardakani <pedram> |
Mon 10 Oct 2022 02:50:45 PM UTC, comment #7: Nice catch! First I tried --edgesampling but then I thought of smaller CDELT as well.
|
Pedram Ashofteh-Ardakani <pedram> |
Mon 10 Oct 2022 02:33:47 PM UTC, comment #6: However, the work-around suggested below (to use a smaller pixel scale) will be slow; so its not an optimal solution; just a work-around for now. |
Mohammad Akhlaghi <makhlaghi> |
Mon 10 Oct 2022 02:16:10 PM UTC, comment #5: I just noticed that this problem also occurs on J-PLUS images. For example, with the command below, you can download a single-exposure J-PLUS image and see the effect after running Warp:
|
Mohammad Akhlaghi <makhlaghi> |
Mon 10 Oct 2022 07:16:09 AM UTC, comment #4: Thanks for pointing this out Raul! And Mohammad, thank you for investigating in detail and defining task #16272 🙌
|
Pedram Ashofteh-Ardakani <pedram> |
Thu 06 Oct 2022 05:58:27 PM UTC, comment #3: This bug inspired me to define task #16272. It will be very useful in understanding the distortion of a camera, and visualizing things like this.
|
Mohammad Akhlaghi <makhlaghi> |
Thu 06 Oct 2022 05:25:01 PM UTC, comment #2: I just noticed small typo in the second example command demonstrating overflow, in the last comment line, I should have written "# Because 518 = 256*2 + 6". |
Mohammad Akhlaghi <makhlaghi> |
Thu 06 Oct 2022 05:21:28 PM UTC, comment #1: What an interesting scenario! There are two different factors at play here which can be summarized in this image:
|
Mohammad Akhlaghi <makhlaghi> |
Thu 06 Oct 2022 03:59:57 PM UTC, original submission:
In Gnuastro 0.18.65-7933d, the output of warped images have strange patterns. I found this issue when testing the new features on some images. Let me reproduce and describe the problem step by step.
|
Raul Infante-Sainz <infantesainz> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 25 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2022-10-24 | pedram | Status | In Progress | Fixed | |
Open/Closed | Open | Closed | |||
2022-10-24 | pedram | Attached File | - | Added jplus-warp-oversample.jpg, #53899 | |
Attached File | - | Added jplus-warp-reg-maxfrac.jpg, #53900 | |||
Attached File | - | Added jplus-warp-reg.jpg, #53901 | |||
Attached File | - | Added jplus-stack.jpg, #53902 | |||
2022-10-16 | pedram | Attached File | - | Added m51_and_img_pixarea.jpg, #53865 | |
2022-10-12 | pedram | Attached File | - | Added ones-pv-warp.jpg, #53841 | |
Attached File | - | Added ones-pv.reg, #53842 | |||
2022-10-11 | pedram | Attached File | - | Added m51-ones-pv.jpg, #53837 | |
Attached File | - | Added m51-noise-pv.jpg, #53838 | |||
Attached File | - | Added m51-ones-no-pv.jpg, #53839 | |||
Attached File | - | Added m51-noise-no-pv.jpg, #53840 | |||
2022-10-10 | pedram | Attached File | - | Added m51-jplus.jpg, #53833 | |
2022-10-10 | pedram | Attached File | - | Added warp-minus-swarp.jpg, #53831 | |
2022-10-10 | pedram | Attached File | - | Added bug_63171.jpg, #53830 | |
2022-10-10 | pedram | Attached File | - | Added img.jpg, #53827 | |
Attached File | - | Added img_pixelareaonwcs.jpg, #53828 | |||
2022-10-10 | makhlaghi | Status | None | In Progress | |
Assigned to | None | pedram | |||
2022-10-06 | makhlaghi | Attached File | - | Added area-after-warp.jpg, #53808 | |
2022-10-06 | makhlaghi | Attached File | - | Added strong-distortion.png, #53807 | |
2022-10-06 | makhlaghi | Attached File | - | Added two-features.png, #53806 | |
2022-10-06 | infantesainz | Attached File | - | Added warped-float32.png, #53803 | |
Attached File | - | Added img.fits, #53804 |
Powered by Savane 3.13-f8d8.
Corresponding source code
Hi all 👋
We've made the new commit [1] which discusses where these Moire patterns come from, and some ways to mitigate/remove them in the 'Moire pattern and its correction' section under 'Warp'.
[1] https://git.savannah.gnu.org/cgit/gnuastro.git/commit/?id=b58b49872b
Thanks to Mohammad's nice example demonstration in the Book [2] and the new '--checkmaxfrac' option in Warp, we have a way to visually inspect the effect - see (file jplus-warp-reg.jpg) and (file jplus-warp-reg-maxfrac.jpg), and quantify it by interpreting the 'Statistics' of the 'MAX-FRAC' HDU which is added to the Warped image if '--checkmaxfrac' is given, see [2].
[2] https://www.gnu.org/software/gnuastro/manual/html_node/Moire-pattern-and-its-correction.html
Also, we can see that stacking the 'dithered' images helps resolve this issue in the most precise way, potentially even improving the spatial resolution of the image. It is worthy of note that stacking 'dithered' images can create deeper images - see (file jplus-stack.jpg).
Please note that scales and limits are not exactly the same in the images attached here, I tried to make them look similar. But you can make all of them yourself following the instructions in [2].
Hopefully now things are making more sense. Please feel free to let us know and continue the conversation if anything comes up.
Best,
Pedram