source: ETALON/CLIO/control/process_recent_files.py @ 691

Last change on this file since 691 was 691, checked in by delerue, 7 years ago

CLIO control updated

File size: 1.6 KB
Line 
1# -*- coding: utf-8 -*-
2"""
3Created on Sun Mar  5 18:55:27 2017
4
5Process the latest data file
6
7@author: delerue
8"""
9import glob
10import time
11
12
13global basedir
14global FILE_STOP
15global FILE_PAUSE
16global data_directory
17
18from clio_constants import *
19from read_plot_data import *
20
21from motor_function import *
22
23#import os
24
25#FILE_STOP='/home/etalon-admin/acquisition_data/stop_acquisition';
26
27filemask='data_CLIO*.txt'
28list_of_files = glob.glob(data_directory+filemask)
29
30#print repr(list_of_files)
31
32while (len(glob.glob(FILE_STOP))==0):
33    list_of_files = glob.glob(data_directory+filemask)
34    ifile=0
35    for filename in sorted(list_of_files, reverse=True):   
36#        if ifile<5:
37#            print filename
38        if (len(glob.glob(filename.replace(".txt",".png")))==0):
39            statinfo=os.stat(filename)
40            if statinfo.st_size>0:
41                print filename
42                read_plot_data(filename) 
43                break
44#        else:
45#           if ifile<5:
46#                print "Already processed"
47        ifile=ifile+1
48
49#   
50       
51   
52#    filetime=os.path.getctime(filename)
53#    print filetime
54
55#filetuple=[ (os.path.getctime(filename) , filename) for filename in list_of_files ]
56#print repr(filetuple)
57#sorted(student_tuples, key=lambda student: student[2])
58
59
60#sorted_filenames=[ ]
61
62#sorted([5, 2, 3, 1, 4])
63#mylist=['a','b','c','d','e']
64#myorder=[3,2,0,1,4]
65#mylist = [ mylist[i] for i in myorder]
66#print mylist
67   
68#        if (len(list_of_files_with_signal)>0):
69#            latest_file_with_signal = max(list_of_files_with_signal, key=os.path.getctime)
70#            filetime=os.path.getctime(latest_file_with_signal)
71
72
73
Note: See TracBrowser for help on using the repository browser.