#!/opt/local/bin/python2.7 # script to process DNS statistics # Chiel van Heerwaarden, 2011 # Cedrick Ansorge, 2015 # import stats2nc pathes=['.'] types= ['avg','avg1s','avg2s'] jmax = 512 for p in pathes: for t in types: # d = stats2nc.avg2dict(t,p, jmax,0) d = stats2nc.avg2dict(t,p, jmax,1) #if gzipped files if ( d != -1 ): tstart=d['Iteration'][0] tend =d['Iteration'][len(d['Iteration'][:])-1] stats2nc.dict2nc(d, '{}/{}{}-{}'.format(p,t,tstart,tend)) else: 'ERROR - in directory:', p 'ERROR creating the dictionary with stats2nc seems to have failed' 'ERROR for files of type', t
# script to process DNS statistics # Chiel van Heerwaarden, 2011 import stats2nc # specify the time steps and the number of grid points path_hom = '/home/zmaw/u300202/python/plot_test' tstart = 100 tend = 700 tstep = 100 jmax = 512 [avg, avg1s] = stats2nc.avg2dict(path_hom, tstart, tend, tstep, jmax) stats2nc.dict2nc(avg, "avg_hom_hires") stats2nc.dict2nc(avg1s, "avg1s_hom_hires") del(avg, avg1s) #[avg, avg1s] = stats2nc.avg2dict(path_het2, tstart, tend, tstep, jmax) #stats2nc.dict2nc(avg, "avg_het2") #stats2nc.dict2nc(avg1s, "avg1s_het2") #del(avg, avg1s) #
#!/opt/local/bin/python2.7 # script to process DNS statistics # Chiel van Heerwaarden, 2011 # Cedrick Ansorge, 2015 # import stats2nc pathes = ["."] types = ["avg", "avg1s", "avg2s"] jmax = 512 for p in pathes: for t in types: # d = stats2nc.avg2dict(t,p, jmax,0) d = stats2nc.avg2dict(t, p, jmax, 1) # if gzipped files if d != -1: tstart = d["Iteration"][0] tend = d["Iteration"][len(d["Iteration"][:]) - 1] stats2nc.dict2nc(d, "{}/{}{}-{}".format(p, t, tstart, tend)) else: "ERROR - in directory:", p "ERROR creating the dictionary with stats2nc seems to have failed" "ERROR for files of type", t
#!/opt/local/bin/python2.7 # script to process DNS statistics # Chiel van Heerwaarden, 2011 import stats2nc pathes=['/Users/cedrick/WORK/phd/experiments/ekman_stable/3072x0512x6144_1000_003.65/statistics/'] types= ['avg','avg1s','int'] jmax = 512 for p in pathes: for t in types: d = stats2nc.avg2dict(t,p, jmax,0) if ( d != -1 ): tstart=d['Iteration'][0] tend =d['Iteration'][len(d['Iteration'][:])-1] stats2nc.dict2nc(d, '{}/{}{}-{}'.format(p,t,tstart,tend)) else: 'ERROR - in directory:', p 'ERROR creating the dictionary with stats2nc seems to have failed' 'ERROR for files of type', t