Exemple #1
0
 def do(self):
     total, formula = chemical_formula(iter_atoms(context.application.cache.nodes), True)
     if total > 0:
         answer = "Chemical formula: %s" % formula
         answer += "\nNumber of atoms: %i" % total
     else:
         answer = "No atoms found."
     ok_information(answer, markup=True)
Exemple #2
0
 def do(self):
     total, formula = chemical_formula(
         iter_atoms(context.application.cache.nodes), True)
     if total > 0:
         answer = "Chemical formula: %s" % formula
         answer += "\nNumber of atoms: %i" % total
     else:
         answer = "No atoms found."
     ok_information(answer, markup=True)
Exemple #3
0
        def create_pattern():
            "Read the atom positions and transform them to the flat coordinates"
            active, inactive = universe.cell.active_inactive
            a = universe.cell.matrix[:, active[0]]
            b = universe.cell.matrix[:, active[1]]
            c = numpy.cross(a, b)
            tmp_cell = UnitCell(numpy.array([a, b, c]).transpose())
            rotation = tmp_cell.alignment_a

            return [(atom.number, rotation * atom.get_absolute_frame().t)
                    for atom in iter_atoms([universe])]
Exemple #4
0
        def create_pattern():
            "Read the atom positions and transform them to the flat coordinates"
            active, inactive = universe.cell.active_inactive
            a = universe.cell.matrix[:,active[0]]
            b = universe.cell.matrix[:,active[1]]
            c = numpy.cross(a,b)
            tmp_cell = UnitCell(numpy.array([a,b,c]).transpose())
            rotation = tmp_cell.alignment_a

            return [
                (atom.number, rotation*atom.get_absolute_frame().t)
                for atom in iter_atoms([universe])
            ]