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

pix_to_world() when naxis=3 #35

Open
andferrari opened this issue Jan 14, 2021 · 1 comment
Open

pix_to_world() when naxis=3 #35

andferrari opened this issue Jan 14, 2021 · 1 comment

Comments

@andferrari
Copy link

When naxis=3, the third pixel coordinate in pix_to_world() must be a Float

julia> wcs = WCSTransform(3; cdelt = [-0.066667, 0.066667, 1e4],
                                 ctype = ["RA---AIR", "DEC--AIR", "FREQ"], crpix = [-234.75, 8.3393, 1.0],
                                 crval = [0., -90, 1e8], pv    = [(2, 1, 45.0)])
WCSTransform(naxis=3)

julia> pix_to_world(wcs, [0, 0, 0.0])
3-element Array{Float64,1}:
 267.96547027027646
 -73.73660748999083
   9.999e7

julia> pix_to_world(wcs, [0, 0, 0])
ERROR: MethodError: no method matching pix_to_world(::WCSTransform, ::Array{Int64,1})
@sefffal
Copy link
Member

sefffal commented Apr 11, 2022

I believe the issue is actually that pix_to_world and world_to_pix both require an array of floats. The first example works because the array is automatically promoted to be all floats.

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

No branches or pull requests

2 participants