Skip to content
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

jupyter notebook crash @ SNR map and beyond #8

Open
epantin opened this issue Sep 28, 2020 · 1 comment
Open

jupyter notebook crash @ SNR map and beyond #8

epantin opened this issue Sep 28, 2020 · 1 comment

Comments

@epantin
Copy link

epantin commented Sep 28, 2020

Crash probably because input angles have the wrong shape/type.

I guess that angles shall be reformatted at some point as in "naco_create_hcidataset.ipynb" :

angles have a wrong shape: (61,1) instead of (61,)

dataset.angles = dataset.angles.reshape(-1)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


TypeError Traceback (most recent call last)
in ()
----> 1 vip.metrics.snr(vip.pca.pca(cube, angs, ncomp=20, verbose=False),
2 source_xy=(62,62), fwhm=fwhm_naco, plot=True)

~/Softs/Python/anaconda3/lib/python3.6/site-packages/vip_hci/pca/pca_fullfr.py in pca(cube, angle_list, cube_ref, scale_list, ncomp, svd_mode, scaling, mask_center_px, source_xy, delta_rot, fwhm, adimsdi, crop_ifs, imlib, interpolation, collapse, check_memory, batch, nproc, full_output, verbose)
303 res_pca = _adi_pca(cube, angle_list, ncomp, batch, source_xy, delta_rot,
304 fwhm, scaling, mask_center_px, svd_mode, imlib,
--> 305 interpolation, collapse, verbose, start_time, True)
306
307 if batch is None:

~/Softs/Python/anaconda3/lib/python3.6/site-packages/vip_hci/pca/pca_fullfr.py in adi_pca(cube, angle_list, ncomp, batch, source_xy, delta_rot, fwhm, scaling, mask_center_px, svd_mode, imlib, interpolation, collapse, verbose, start_time, full_output)
491 residuals_cube
= cube_derotate(residuals_cube, angle_list,
492 imlib=imlib,
--> 493 interpolation=interpolation)
494 frame = cube_collapse(residuals_cube_, mode=collapse)
495 if verbose:

~/Softs/Python/anaconda3/lib/python3.6/site-packages/vip_hci/preproc/derotation.py in cube_derotate(array, angle_list, imlib, interpolation, cxy, nproc, border_mode)
199 array_der[i] = frame_rotate(array[i], -angle_list[i], imlib=imlib,
200 interpolation=interpolation, cxy=cxy,
--> 201 border_mode=border_mode)
202 elif nproc > 1:
203 global data_array

~/Softs/Python/anaconda3/lib/python3.6/site-packages/vip_hci/preproc/derotation.py in frame_rotate(array, angle, imlib, interpolation, cxy, border_mode)
142 raise ValueError('Opencv border_mode not recognized.')
143
--> 144 M = cv2.getRotationMatrix2D((cx,cy), angle, 1)
145 array_out = cv2.warpAffine(array.astype(np.float32), M, (x, y),
146 flags=intp, borderMode=bormo)

TypeError: Argument 'angle' can not be treated as a double

@agallenne
Copy link

I had a similar problem from the tutorial. I have the vip version 0.9.11. First, the vip.HCIDataset module does not exist anymore, I had to use vip.Dataset. Then I also had the dimension problem with the angles vector, so what I did was just to flatten it: betapic = vip.Dataset(cube=cube, angles=angles.flatten(), psf=psf). At least it loads, before having another issue :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants