8 from __future__
import print_function
11 from opals
import pyDM
13 def DM_spatial_query(filename, maxOutput=1000):
15 dm = pyDM.Datamanager.load(filename,
True,
False)
17 print(
"Unable to open ODM '" + filename +
"'")
23 print(
"ODM contains", dm.sizePoint(),
"points")
24 print(
"2D-limit (%.3f," % limit.xmin,
"%.3f) -" % limit.ymin,
"(%.3f," % limit.xmax,
"%.3f)" % limit.ymax)
27 print(
"Perform spatial query")
28 pts = dm.searchPoint(limit,
True)
29 assert len(pts) == dm.sizePoint()
30 print(len(pts),
"points found")
32 print(
"Output points...")
36 print(
"Point",
"%5d" % i,
"%.3f" % pt.x,
"%.3f" % pt.y,
"%.3f" % pt.z)
40 print(i,
"of", len(pts),
"points listed")
42 if len(sys.argv) == 1:
43 print(
"ODM parameter missing")
46 DM_spatial_query(sys.argv[1])