GNU Astronomy Utilities - Tasks: task #15128, TPV and SIP keywords when WCS...
You are not allowed to post comments on this tracker with your current authentication level.
task #15128: TPV and SIP keywords when WCS distortions are necessary
Submitter: | Mohammad Akhlaghi <makhlaghi> | ||
Submitted: | Fri 21 Dec 2018 02:27:13 PM UTC | ||
Should Start On: | Fri 21 Dec 2018 12:00:00 AM UTC | Should be Finished on: | Fri 21 Dec 2018 12:00:00 AM UTC |
Category: | All Gnuastro | Priority: | 5 - Normal |
Item Group: | Enhancement | Status: | Postponed |
Privacy: | Public | Assigned to: | sks_15 |
Percent Complete: | 100% | Open/Closed: | Closed |
Effort: | 0.00 |
Jump to the original submission
Sat 13 Jun 2020 07:26:22 AM UTC, comment #36: |
Sachin Kumar Singh <sks_15> |
Sat 13 Jun 2020 06:08:24 AM UTC, comment #35: I am happy to say that Sachin's great work is now fully merged into Gnuastro master branch (in Commit 7da840d4 and this task is officially closed :-) :-) :-).
|
Mohammad Akhlaghi <makhlaghi> |
Thu 11 Jun 2020 05:27:29 PM UTC, comment #34: Great! Thanks Sachin.
|
Mohammad Akhlaghi <makhlaghi> |
Thu 11 Jun 2020 11:34:41 AM UTC, comment #33: The new library `wcsdistortion` is tested and pushed on github and gitlab.
|
Sachin Kumar Singh <sks_15> |
Tue 09 Jun 2020 10:54:09 AM UTC, comment #32: Great Sachin!
|
Zahra Sharbaf <samaeh> |
Mon 08 Jun 2020 11:12:49 AM UTC, comment #31: Great work! I think it would be better to have a program in Gnuastro devoted to WCS-related operations. I think next steps are related with having in Gnuastro a program to obtain the astrometric solution of images. So, I would start having a program for all of this WCS-related things :-) |
Raul Infante-Sainz <infantesainz> |
Sun 07 Jun 2020 10:44:21 PM UTC, comment #30: This is great Sachin! This task is almost complete, so I marked it as 80% completed. All that is left is (as you said, sanity checks) and also an interface.
|
Mohammad Akhlaghi <makhlaghi> |
Sun 07 Jun 2020 10:29:17 PM UTC, comment #29: task #15676 is done and closed now. The final headers are shown there along with the code for the same. Now basic sanitisation of code remains(sanity and error checks and code format) before porting it in Gnuastro. |
Sachin Kumar Singh <sks_15> |
Fri 05 Jun 2020 06:48:35 PM UTC, comment #28: The TPV->SIP conversions are done and task #15670 is closed. Headers from both the astropy and the test Gnuastro library are shown there along with links to the repository:-)
|
Sachin Kumar Singh <sks_15> |
Tue 02 Jun 2020 09:54:26 PM UTC, comment #27: Yes, he really helped a lot. So, I'll make the new branch and start exporting changes from the test library to it and also thank him. |
Sachin Kumar Singh <sks_15> |
Tue 02 Jun 2020 09:43:55 PM UTC, comment #26: This is great! Good work Sachin :-)!
|
Mohammad Akhlaghi <makhlaghi> |
Tue 02 Jun 2020 09:37:50 PM UTC, comment #25: task #15669, which was a subtask of this task is done and closed. I've compared the results of both the sip_tpv and my implementation there and also provided links to the code and scripts.
|
Sachin Kumar Singh <sks_15> |
Sun 31 May 2020 12:33:32 PM UTC, comment #24: The reason of not having the equations is that the problem doesn't have an analytical solution? In that case I think the way is to follow the Python implementation (as you said), and let see how it goes. I think the final solution would be avoid using PV, which is only necessary because Swarp uses them. But in that case we will need a program (astwarp?) which where able to take as input the SIP distortion parameters to resample the image. Thanks for the great job! |
Raul Infante-Sainz <infantesainz> |
Sat 30 May 2020 10:37:12 AM UTC, comment #23: The forward coefficients were done, but problems arose during the implementation of reverse coefficients. It was also not easy to emulate the python implementation without equations(which were not given in the paper). So I asked the maintainer of sip_tpv module, David Shupe, to give me inner workings of different components to help me with the implementation. He replied back:
|
Sachin Kumar Singh <sks_15> |
Tue 26 May 2020 07:47:29 AM UTC, comment #22: After a bit more digging, it seems the WCSLIB doesn't have the functionality for the desired inter-distortion conversions. I tried to convert the SCAMP output containing PV coefficients to TPD. The results are attached in the file. As can be seen, there are no real conversions due to absence of required parameters in the input fits file.
|
Sachin Kumar Singh <sks_15> |
Mon 18 May 2020 11:34:50 PM UTC, comment #21: Good progress! I have had a general look at it and you seem to be on the right path ;-).
|
Mohammad Akhlaghi <makhlaghi> |
Mon 18 May 2020 11:12:36 PM UTC, comment #20: I read the wcslib's official documentation and now have an understanding of it's working, at least for the current task. I am enlisting the points below:
|
Sachin Kumar Singh <sks_15> |
Mon 18 May 2020 11:27:23 AM UTC, comment #19: Thanks a lot, Raul! We're trying to fix this conversion and trying to generalise it to accommodate more such distortion conversions into a single distortion coefficient, TPD. Any help and feedback is deeply appreciated:-) |
Sachin Kumar Singh <sks_15> |
Mon 18 May 2020 08:33:02 AM UTC, comment #18: Great work! I had problems with dealing with SIP and PV for correcting the optical distortion of images. If you need some feedback I can test the programs to check how it works. Thanks a lot guys. |
Raul Infante-Sainz <infantesainz> |
Sun 17 May 2020 10:26:39 PM UTC, comment #17: Yes ;-), first focus on the WCS features to possibly do the conversion using WCSLIB itself.
|
Mohammad Akhlaghi <makhlaghi> |
Sun 17 May 2020 10:22:24 PM UTC, comment #16: Also, as we now know about the general TPD distortion, I think WCSLIB must already have facilities for conversions of other distortion to TPD, which I think makes focusing on TPV to SIP conversion redundant. So should I proceed with it or should try to make functions that will simply read the distortions and write them as the TPD distortions? What do you suggest? |
Sachin Kumar Singh <sks_15> |
Sun 17 May 2020 10:11:20 PM UTC, comment #15: I mean with TPD distortion being a more generalized element already present in WCSLIB, I will try to find out how the individual distortion like the TPV to SIP changes can be done so that they can be incorporated in the general TPD distortions.
|
Sachin Kumar Singh <sks_15> |
Sun 17 May 2020 09:28:13 PM UTC, comment #14: Okay, so I'll see for all the changes(and additions) in the current implementation(like the usage of reverse coefficients and such) and will discuss the desired changes:-) |
Sachin Kumar Singh <sks_15> |
Sun 17 May 2020 08:58:51 PM UTC, comment #13: The algorithm implemented in the Python program is a very special case of just converting between SIP to TPV and vice-versa. But if we can find a way to use WCSLIB for this job (possibly through TPD), it is much more robust and general (allowing conversion between even more standards). It also allows us to avoid low-level matrix manipulation.
|
Mohammad Akhlaghi <makhlaghi> |
Sun 17 May 2020 08:51:53 PM UTC, comment #12: I look into it. But will it still be compatible with the program flow I've written till now? I mean willany major change be required? |
Sachin Kumar Singh <sks_15> |
Sun 17 May 2020 04:20:05 PM UTC, comment #11: Great! I am happy the problem with `rval' is clear now ;-).
|
Mohammad Akhlaghi <makhlaghi> |
Sun 17 May 2020 02:51:48 PM UTC, comment #10: Also, after a bit more inspection, it seems that the `rval` value is okay as it states in the SPIE paper that:
|
Sachin Kumar Singh <sks_15> |
Sun 17 May 2020 02:36:42 PM UTC, comment #9: Ok, I understand now! I'll check it out and will report the progess soon:-) |
Sachin Kumar Singh <sks_15> |
Sun 17 May 2020 02:29:05 AM UTC, comment #8: I just had a fast look at the WCSLIB manual mentioned before and noticed that you will probably find the dis.h File Reference (section 19.2 of the PDF manual) very useful in this work ;-). |
Mohammad Akhlaghi <makhlaghi> |
Sun 17 May 2020 02:14:16 AM UTC, comment #7: Sachin, as you dig deeper into WCSLIB and learn its inner structure, please avoid direct manipulation of the raw 'wcsprm' elements in the main conversion function. Rather, define functions to abstract these low-level steps-away.
|
Mohammad Akhlaghi <makhlaghi> |
Fri 15 May 2020 11:39:12 PM UTC, comment #6: By the way, just a small technical tip: If the file given to 'gal_fits_img_write' already exists, this function won't over-write it, it will append the given dataset as a new extension/HDU to the existing FITS file.
|
Mohammad Akhlaghi <makhlaghi> |
Fri 15 May 2020 11:32:01 PM UTC, comment #5: This is great progress Sachin, nice work!
|
Mohammad Akhlaghi <makhlaghi> |
Fri 15 May 2020 11:05:16 PM UTC, comment #4: The major computation part of the `pv2sip` is complete:). Now only the addition of the keywords in the header remains.
|
Sachin Kumar Singh <sks_15> |
Wed 13 May 2020 10:38:18 PM UTC, comment #3: Thanks for the nice progress report Sachin.
|
Mohammad Akhlaghi <makhlaghi> |
Wed 13 May 2020 10:14:43 PM UTC, comment #2: To help play with a real-world example, I just upload this example file: http://akhlaghi.org/data/astrometry/2923938133-pv.fits
|
Mohammad Akhlaghi <makhlaghi> |
Wed 13 May 2020 08:47:43 PM UTC, comment #1: I found these ELF 64-bit LSB binary executable files for sip2pv and pv2sip whose link for python program is given(the python programs are its prototypes).
|
Sachin Kumar Singh <sks_15> |
Fri 21 Dec 2018 02:27:13 PM UTC, original submission:
Currently, Gnuastro just uses WCSLIB's raw output when it wants to write WCS keywords that are distorted. In particular, it will use the SIP distortion coefficients (which has become the commonly used standard recently).
|
Mohammad Akhlaghi <makhlaghi> |
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 10 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2020-06-13 | makhlaghi | Item Group | None | Enhancement | |
Percent Complete | 80% | 100% | |||
Assigned to | None | sks_15 | |||
Open/Closed | Open | Closed | |||
2020-06-07 | makhlaghi | Percent Complete | 0% | 80% | |
Carbon-Copy | - | Added -email is unavailable- | |||
2020-05-26 | sks_15 | Attached File | - | Added header.txt, #49170 | |
2020-05-15 | makhlaghi | Carbon-Copy | - | Added -email is unavailable- | |
2020-05-15 | sks_15 | Attached File | - | Added temp-wcs.c, #49086 | |
2020-05-13 | pedram | Carbon-Copy | - | Added pedram |
Powered by Savane 3.13-f8d8.
Corresponding source code
Thanks a lot Mohammad for providing great help and support throughout the task. I just went through the commit and I see a lot of work done apart from the library for the interface. Thank you for taking time out of your busy schedule to help.
Also thanks to Raul, Samaeh and Pedram for providing valuable suggestions throughout this task.