sitator.misc package

sitator.misc.oldio module

sitator.misc.oldio.from_file(file)

Load a SiteNetwork from a tar file/file descriptor.

sitator.misc.oldio.save(sn, file)

Save this SiteNetwork to a tar archive.

Module contents

class sitator.misc.GenerateAroundSites(n, sigma)

Bases: object

Generate n normally distributed sites around each site.

Parameters:
  • n (int) – How many sites to produce for each input site.
  • sigma (float) – Standard deviation of the spatial Gaussian.
run(sn)
class sitator.misc.GenerateClampedTrajectory

Bases: object

Create a real-space trajectory with the fixed site/static structure positions.

Generate a real-space trajectory where the atoms are clamped to the fixed positions of the current site/their fixed static position.

Parameters:
  • wrap (bool) – If True, all clamped positions will be in the unit cell; if False, the clamped position will be the minimum image of the clamped position with respect to the real-space position. (This can generate a clamped, unwrapped real-space trajectory from an unwrapped real space trajectory.)
  • pass_through_unassigned (bool) – If True, when a mobile atom is supposed to be clamped but is unassigned at some frame, its real-space position will be passed through from the real trajectory. If False, an error will be raised.
run

Create a real-space trajectory with the fixed site/static structure positions.

Generate a real-space trajectory where the atoms indicated in clamp_mask – any mixture of static and mobile – are clamped to: (1) the fixed position of their current site, if mobile, or (2) the corresponding fixed position in the SiteNetwork’s static structure, if static.

Atoms not indicated in clamp_mask will have their positions from real_traj passed through.

Parameters:clamp_mask (ndarray, len(sn.structure)) –
Returns:ndarray (n_frames x n_atoms x 3)
class sitator.misc.NAvgsPerSite(n, error_on_insufficient=True, weighted=True)

Bases: object

Given a SiteTrajectory, return a SiteNetwork containing n avg. positions per site.

The site_types of sites in the output are the index of the site in the input that generated that average.

Parameters:
  • n (int) – How many averages to take
  • error_on_insufficient (bool) – Whether to throw an error if n points cannot be provided for a site, or just take all that are available.
  • weighted (bool) – Use SiteTrajectory confidences to weight the averages.
run(st)
Parameters:st (SiteTrajectory) –
Returns:A SiteNetwork.