You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are different wcs definitions especially for polynomial. There is Sip class for constructing tan-sip programmatically, but for TPV TPD or anything else, seems that no way to build an empty wcs with parameters initialized, even I could not find a way to modify the TPV parameters.
I see that astropy expose the wcsprm and tabprm struct of wcslib to python, but no disprm and dpkey, is that why astropy can initial TPV only from header.
@fockez TL;DR It's not possible currently to create a TPV distortion programmatically.
To give some background on this. wcslib did not implement distortions until early 5.x. astropy.wcs had an implementaiton of SIP and LookupTable distortion long before that. This was done as a layer on top of wcslib. When wcslib implemented distortions an attempt was made to start using SIP from wcslib. However there were issues with inverse and roundtripping of coefficients which needed to be fixed in wcslib. So this aproach was abandoned and astropy.wcs continued using Sip from the python layer. As far as I can tell from the wcslib Change log this issue has not been worked out. Meanwhile TPV and the rest of the polynomials are implemented in wcslib only. Hence there's a difference in what can be done with Sip and the rest of the polynomials. Some of the relevant PRs are #3751, #3845, #3878.
I understand the difference between Sip and other polynomials. I mean, the base wcs Wcsprm is implemented, can the disprm be implemented as well? Or scheduled.
Activity
fockez commentedon Jul 23, 2017
I see that astropy expose the wcsprm and tabprm struct of wcslib to python, but no disprm and dpkey, is that why astropy can initial TPV only from header.
nden commentedon Jul 23, 2017
@fockez TL;DR It's not possible currently to create a TPV distortion programmatically.
To give some background on this.
wcslibdid not implement distortions until early 5.x.astropy.wcshad an implementaiton ofSIPandLookupTabledistortion long before that. This was done as a layer on top ofwcslib. Whenwcslibimplemented distortions an attempt was made to start using SIP fromwcslib. However there were issues with inverse and roundtripping of coefficients which needed to be fixed inwcslib. So this aproach was abandoned andastropy.wcscontinued usingSipfrom the python layer. As far as I can tell from thewcslibChange log this issue has not been worked out. MeanwhileTPVand the rest of the polynomials are implemented inwcslibonly. Hence there's a difference in what can be done withSipand the rest of the polynomials. Some of the relevant PRs are #3751, #3845, #3878.fockez commentedon Jul 27, 2017
I understand the difference between Sip and other polynomials. I mean, the base wcs Wcsprm is implemented, can the disprm be implemented as well? Or scheduled.
nden commentedon Jul 27, 2017
I think this was attempted in #3845 and did not quite work. I'm setting the milestone to
Futurein case someone has the time to do it.