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

Fixed issue with pynbody SimArrays #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

langfzac
Copy link

@langfzac langfzac commented Aug 17, 2018

Previous version returned an error where calling f1['rho'] did not work since 'f1' still contained an index for the star particles.

Since all we care about are the gas particles, and the star particles are at the end of the iorder (as per convention), we can set the 'iorder' and 'particle_nums' arrays to be the size of 'f.g' instead of 'f'. Then, since 'clump_nums' will be the size of 'f', we can slice the star particles at the end of the array out and mask 'f.g', 'iorder', and 'particle_nums' where 'clump_nums' > 0. This ensures that 'f1' contains only gas particles, and that all the arrays are the same size.

@langfzac langfzac closed this Aug 17, 2018
@langfzac langfzac deleted the rhofix branch August 17, 2018 22:10
@langfzac langfzac restored the rhofix branch August 17, 2018 22:10
@langfzac langfzac reopened this Aug 20, 2018
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

Successfully merging this pull request may close these issues.

1 participant