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
I've spotted a couple of issues in NIRC2_Preprocessing, in the function cube_registration().
First, the call to "frame_center" at line 1887 return the (y,x) coordinates, while the call to "cube_crop_frames" at line 1903 requires the third argument to be ordered as (x,y). The call at line 1903 should thus be modified.
Second, these (x,y) inputs should be integers. In principle, floats can be accepted as indices for numpy arrays, but it looks like this is not always the case (it crashes on my freshly installed conda environment for some reason).
Proposed fix for line 1903 -- although there is certainly a more elegant way to do:
reg_crop = cube_crop_frames(reg, cube_output_size, (int(center_cube[1]),int(center_cube[0])), verbose=False)
By the way, I'm also wondering whether there is not an inconsistency between various NIRC2_Preprocessing functions regarding the (x,y) and (y,x) ordering. It seems to me that vortex_center_routine is expecting (x,y), while vortex_center is expecting (y,x). So far it hasn't lead to any problem since our images are square, but it might be a good idea to check that anyway.
Cheers,
Olivier
The text was updated successfully, but these errors were encountered:
I will make the proposed fix for line 1903. That's too bad that "frame_center" and "cube_crop_frames" ask for different coordinate ordering, but these functions are in the VIP package.
I will also open a new issue to ensure consistency of coordinate ordering for all NIRC2_Preprocessing functions. My plan is to make them all (y,x) since that's the standard python ordering for 2-d arrays.
Hi @henry-ngo
I've spotted a couple of issues in NIRC2_Preprocessing, in the function cube_registration().
First, the call to "frame_center" at line 1887 return the (y,x) coordinates, while the call to "cube_crop_frames" at line 1903 requires the third argument to be ordered as (x,y). The call at line 1903 should thus be modified.
Second, these (x,y) inputs should be integers. In principle, floats can be accepted as indices for numpy arrays, but it looks like this is not always the case (it crashes on my freshly installed conda environment for some reason).
Proposed fix for line 1903 -- although there is certainly a more elegant way to do:
reg_crop = cube_crop_frames(reg, cube_output_size, (int(center_cube[1]),int(center_cube[0])), verbose=False)
By the way, I'm also wondering whether there is not an inconsistency between various NIRC2_Preprocessing functions regarding the (x,y) and (y,x) ordering. It seems to me that vortex_center_routine is expecting (x,y), while vortex_center is expecting (y,x). So far it hasn't lead to any problem since our images are square, but it might be a good idea to check that anyway.
Cheers,
Olivier
The text was updated successfully, but these errors were encountered: