How to use the pyscal.traj_process.split_traj_lammps_dump function in pyscal

To help you get started, we’ve selected a few pyscal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github srmnitc / pyscal / src / pyscal / core.py View on Github external
If `custom_keys` are provided, this extra information is read in from input files if
        available. This information is not passed to the C++ instance of atom, and is stored
        as a dictionary. It can be accessed directly as `atom.custom['customval']`


        """
        if customkeys == None:
            customkeys = []

        if format == 'lammps-dump':
            #check customkeys and assign a variable
            customread = (len(customkeys) > 0)

            if frame != -1:
                #split the traj and returns set of filenames
                filenames = ptp.split_traj_lammps_dump(filename, compressed=compressed)

                #reassign filename
                try:
                    filename = filenames[frame]
                except:
                    raise IOError("frame %d is not found in the trajectory"%frame)

                #now if file exists
                if os.path.exists(filename):
                    atoms, boxdims, box, triclinic = ptp.read_lammps_dump(filename, compressed=compressed, check_triclinic=True, box_vectors=True, customkeys=customkeys)
                    self.atoms = atoms
                    self.box = boxdims

                    if triclinic:
                        #we have to input rotation matrix and the inverse rotation matrix
                        rot = box.T