| 1 | # Create command to change atom coordiates z -> -z.
|
|---|
| 2 | # Opening this file in ChimeraX 1.0 defines the flip command.
|
|---|
| 3 | #
|
|---|
| 4 | # flip #1
|
|---|
| 5 |
|
|---|
| 6 | def flip(session, atoms):
|
|---|
| 7 | xyz = atoms.coords
|
|---|
| 8 | xyz[:,2] *= -1
|
|---|
| 9 | atoms.coords = xyz
|
|---|
| 10 |
|
|---|
| 11 | def register_command(session):
|
|---|
| 12 | from chimerax.core.commands import CmdDesc, register
|
|---|
| 13 | from chimerax.atomic import AtomsArg
|
|---|
| 14 | desc = CmdDesc(required=[('atoms', AtomsArg)],
|
|---|
| 15 | synopsis='flip atom z coordinates')
|
|---|
| 16 | register('flip', desc, flip, logger=session.logger)
|
|---|
| 17 |
|
|---|
| 18 | register_command(session)
|
|---|