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

Shape Mismatch Bug in PostProcessing Module #9

Open
mhurley4 opened this issue Apr 5, 2022 · 0 comments
Open

Shape Mismatch Bug in PostProcessing Module #9

mhurley4 opened this issue Apr 5, 2022 · 0 comments

Comments

@mhurley4
Copy link

mhurley4 commented Apr 5, 2022

I think there might be a bug in one of the post processing functions: specifically, in the line

y, x, z = np.meshgrid(
        np.arange( supC.shape[0] ),
        np.arange( supC.shape[1] ),
        np.arange( supC.shape[2] )
)

in the function centerObject in the PostProcessing.py module. Later lines were giving me a shape mismatch between x,y,z and supC; it looks like the default inputs for np.meshgrid ('xy' indexing) give a matrix with a shape whose first dimension corresponds to the second vector input and whose second dimension corresponds to the first vector input. So it seems like the line should be 

y, x, z = np.meshgrid(
        np.arange( supC.shape[1] ),
        np.arange( supC.shape[0] ),
        np.arange( supC.shape[2] )
)

or, alternatively, one could set indexing='ij' as a parameter in the meshgrid function.

(And the shape mismatch errors do go away after I make this change.)

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

1 participant