You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueErrorTraceback (mostrecentcalllast)
/scratch/local/60838376/ipykernel_89087/2137793806.pyin<module>---->1reproj_cube17=interp_cube17.reproject(cube_29.header)
/blue/adamginsburg/adamginsburg/repos/spectral-cube/spectral_cube/utils.pyinwrapper(self, *args, **kwargs)
47PossiblySlowWarning48 )
--->49returnfunction(self, *args, **kwargs)
50returnwrapper51/blue/adamginsburg/adamginsburg/repos/spectral-cube/spectral_cube/spectral_cube.pyinreproject(self, header, order, use_memmap, filled, **kwargs)
2703**reproj_kwargs)
2704ifnp.all(np.isnan(newcube)):
->2705raiseValueError("All values in reprojected cube are nan. This can be caused"2706" by an error in which coordinates do not 'round-trip'. Try "2707"setting ``roundtrip_coords=False``. You might also check "ValueError: Allvaluesinreprojectedcubearenan. Thiscanbecausedbyanerrorinwhichcoordinatesdonot'round-trip'. Trysetting``roundtrip_coords=False``. YoumightalsocheckwhethertheWCStransformationproducesvalidpixel->worldandworld->pixelcoordinatesineachaxis.
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.
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.
The text was updated successfully, but these errors were encountered: