Open SpacialTree opened 1 year ago
this appears to be a recent change in how spectral coordinate transforms are handled by astropy. I haven't found the origin of the issue.
I'm officially endorsing the hackaround. @astrofrog do you happen to have any idea what caused this change? It was something in astropy that's getting called by reproject. The WCS is trying to convert back to frequency even though we're trying to get world coordinates in velocity, so all the hard work we did to get into matched velocity coordinates is getting undone. It's not easy to track exactly where this happens, though.
It's probably related to the fact that reproject uses pixel_to_pixel in astropy which now uses SpectralCoord to do conversions in world coordinates for the spectral axis. I think it would be good to have the option of not converting back to frequency space though.
I am attempting to spatially reproject one cube to another.
I am getting the following error:
The issue seems to be that reproject is trying to take the frequency space of the cubes into account when reprojecting, making the reprojected cube be full of NaNs.
A temporary fix is to make a copy of the target header and set its rest frequency to that of the cube you are trying to reproject.