-
Notifications
You must be signed in to change notification settings - Fork 1
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
Reprojection performance #2
Comments
It seems that the performance bottleneck is actually in the pixel-to-pixel transformation and not in the My solution for now is to do each wavelength slice separately and to attempt to do this in parallel. This makes each pixel-to-pixel transformation far less onerous and means we can pass it off to something like Dask to make this calculation more scalable. There is currently a draft of this in the |
Some of the work being done on reproject could also be helpful here: astropy/reproject#376 |
And here: astropy/reproject#374 |
Happy to discuss this use case more as I'd be interested in making sure it works fast! Just to check, are you reprojecting a 3D spectral cube just in the spatial dimension or are you doing a full 3D reprojection changing both celestial and spectral WCS? |
Great! In general, the use case here is the latter: a full 3D reprojection in both the spatial and wavelength dimensions. |
But just to check, are the celestial and spectral WCSes decoupled in your case? |
One is decoupled and one is not. The use case here is reprojecting from a space-space-wavelength cube to a WCS where the wavelength dimension is coupled to one (or sometimes both) of the spatial dimensions. In general, the PCij for the decoupled spectral cube is,
while the coupled "overlappogram" WCS is
where alpha is the roll angle, gamma is the angle of the dispersive grating, and b is the spectral order. For a simple case of alpha=gamma=0, b=1, this just reduces to
a skew between the first spatial dimension. I'm on mobile right now, but tomorrow I can provide full example headers for both WCSs. |
Currently, I'm using
reproject_interp
to do the reprojection form the spectral cube to the overlappogram. This is exceedingly slow and even seems to run out of memory when run on my laptop. Presumably this is due to the sheer number of arguments passed tomap_coordinates
which seems to be the bottleneck for doing this type of computation.There are a few possible strategies for speeding this up
The text was updated successfully, but these errors were encountered: