query_points()
Query point data for multiple points.
For temporal datasets, automatically sweeps all time points unless time_value is specified. For static datasets, returns values directly.
Parameters
point_ids(list[int]) — The point IDs to query.block_names(list[str] | str | None, default:None) — Block names for MultiBlock meshes. Ifstr, applies to all points. Iflist, must match length ofpoint_ids. Must beNonefor single-block meshes.time_value(float | None, default:None) — Query a specific time value instead of sweeping all time points. Ignored for static datasets.
Returns
Returns a list of dictionaries, one per point ID. Each dictionary has the same structure as query_point.
[
{ # point_ids[0]
"scalar_name": {"time": [...], "value": [...]},
"vector_name": {"time": [...], "x_value": [...], "y_value": [...], "z_value": [...]},
...
},
{ # point_ids[1]
...
},
...
]
Examples
Query multiple points from same block
from pyemsi import Plotter
p = Plotter("output.pvd")
results = p.query_points([10, 20, 30], block_names="coil")
for i, data in enumerate(results):
print(f"Point {[10, 20, 30][i]}: {data['B-Mag (T)']['value']}")
Query points from different blocks
from pyemsi import Plotter
p = Plotter("output.pvd")
results = p.query_points(
point_ids=[10, 20, 30],
block_names=["coil", "core", "air"]
)
for data in results:
print(data.keys())
Query specific time value
from pyemsi import Plotter
p = Plotter("output.pvd")
results = p.query_points([100, 200], block_names="coil", time_value=0.005)
# Each result has single-element time/value lists
for data in results:
print(data["B-Mag (T)"]["time"]) # [0.005]
print(data["B-Mag (T)"]["value"]) # [...]
See Also
query_point— Query a single pointquery_cells— Query multiple cellsmesh— Access the underlying mesh- PyVista DataSetAttributes