# Annotate date in the viewport of the 3D visualization

**URL:** https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683
**Category:** ParaView Support
**Created:** [June 25, 2020, 5:22pm UTC](https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683 "2020-06-25T17:22:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![savalma](https://discourse.paraview.org/user_avatar/discourse.paraview.org/savalma/32/3928_2.png) [@savalma](https://discourse.paraview.org/u/savalma)
#### Post date: [June 25, 2020, 5:22pm UTC](https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683/1 "2020-06-25T17:22:44Z")

</div>

Hi Paraview Member,

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 the attention

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 26, 2020, 2:09am UTC](https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683/2 "2020-06-26T02:09:48Z")

</div>

The correct formula is : `t_value`

Alternatively, you can use the Annotate Time filter.

---

<div class="post-metadata">

### Author: ![savalma](https://discourse.paraview.org/user_avatar/discourse.paraview.org/savalma/32/3928_2.png) [@savalma](https://discourse.paraview.org/u/savalma)
#### Post date: [June 26, 2020, 2:54am UTC](https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683/3 "2020-06-26T02:54:12Z")

</div>

Hi Mathieu,

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.

Thank you,  
Sergio

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 26, 2020, 2:55am UTC](https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683/4 "2020-06-26T02:55:20Z")

</div>

Can you share your dataset ?

---

<div class="post-metadata">

### Author: ![savalma](https://discourse.paraview.org/user_avatar/discourse.paraview.org/savalma/32/3928_2.png) [@savalma](https://discourse.paraview.org/u/savalma)
#### Post date: [June 26, 2020, 3:10am UTC](https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683/5 "2020-06-26T03:10:13Z")

</div>

Sure, I have attached the csv file and shared the link for the associated vtk files.

[ParaviewRef\_v1.csv](https://discourse.paraview.org/uploads/short-url/1iYrfs7rGcTBsHqbhyRABMSFCWP.csv) (58 Bytes)

[https://ucdavis.box.com/s/vu7lf1rubvrqt28cip9h1z9jiziokas2](https://ucdavis.box.com/s/vu7lf1rubvrqt28cip9h1z9jiziokas2)

Thank you

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 26, 2020, 3:21am UTC](https://discourse.paraview.org/t/annotate-date-in-the-viewport-of-the-3d-visualization/4683/6 "2020-06-26T03:21:15Z")

</div>

Your problem is that your .csv file doesn’t have a time associated to it.  
A simple work around is to duplicate and rename it :

```
ParaViewRef_v1_0.csv
ParaViewRef_v1_1.csv
ParaViewRef_v1_2.csv

```

You then open the file series : `ParaViewRef_v1_..csv` and add a PythonAnnotation with the following formula : `Time.GetValue(t_index)`

The correct fix is to add your time data inside the FieldData of your dataset, but that can’t be done using simple filters in ParaView.
