Commit 883bcfd3 authored by Tobias Schulzki's avatar Tobias Schulzki

Add python scripts

parent 0134119e
def start_cue(self): pass
import datetime as dt
from paraview.simple import *
import numpy as np
def tick(self):
scene = GetAnimationScene()
scTime = scene.AnimationTime
yr = np.floor(1900 + scTime/(365*24*60*60))
dm = dt.datetime.fromordinal(int(np.ceil((1900 + scTime/(365*24*60*60))%1* 365)))
month = dm.month
day = dm.day
if month < 10:
month = '0' + str(month)
else:
month = str(month)
if day < 10:
day = '0'+str(day)
else:
day = str(day)
textSource = paraview.simple.FindSource('DateLabel')
textSource.Expression = " '%s-%s-%i' " %((day),(month),(yr))
def end_cue(self): pass
def start cue(self): pass
from paraview.simple import *
### Replace lists ##########
day_li = [3,8,13,23,28,2,7,...]
month_li = [1,1,1,1,1,1,2,2,2,2,2,2,3,...]
yearl_li = [1990,1900,1990,1990,1990,1990,1990,1990,...,1991,1991,1991,...]
#############################
def tick(self): pass
scene = GetAnimationScene()
scTime = scene.AnimationTime
## Replace first timestep (seconds since 1900-01-01)
days_1 = int((scTime-3153816000)/(60*60*24))
date = paraview.simple.FindSource('Date')
i=days 1/5
if day_li[i] < 10:
day = '0' + str(day_li[i])
else:
day = str(day_li[i])
if month_li[i] < 10:
month = '0' + str(month_li[i])
else:
month = str(month_li[i])
year = str(year_li[i])
date.Text = day + '-' + month+ '-' + year
def end cue(self): pass
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment