Description
Hello
Following the reproject examples, I am trying to do the same using reproject_exact (i.e. drizzle). The resampling seems to work only for multiple of pi/2, it returns an array full of nan for other angles. Not sure what is wrong.
Here is a workable example:
import numpy as np
from astropy.wcs import WCS
import matplotlib.pyplot as plt
from reproject import reproject_interp, reproject_adaptive,reproject_exact
from astropy.io import fits
import copy
mydata = fits.open('mydata.fits')
data = mydata[0].data
angle = np.pi/6
shift = 38.8
input_wcs = WCS(mydata[0].header)
output_wcs = copy.deepcopy(input_wcs)
output_wcs.wcs.crpix += shift
roti = [[np.cos(angle),-np.sin(angle)],[np.sin(angle),np.cos(angle)]]
output_wcs.wcs.cd = np.dot(output_wcs.wcs.cd,roti)
result_drizzle, _ = reproject_exact((data.astype(float), input_wcs),output_wcs, shape_out=data.shape)