1D wcs transformations not returning single array
See original GitHub issueThe documentation for wcs transformations state that the all_world2pix
, etc, operations return a single array if the input is a single array. However, currently, they return a list of length 1 with the single array of pixel coordinates (in the case of all_world2pix
/world_to_pixel
):
In [6]: my_wcs = fitswcs.WCS(header={'CDELT1': 1, 'CRVAL1': 6562.8, 'CUNIT1': 'Angstrom', 'CTYPE1': 'WAVE', 'RESTFRQ': 1400000000, 'CRPIX1': 25})
In [7]: my_wcs.world_to_pixel(np.arange(10) * u.nm)
Out[7]:
[array([-6538.8, -6528.8, -6518.8, -6508.8, -6498.8, -6488.8, -6478.8,
-6468.8, -6458.8, -6448.8])]
This is also inconsistent with the current GWCS interface that returns a single array of coordinates.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Source code for astropy.wcs.wcs
RETURNS ('pixel coordinates', 8)} Notes ----- The order of the axes for the input world array is determined by the ``CTYPEia`` keywords in...
Read more >Shared Python interface for World Coordinate Systems
The WCS class implements what is considered the most common 'standard' for representing world coordinate systems in FITS files, but it cannot represent ......
Read more >Tutorial wcs module — Kapteyn Package (home)
Module celestial provides a rotation matrix for sky transformations and is more or less embedded in wcs , so (for standard work) there...
Read more >Home · WCS.jl - JuliaAstro
There are many ways to utilize WCS transformations. Let's make one for a 2-dimensional array (like an image) from scratch. ... Now we...
Read more >astropy.wcs.wcs — Astropy v0.4.2
`wcslib`_ WCS transformation (by a `~astropy.wcs. ... The number of coordinate axes in the transformation is not determined directly from the ``NAXIS`` ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Relating to some of the discussion above, I’m not interested in changing the default behavior of the ‘native’ methods for GWCS and FITS-WCS, just the APE 14 API - which I think is still fine to do since it was new in 3.1.
Thinking about this some more, I’d be ok with returning variables not in a list/tuple in the single coordinate case, but this means that chaining as:
won’t work. One way around this is to say that
pixel_to_world
andworld_to_pixel
should be able to accept a tuple, and in this case, it should auto-expand it, so that we could then do: