set_active_time_point()
Selects the active time step on time-aware readers (for example, PVDReader).
Delegates to TimeReader.set_active_time_point() on the underlying reader.
If the current reader is not time-aware, this method is a silent no-op and returns None.
Parameters
time_point(int) — Zero-based index of the time step to activate. Supports Python negative indexing:0selects the first time step,-1the last,-2the second-to-last, and so on.
Returns
None
note
After calling set_active_time_point(), the next call to show() or export() will re-read the mesh at the newly selected time step.
You can inspect the resulting time value with active_time_value, or retrieve all available time values via time_values.
Example
from pyemsi import Plotter, examples
file_path = examples.transient_path()
p = Plotter(file_path)
print(p.number_time_points) # 10
print(p.time_values) # [0.01, 0.02, 0.03, ..., 0.1]
p.set_active_time_point(0) # first time step (t = 0.01 s)
p.set_active_time_point(-1) # last time step (t = 0.1 s, equivalent to index 9)
p.set_active_time_point(-2) # second-to-last (t = 0.09 s, equivalent to index 8)
p.set_scalar("B-Mag (T)")
p.show()
See also
set_active_time_value()— select a time step by its actual time value instead of its indextime_point_value()— convert a time step index to its time valueactive_time_value— read the currently active time valuetime_values— list all available time valuesnumber_time_points— total count of available time steps