Skip to main content

set_active_time_value()

Selects the active time step by its time value on time-aware readers (for example, PVDReader).

Delegates to TimeReader.set_active_time_value() on the underlying reader.

If the current reader is not time-aware, this method is a silent no-op and returns None.

Parameters
  • time_value (float) — The time value to activate. Must match one of the values in time_values. Use set_active_time_point() instead if you want to select by index rather than by value.
Returns
  • None
note

After calling set_active_time_value(), the next call to show() or export() will re-read the mesh at the newly selected time step. You can confirm the active time value with active_time_value.

Example

from pyemsi import Plotter, examples

file_path = examples.transient_path()
p = Plotter(file_path)

print(p.time_values) # [0.01, 0.02, 0.03, ..., 0.1]

p.set_active_time_value(0.05) # select the t = 0.05 s time step
print(p.active_time_value) # 0.05

p.set_scalar("B-Mag (T)")
p.show()

See also