# NetCDF Date and Time Python Filter

**URL:** https://discourse.paraview.org/t/netcdf-date-and-time-python-filter/8271
**Category:** Tips and Tricks
**Created:** [October 27, 2021, 6:01pm UTC](https://discourse.paraview.org/t/netcdf-date-and-time-python-filter/8271 "2021-10-27T18:01:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![felicia\_vis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/b9bd4f/32.png) [@felicia\_vis](https://discourse.paraview.org/u/felicia_vis)
#### Post date: [October 27, 2021, 6:01pm UTC](https://discourse.paraview.org/t/netcdf-date-and-time-python-filter/8271/1 "2021-10-27T18:01:49Z")

</div>

Hi all,  
I wrote a user-friendly Python filter that adds date (DD/MM/YYYY) and time (hours:min::sec) to NetCDF files, that is easily loaded via the Plugin Manager in a single step.  
I put the filter on GitHub with instructions and example files:

> **[GitHub - FeliciaBrisc/ParaView-NetCDF-Date-And-Time-Plugin](https://github.com/FeliciaBrisc/ParaView-NetCDF-Date-And-Time-Plugin)**
>
> Contribute to FeliciaBrisc/ParaView-NetCDF-Date-And-Time-Plugin development by creating an account on GitHub.

The filter uses the netcdf4-python module, which you can easily install via Anaconda:  
conda install -c anaconda netcdf4 ([Netcdf4 :: Anaconda.org](https://anaconda.org/anaconda/netcdf4) )

This filter is based on an older Python script I wrote, but it’s a lot more user-friendly.  
To get an image how the result looks, the old script can be seen in action in this 2016 video: [Particles simulation of North Atlantic salinity at 20m depth - YouTube](https://youtu.be/wU93GUtCePE) or in this 2018 one: [A tropical-like cyclone in the Mediterranean Sea - YouTube](https://www.youtube.com/watch?v=RsqeJE1ClRU) where the date is in the lower left corner.

Should this be useful, my conda and ParaView configuration (on Windows10):

1. I installed first ParaView 5.8.1 (which works with Python3.7)
2. In the Anaconda prompt(console), I created a Python3.7 environment in conda:  
conda create --name PYTHON37 python=3.7  
2A. Then the env. has to be activated:  
conda activate PYTHON37  
2B. Install netcdf4-python in this environment:  
conda install -c anaconda netcdf4  
2C. Point the system to your conda paths:  
set PYTHONHOME=C:\your\_path\anaconda3\envs\PYTHON37  
set PYTHONPATH=C:\your\_path\anaconda3\envs\PYTHON37\Lib
3. And finally start ParaView in this same conda prompt:  
D:\your\_path\_to\_ParaView581\bin\paraview.exe
4. And if you wish to use the NetCDF\_DateAndTime filter, follow the steps form the Instructions pdf on Github - it’s just a few mouse clicks  
Repeat then step 2A,2C and 3 whenever you start ParaView

(I also added this in a reply on the ParaView Support forum, but thought it might be useful as a tip as well)  
Best,  
Felicia
