Added function to handle 3 filter types

Depending on the input data there are 3 cases:
1 spatial and temporal filtering
2 spatial filtering
3 temporal filtering
renamed function