Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WCS conversion functions accept 2xN and Nx2 arrays #1395

Merged
merged 2 commits into from
Sep 4, 2013

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Sep 3, 2013

From the documentation, it looks like (for 2 dimensions) the conversion routines should accept a 2xN array, but it seems that both are accepted without error and produce different results:

In [7]: w.wcs_world2pix(np.random.random((2,3)),1)
Out[7]: 
array([[  5.30032953e+005,   1.29954708e+004,   2.14987419e-314],
       [  6.98357305e+005,   1.83455655e+004,   4.21535895e-309]])

In [8]: w.wcs_world2pix(np.random.random((3,2)),1)
Out[8]: 
array([[ 615299.08679848,   18368.77731511],
       [ 540847.24016291,   13420.29274022],
       [ 719622.74011492,   20603.13017229]])

should the first one not fail?

cc @mdboom

@ghost ghost assigned mdboom Sep 2, 2013
@mdboom
Copy link
Contributor

mdboom commented Sep 3, 2013

Indeed. Fix attached.

@astrofrog
Copy link
Member Author

👍 - works for me

@embray
Copy link
Member

embray commented Sep 3, 2013

Can we add a changelog entry. I know that makes merging difficult sometimes but I also really need to start being more obnoxious about this :)

@mdboom
Copy link
Contributor

mdboom commented Sep 3, 2013

Changelog done.

@embray
Copy link
Member

embray commented Sep 3, 2013

Thanks!

embray added a commit that referenced this pull request Sep 4, 2013
WCS conversion functions accept 2xN and Nx2 arrays
@embray embray merged commit 02ce8f7 into astropy:master Sep 4, 2013
embray added a commit that referenced this pull request Sep 6, 2013
WCS conversion functions accept 2xN and Nx2 arrays
Conflicts:

	CHANGES.rst
	astropy/wcs/tests/test_wcs.py
@mdboom mdboom deleted the wcs/shape branch May 22, 2014 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants