def __init__(self, universe, alpha=2.0, tau=1.5, group=None, radii_dict=None, max_layers=1, normal='guess', molecular=True, info=True, mesh=None, centered=False, warnings=False, **kargs): self.symmetry = 'planar' self.do_center = centered sanity = pytim.SanityCheck(self) sanity.assign_universe(universe, radii_dict=radii_dict, warnings=warnings) self.target_mesh = mesh if mesh is not None: raise Exception("FFT-based version not implemented") self.info = info self.alpha = alpha self.tau = tau if (max_layers != 1): raise Exception("max_layers !=1 not implemented yet!") self.max_layers = max_layers self._layers = np.empty([2, max_layers], dtype=type(universe.atoms)) self._surfaces = np.empty(max_layers, dtype=type(Surface)) self.normal = None self.PDB = {} self.molecular = molecular # TODO implement cluster group sanity.assign_groups(group, None, None) sanity.assign_normal(normal) sanity.assign_radii() self.old_box = np.array([-1, -1, -1]) self.sorted_indices = None self.surf = None self.modes = [None, None] pytim.PatchTrajectory(universe.trajectory, self) self._assign_layers() self._atoms = self.LayerAtomGroupFactory(self._layers[:].sum().indices, self.universe)
def __init__(self, universe, mesh=0.4, alpha=2.0, normal='guess', group=None, radii_dict=None, max_layers=1, cluster_cut=None, cluster_threshold_density=None, molecular=True, extra_cluster_groups=None, info=False, multiproc=True, centered=False, warnings=False, **kargs): self.symmetry = 'planar' self.do_center = centered sanity = pytim.SanityCheck(self) sanity.assign_universe(universe, radii_dict=radii_dict, warnings=warnings) sanity.assign_alpha(alpha) sanity.assign_mesh(mesh) self.cluster_threshold_density = cluster_threshold_density self.max_layers = max_layers self._layers = np.empty([2, max_layers], dtype=type(universe.atoms)) self._surfaces = np.empty(max_layers, dtype=type(Surface)) self.info = info self.normal = None self.PDB = {} self.molecular = molecular sanity.assign_groups(group, cluster_cut, extra_cluster_groups) sanity.assign_normal(normal) sanity.assign_radii() self.grid = None self.use_threads = False self.use_kdtree = True self.use_multiproc = multiproc pytim.PatchTrajectory(universe.trajectory, self) self._assign_layers() self._atoms = self.LayerAtomGroupFactory(self._layers[:].sum().indices, self.universe)
def __init__(self, universe, group=None, alpha=2.0, normal='guess', molecular=True, max_layers=1, radii_dict=None, cluster_cut=None, cluster_threshold_density=None, extra_cluster_groups=None, biggest_cluster_only=False, symmetry='spherical', centered=False, info=False, warnings=False, _noextrapoints=False, **kargs): # this is just for debugging/testing self._noextrapoints = _noextrapoints self.do_center = centered self.biggest_cluster_only = biggest_cluster_only sanity = SanityCheck(self) sanity.assign_universe(universe, radii_dict=radii_dict, warnings=warnings) sanity.assign_alpha(alpha) self.cluster_threshold_density = cluster_threshold_density self.max_layers = max_layers self._layers = np.empty([max_layers], dtype=type(universe.atoms)) self.info = info self.normal = None self.PDB = {} self.molecular = molecular sanity.assign_groups(group, cluster_cut, extra_cluster_groups) sanity.check_multiple_layers_options() sanity.assign_radii() self._assign_symmetry(symmetry) if (self.symmetry == 'planar'): sanity.assign_normal(normal) pytim.PatchTrajectory(self.universe.trajectory, self) self._assign_layers()
def __init__(self, universe, alpha=2.0, mesh=2.0, symmetry='spherical', group=None, radii_dict=None, cluster_cut=None, cluster_threshold_density=None, extra_cluster_groups=None, centered=False, warnings=False, fast=True, **kargs): self.do_center = centered sanity = pytim.SanityCheck(self) sanity.assign_universe(universe, radii_dict=radii_dict, warnings=warnings) sanity.assign_alpha(alpha) if mesh <= 0: raise ValueError(self.MESH_NEGATIVE) self.mesh = mesh self.spacing = None self.ngrid = None self.PDB = {} sanity.assign_radii() sanity.assign_groups(group, cluster_cut, extra_cluster_groups) self._assign_symmetry(symmetry) if (self.symmetry == 'planar'): sanity.assign_normal(normal) self.fast = fast pytim.PatchTrajectory(universe.trajectory, self) self._assign_layers() self._atoms = self._layers[:] # this is an empty AtomGroup self.writevtk = WillardChandler.Writevtk(self)