I have the dates for every timestep as a string in a file and I want to link this file to create an annotation where I can see the date instead of the time step. I looked at other sources where this question was already asked, but since I already have the file with the date as a string, I thought I would only need to use the python annotation filter. Unfortunately, I am getting the following error and I can’t understand why it does not recognize the column header as a variable name, even though within the error description it is recognized as so.
I am using Time[t_index] within the expression input of the pythonannotation filter
The error I get is this
Failed to evaluate expression ‘Time[t_index]’. The following exception stack should provide additional developer-specific information. This typically implies a malformed expression. Verify that the expression is valid.
Variables in current scope are [‘Hours’, ‘input’, ‘Time’, ‘Id’, ‘Date’]
Traceback (most recent call last):
File “”, line 7, in
File “”, line 5, in vtkPythonAnnotationFilter_EvaluateExpression
File “C:/Program Files/ParaView 5.6.1/bin\Lib/site-packages\paraview\annotation.py”, line 90, in execute
result = calculator.compute(inputs, expression, ns=ns)
File “C:/Program Files/ParaView 5.6.1/bin\Lib/site-packages\paraview\calculator.py”, line 140, in compute
retVal = eval(expression, globals(), mylocals)
File “”, line 1, in
NameError: name ‘t_index’ is not defined
Thank you for replying. Using t_value will print the time step on the screen, but I want to print the date associated to that time step. I have this date already in a string format within a .csv file that has as a column header “Time”, which is why I thought using Time[t_index] would work. But I get that error. I understand that a programmable filter has been used before, but it has been used to change the datetime format into a string format. From what I understand basically to create the file that I already have in the .csv file.