It seems that with the current pypi deployment of the wfield package (0.4.1) the stack reconstruction doesn't work
e.g this code results in the following error
import wfield
import matplotlib.pyplot as plt
U = np.load('widefieldU.images.npy')
SVT = np.load('widefieldSVT.haemoCorrected.npy')
stack = wfield.SVDStack(U, SVT)
plt.imshow(stack[100])
File /opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/wfield/utils.py:388, in SVDStack.__getitem__(self, *args)
386 else:
387 idxz = args[0]
--> 388 return reconstruct(self.U,self.SVT[:,idxz],dims=self.shape[1:])
File /opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/wfield/utils.py:265, in reconstruct(u, svt, dims)
262 if dims is None:
263 dims = u.shape[:2]
--> 265 return u@svt.reshape((*dims,-1)).transpose(-1,0,1).squeeze()
ValueError: cannot reshape array of size 200 into shape (540,640,newaxis)
When I install the latest code from the repo (pip install git+https://github.com/jcouto/wfield.git), this error goes away so I think it is just in the version that is currently released to pypi.
Hello,
It seems that with the current pypi deployment of the wfield package (0.4.1) the stack reconstruction doesn't work
e.g this code results in the following error
When I install the latest code from the repo (pip install git+https://github.com/jcouto/wfield.git), this error goes away so I think it is just in the version that is currently released to pypi.