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

Array indices in cube_registration #15

Closed
oabsil opened this issue Jan 24, 2017 · 1 comment
Closed

Array indices in cube_registration #15

oabsil opened this issue Jan 24, 2017 · 1 comment

Comments

@oabsil
Copy link
Member

oabsil commented Jan 24, 2017

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

@henry-ngo
Copy link
Collaborator

Thanks @oabsil

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.

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