gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #13565] Add non-linear warpings.


From: Pedram Ashofteh Ardakani
Subject: [task #13565] Add non-linear warpings.
Date: Wed, 9 Feb 2022 13:25:34 -0500 (EST)

Update of task #13565 (project gnuastro):

                  Status:               Postponed => In Progress            
        Percent Complete:                      0% => 60%                    
             Assigned to:                    None => pedram                 

    _______________________________________________________

Follow-up Comment #4:

Hi all. I have been working on nonlinear warp with Mohammad on this git branch
<https://codeberg.org/pedramardakani/gnuastro/src/branch/dev-from-scratch>.

You can see a comparison between the original image (file tpv.fits), SWARP
output (file tpv-aligned-swarp.fits), and gnuastro's still in development warp
program (file tpv-aligned-warp.fits).

Warp is using the 'gal_wcs_img_to_world' and 'gal_wcs_world_to_img' functions
based on WCSLIB to put the nonlinear distortions into effect.

Here is a summary of what goes on under the hood. First, we project all four
corners of the input image from pixel coordinates to RA and Dec using
'gal_wcs_img_to_world'. This puts the nonlinear distortions into effect. With
this, we can find out the min and max RA and Dec values for this image. Then,
using the user-given pixel scale (or the average of both pixel scales by
default), the output image size is defined.

Now that the output image size is determined, we sweep the output image pixels
one by one and project them back to the original image to see how much of each
input image pixels is covered by the corresponding output image. For instance,
see (file coverage.jpg).

In image (file coverage.jpg) it is shown that the 200th pixel of the output
image, is covering pixels 611, 612, 633, and 634 of the input image. The 200th
pixel corners are shown in points 0, 1, 2, and 3 marked with 'x' in cyan
color. The smaller red boxes show the input image pixel center, with their
number on the left, and value after the ':'. For example, the top left red
input pixel is the 633th pixel, with value 2724.98. The larger red box shows
all input pixels that are partially covered by the output pixel.

Now, the percentage of overlap between the output pixel (connect the cyan
points in anti-clockwise order by their number) and the input pixels are
calculated. For example, pixel 633 has the most, and 611 the least coverage
percentage. Let's say that the output pixel is covering about 70% of pixel
633. In this case, we check pixel 633's value (i.e. 2724.98) and multiply by
the amount of coverage (i.e. 0.7). Then, we'd do the same for the other three.
In the final step, all four values are added up and stored in pixel 200 of the
output image.

Note that if the pixel coverage is too small, we'll use NaN for that pixel.
For instance, when the output pixel is not covering any of the input pixel
(yes, this happens on outer perimeter of the image!).

The final step is to correct the output image's WCS, which is a work in
progress. You can use astwarp in its early stage for astrometry as soon as the
WCS is calculated (we're almost there).

Again, you can inspect the source code on this git branch
<https://codeberg.org/pedramardakani/gnuastro/src/branch/dev-from-scratch>.
Any comments would be appreciated.

Please let me know if you have any questions or concerns.


(file #52827, file #52828, file #52829)
    _______________________________________________________

Additional Item Attachment:

File name: tpv.fits                       Size:1043 KB
    <https://file.savannah.gnu.org/file/tpv.fits?file_id=52827>

File name: tpv-aligned-swarp.fits         Size:1186 KB
    <https://file.savannah.gnu.org/file/tpv-aligned-swarp.fits?file_id=52828>

File name: coverage.jpg                   Size:72 KB
    <https://file.savannah.gnu.org/file/coverage.jpg?file_id=52829>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?13565>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]