Scripts: interpolate.py

File interpolate.py, 575 bytes (added by goddard, 17 years ago)
Line 
1#
2# Example code to get interpolated volume data set values at specific points.
3#
4# Uses trilinear interpolation from 8 nearest grid points. Value is zero
5# if point lies outside volume. Points are specified in physical coordinates
6# (typically Angstroms) using the voxel size and origin.
7#
8# Results are printed to Reply Log (under Favorites menu).
9#
10from VolumeViewer import volume_list
11v = volume_list()[0]
12
13points = [(10.243, 12.534, 25.352),
14 (54.2112, 32.352, 29.3525),
15 (-15.153, 139.23, 12.44)]
16values = v.interpolated_values(points)
17print values