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

Script to find minimum/max values in a mesh #5

Open
kkiesling opened this issue Dec 10, 2019 · 4 comments
Open

Script to find minimum/max values in a mesh #5

kkiesling opened this issue Dec 10, 2019 · 4 comments

Comments

@kkiesling
Copy link
Member

I am finding more and more that I need this though I haven't been able to think through how to actually do this, so maybe someone else has an idea of how to do it: Given a mesh file with a set of tags, find the minimum (non-zero) value and the maximum value for that tag on the mesh. I am guessing PyNE and numpy could be used to do this.

@kkiesling
Copy link
Member Author

kkiesling commented Dec 18, 2019

Also, as a next level script related to this (and I am not sure if this is of use to anyone besides me): Find the maximum or minimum difference between adjacent voxels for a tag on any given mesh.

@kkiesling
Copy link
Member Author

Task 1 is fairly straight forward - load into pyne as a mesh and just get min/max from there.

Task 2 is more complicated - need to convert 1D index of mesh voxels to 3D index and compare values that way

@gonuke
Copy link
Member

gonuke commented Dec 19, 2019

Task 2 can probably be done with numpy.reshape() and numpy.gradient()?

@kkiesling
Copy link
Member Author

I think np.reshape() would definitely be useful in that task, but it doesn't look like np.gradient() is exactly what is needed (although that would also be useful to have).

My thinking is that I need to know what the maximum absolute difference between two adjacent mesh voxels is because I cannot use isosurface values that are smaller than that max difference. I don't think gradient quite calculates the right thing.

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