I have a time dependent data set where each frame corresponds to a certain date. I need to show the time annotation, much like what Annotate Time Filter does, but show the date instead of time as a float value. How can I do that?

In python I can convert the time index to a date with datetime for instance:

init_date = datetime.datetime(2018, 1, 1)
time_step = 3600.
itime = 20
date = init_date + datetime.timedelta(seconds=itime*time_step)
print(date.strftime('%Y-%m-%d %H:%M'))
  • $\begingroup$ You can record a script and then check the code. $\endgroup$ – nicoguaro Aug 21 '18 at 12:44
  • $\begingroup$ I can use Tools->Start Trace to get Python code for creating an annotation filter. However, it will just show a call to AnnotateTimeFilter(Input=...). I'd need to modify the filter itself or create a Programmable filter that modifies its output. $\endgroup$ – teekarna Aug 21 '18 at 13:05
  • $\begingroup$ I just checked the last ParaView Guide and it has several material on using ParaView through Python. $\endgroup$ – nicoguaro Aug 21 '18 at 16:21
  • $\begingroup$ You are still not answering the question... $\endgroup$ – teekarna Aug 21 '18 at 19:34

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.