Commits

Matthew Turk  committed 6e78e1a

Previous version ommitted the masking, which negated the entire point of the
script.

  • Participants
  • Parent commits d470923

Comments (0)

Files changed (1)

File find_particles.py

         found_any, mask = particle_ops.mask_particles(
             particle_ids, g["particle_index"], mask_to_get)
         if found_any == 0: continue
+        mask = mask.astype("bool")
         for i, ax in enumerate('xyz'):
-            min_pos[i] = min(g["particle_position_%s" % ax].min(), min_pos[i])
-            max_pos[i] = max(g["particle_position_%s" % ax].max(), max_pos[i])
+            min_pos[i] = min(g["particle_position_%s" % ax][mask].min(),
+                             min_pos[i])
+            max_pos[i] = max(g["particle_position_%s" % ax][mask].max(),
+                             max_pos[i])
     return min_pos, max_pos
 
 if __name__ == "__main__":