Get coords: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(created)
 
m (correction)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
''New in PyMOL 1.7.4''
''New in PyMOL 1.7.4''


The order of coordinates is that of the internal atom ordering, like in [[iterate]], and unlike in [[iterate_state]]. The function considers the object state and TTT matrices, like in [[Get_Model|get_model]].
The order of coordinates is that of the internal atom ordering, like in [[iterate]], and unlike in [[get_coordset]]. The function considers the object state and TTT matrices, like in [[Get_Model|get_model]].


== PyMOL API ==
== PyMOL API ==
Line 20: Line 20:
== See Also ==
== See Also ==


* [[set_coords]]
* [[load_coords]]
* [[get_coordset]]
* [[get_coordset]]
* [[Get Coordinates I]]
* [[Get Coordinates I]]

Latest revision as of 20:05, 28 December 2015

get_coords is an API only function that returns the coordinates of a selection as a numpy array.

New in PyMOL 1.7.4

The order of coordinates is that of the internal atom ordering, like in iterate, and unlike in get_coordset. The function considers the object state and TTT matrices, like in get_model.

PyMOL API

cmd.get_coords(str selection='all', int state=1)

Returns: ndarray, shape (N, 3), where N is the number of atoms if state > 0, or (natoms * nstates) if state=0.

Arguments

  • selection = str: atom selection {default: all}
  • state = int: state index or all states if state=0 {default: 1}

See Also

For state > 0, the function is equivalent to:

numpy.array(cmd.get_model(selection, state).get_coord_list())