Exemple #1
0
nbr=np.max(df['block2'])
print nbr
liste=np.arange(shotstart,shotend)
listefile=[]
for x in liste:
    listefile.append(str(x).zfill(5)+'_Data.h5')     
j=2
timediff=datetime.timedelta(minutes=1,seconds=0)
timecorrection=datetime.timedelta(minutes=2,seconds=0)
#path=r"D:"+os.sep+"DATA"+os.sep+"Acquired_data"
#path=env.path
for x in listefile:
    #timei=datetime.datetime.strptime(time.ctime(os.path.getmtime(path+os.sep+x+'.h5')),"%a %b %d %H:%M:%S %Y")
    try:    
        #timea=readHdf5.getAttr(x,'date',env)
        timea=sm.getAttr(h5.getNbrfromFile([x])[0],'Date')
        print timea
        #timei=datetime.datetime.strptime(timea,'%d.%m.%Y %H:%M:%S')
        timei=timea
        #print x
        matched=False
        while not(matched):
            data0=df[df['block']==j]['Time'].values
            print data0
            timef=datetime.datetime.utcfromtimestamp((data0[0]- np.datetime64('1970-01-01T00:00:00Z')) / np.timedelta64(1, 's'))
            print timei,(timef+timecorrection),timef
            timef=timef+timecorrection        
            if timei>timef:        
                deltat=timei-timef
            else:
                deltat=timef-timei