Skip to content

Upgrade wcslib to 5.x (using wcslib for SIP) - #3845

Closed
mdboom wants to merge 20 commits into
astropy:masterfrom
mdboom:wcs/upgrade-5.4
Closed

mdboom wants to merge 20 commits into
astropy:masterfrom
mdboom:wcs/upgrade-5.4

Conversation

@mdboom

@mdboom mdboom commented Jun 11, 2015

Copy link
Copy Markdown
Contributor

This is now successfully performing the SIP calculations in wcslib and the results match the old results.

There are still some things missing:

  • wcslib doesn't output polynomial header keywords (yet) so we can't round trip SIP anymore (that's a regression)
  • There is no API to access and edit the polynomial coefficients (as there was in astropy prior to this change). That will have to be rebuilt on top of wcslib.
  • Copying wcslib objects doesn't copy the distortions correctly (I think -- now having doubts)
  • Somewhat related to the above, calling set multiple times will erase distortion coefficients (possibly TPV only)

Despite those shortcomings, I think this may be far enough along for @nden to test this in the Hubble pipeline...

@mdboom mdboom changed the title Upgrade WCS to 5.x Upgrade wcslib to 5.x Jun 11, 2015
@mdboom mdboom mentioned this pull request Jun 11, 2015
@mdboom
mdboom force-pushed the wcs/upgrade-5.4 branch from 151423f to d84f3e0 Compare June 11, 2015 16:22
@olebole

olebole commented Jun 12, 2015

Copy link
Copy Markdown
Member

Since this now superceded #3751: Is this one planned for v1.1.0?

@mdboom mdboom added this to the v1.1.0 milestone Jun 12, 2015
@mdboom

mdboom commented Jun 12, 2015

Copy link
Copy Markdown
Contributor Author

@olebole: Tentatively planned for 1.1, yes. That depends on whether the remaining functionality gets into wcslib by then or not.

@mdboom

mdboom commented Jun 12, 2015

Copy link
Copy Markdown
Contributor Author

It seems there's still an issue in the inverse transform of SIP here. Haven't got to the bottom of it yet...

@eteq

eteq commented Jun 13, 2015

Copy link
Copy Markdown
Member

@mdboom - I'm still not able to get DECam images (It uses TPV, and come from a major NOAO facility instrument) to work correctly with this. Steps to reproduce:

  1. Go to http://www.portal-nvo.noao.edu/search/query and select "CTIO 4m + DECam imager" under Telescope&Instrument, and check "calibrated images" for "Mosaic, NEWFIRM, and DECam". If you want exactly the file I tested on, you'll also want to choose Program number="2012B-0001", but I don't think that actually matters
  2. Hit "search", and then find the first result the search returns that has "Product"="image". Hit "retreive" on that row and it will download a DECam image.
  3. You should see this with that image:
>>> f = fits.open('c4d_130831_235507_ooi_g_d3.fits.fz')
>>> w = wcs.WCS(f[1].header)
>>> ra, dec = w.all_pix2world([0,10, 15],[0,10, 20],0)
>>> ra
array([ 301.2065433,  301.2065433,  301.2065433])
>>> dec
array([-50.93399553, -50.93399553, -50.93399553])

which is clearly wrong: they should be different ra/dec.
4. But also, I see this:

>>> ra, dec = w.wcs_pix2world([0,10, 15],[0,10, 20],0)
>>> ra
array([ 300.49796386,  300.49908106,  300.50020568])
>>> dec
array([-49.95258804, -49.95332569, -49.95369924])

which looks like it is correct - and the only difference is wcs_pix2world instead of all_pix2world.

So that suggests the problem is in the layers after wcslib - that's weird to me because I thought the point of this PR was that wcslib now supports TPV so nothing else should be needed (but I admit the internals of this package aren't too familiar to me).

@mdboom

mdboom commented Jun 15, 2015

Copy link
Copy Markdown
Contributor Author

@eteq: Thanks for the info. It seems the issue is that when set is called multiple times on a WCS object (as it is as a matter of course as values are updated etc.) the distortion coefficient values are erased. And when you have coefficients of all zeros, the entire linear transformation disappears, which is why you're seeing all the same values in that case. I'll take this up with the wcslib author.

@mdboom

mdboom commented Jun 30, 2015

Copy link
Copy Markdown
Contributor Author

I was planning on leaving it open -- eventually we should be using this approach, but there are still some important missing pieces...

@mdboom mdboom changed the title Upgrade wcslib to 5.x Upgrade wcslib to 5.x (using wcslib for SIP) Jul 8, 2015
@bsipocz

bsipocz commented Mar 22, 2017

Copy link
Copy Markdown
Member

@nden - I wonder whether we should close this, or there are still relevant pieces in this PR that need to be merged?

@bsipocz bsipocz added the Close? Tell stale bot that this issue/PR is stale label Mar 22, 2017
@bsipocz

bsipocz commented May 9, 2017

Copy link
Copy Markdown
Member

Closing this as a PR and open an issue to remind ourselves to the SIP issue.

@nden

nden commented May 10, 2017

Copy link
Copy Markdown
Contributor

@bsipocz My impression is that a lot of the work needed for #6030 is actually in this PR. Or am I wrong?

@bsipocz

bsipocz commented May 10, 2017

Copy link
Copy Markdown
Member

@nden - That is very possible, I'm not familiar enough with wcs to see into the details. However this PR was opened before github allowed maintainers to overtake abandoned PRs and had tons of conflicts. Thus even if someone takes the work over from here, they need to open a new PR.

@nden

nden commented Jul 23, 2017

Copy link
Copy Markdown
Contributor

Keep this open as a reference.

@nden nden reopened this Jul 23, 2017
@bsipocz

bsipocz commented Jul 27, 2017

Copy link
Copy Markdown
Member

@nden - As a reference I would suggest to open an issue instead, as this PR was opened before github allowed maintainers to take over (thus any work on this needs to be done in a new PR anywy). I've tried to rebase this without the cextern/wcslib updates, but ended up with horrible test failures, so this definitely need to be done by someone knowing the wcs module.

bsipocz pushed a commit to bsipocz/astropy that referenced this pull request Jul 27, 2017
@nden

nden commented Jul 27, 2017

Copy link
Copy Markdown
Contributor

@bsipocz I don't expect this work to be done by someone who does not understand astropy.wcs, at least not without some help. I keep it open mostly for my own reference. Unfortunately working on this is not high on my priorities list. I could instead create a branch in my own repo with Mike's work and then we can close but no one who understands astropy.wcs will be able to see it. I can't think why an issue would be better. What kind of issue do you have in mind?

@bsipocz

bsipocz commented Jul 28, 2017

Copy link
Copy Markdown
Member

@nden - I just had the "close stale PRs" e-mail of astropy-dev in mind, that we could aim to keep issues open as reminders rather than PRs that can't be finished in their current form. However it's fine to keep this open if you find it more useful as a reminder than either #6030 or #6371. (I don't think that the auto close will get to this any time soon, though).

@astropy-bot

astropy-bot Bot commented Sep 25, 2017 •

Copy link
Copy Markdown

Hi there @mdboom 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labelled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

I see this is a work in progress pull request. I'll report back on the checks once the PR is ready for review.

If there are any issues with this message, please report them here

@bsipocz bsipocz removed this from the Future milestone Sep 25, 2017
@astropy-bot

astropy-bot Bot commented Sep 26, 2017

Copy link
Copy Markdown

Hi humans 👋 - this issue was labeled as Close? approximately 6 months ago. So..... any news? 🗞️

If you think this issue should not be closed, a maintainer should remove the Close? label - otherwise, I'm just gonna have to close this issue in a month. Your time starts now! Tick tock 🕙

If you believe I commented on this issue incorrectly, please report this here

@astropy-bot

astropy-bot Bot commented Sep 27, 2017

Copy link
Copy Markdown

Hi humans 👋 - this pull request hasn't had any new commits for approximately 2 years. I plan to close this in a month if the pull request doesn't have any new commits by then.

In lieu of a stalled pull request, please close this and open an issue instead to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary.

If you believe I commented on this issue incorrectly, please report this here.

@nden nden removed the Close? Tell stale bot that this issue/PR is stale label Sep 29, 2017
@astropy-bot

astropy-bot Bot commented Nov 21, 2017

Copy link
Copy Markdown

⏰ Time's up! ⏰

I'm going to close this pull request as per my previous message. If you think what is being added/fixed here is still important, please remember to open an issue to keep track of it. Thanks!

If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here.

@astropy-bot astropy-bot Bot closed this Nov 21, 2017
@astrofrog astrofrog added the closed-by-bot Closed by stale bot label Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants