Scripts: camerapositions.py

File camerapositions.py, 838 bytes (added by goddard, 16 years ago)
Line 
1# -----------------------------------------------------------------------------
2# Print the camera location and angular field of view to the horizontal edges
3# of the window for each position saved with "savepos". Output is in the
4# Reply Log (Favorites menu).
5#
6# The Camera always points in the negative z direction in the Chimera global
7# coordinate system and the models are moved to see different orientations.
8#
9# This cycles through the positions with the "reset" command so the view
10# is changed after running the script.
11#
12from chimera import viewer, runCommand
13cam = viewer.camera
14
15from Midas import positions
16pnames = positions.keys()
17pnames.sort()
18
19for pname in pnames:
20 runCommand('reset ' + pname)
21 cx,cy,cz = cam.center
22 fov = cam.fieldOfView
23 print '%15s %9.6g %9.6g %9.6g %9.6g' % (pname, cx, cy, cz, fov)