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

432 new feature willard chandler density parameter #433

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .travis.yml.

This file was deleted.

7 changes: 6 additions & 1 deletion pytim/willard_chandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class WillardChandler(Interface):
this group
:param float alpha: The width of the Gaussian kernel
:param float mesh: The grid spacing for the density calculation
:param float density_cutoff: The density value used to define the
isosurface. `None` (default) uses the average
of the minimum and maximum density.
:param AtomGroup group: Compute the density using this group
:param dict radii_dict: Dictionary with the atomic radii of
the elements in the group.
Expand Down Expand Up @@ -127,10 +130,12 @@ def __init__(self,
centered=False,
warnings=False,
autoassign=True,
density_cutoff=None,
**kargs):

self.autoassign, self.do_center = autoassign, centered
self.include_zero_radius = include_zero_radius
self.density_cutoff = density_cutoff
sanity = SanityCheck(self, warnings=warnings)
sanity.assign_universe(universe, group)
sanity.assign_alpha(alpha)
Expand Down Expand Up @@ -245,7 +250,7 @@ def _assign_layers(self):
volume = self.density_field.reshape(
tuple(np.array(ngrid[::-1]).astype(int)))
verts, faces, normals, values = marching_cubes(
volume, None, spacing=tuple(spacing))
volume, self.density_cutoff, spacing=tuple(spacing))
# note that len(normals) == len(verts): they are normals
# at the vertices, and not normals of the faces
# verts and normals have x and z flipped because skimage uses zyx ordering
Expand Down
Loading