##// END OF EJS Templates
imanay -
r82:83
parent child
Show More
@@ -1,496 +1,496
1 # imports needed for the file convertion No newline at end of file
1 # imports needed for the file convertion
2 import os No newline at end of file
2 import os
3 import sys No newline at end of file
3 import sys
4 import time No newline at end of file
4 import time
5 import numpy as np No newline at end of file
5 import numpy as np
6 No newline at end of file
6
7 import library3 No newline at end of file
7 import library3
8 No newline at end of file
8
9 class ABSClient: No newline at end of file
9 class ABSClient:
10 No newline at end of file
10
11 def __init__(self,ipSource="localhost", ipDestino="192.168.1.117", portDestino=7000): No newline at end of file
11 def __init__(self,ipSource="localhost", ipDestino="192.168.1.117", portDestino=7000):
12 No newline at end of file
12
13 self.ipSource = ipSource No newline at end of file
13 self.ipSource = ipSource
14 self.ipDestino = ipDestino No newline at end of file
14 self.ipDestino = ipDestino
15 self.portDestino = portDestino No newline at end of file
15 self.portDestino = portDestino
16 No newline at end of file
16
17 self.createObjects() No newline at end of file
17 self.createObjects()
18 No newline at end of file
18
19 def createObjects(self): No newline at end of file
19 def createObjects(self):
20 No newline at end of file
20
21 self.commObj = library3.TCPComm(self.ipSource, self.ipDestino, self.portDestino) No newline at end of file
21 self.commObj = library3.TCPComm(self.ipSource, self.ipDestino, self.portDestino)
22 No newline at end of file
22
23 def sendFile(self, filename): No newline at end of file
23 def sendFile(self, filename):
24 No newline at end of file
24
25 #From matriz to control module format No newline at end of file
25 #From matriz to control module format
26 self.FuncionMaestra_GeneraFormatoControlCentral(filename) No newline at end of file
26 self.FuncionMaestra_GeneraFormatoControlCentral(filename)
27 FileName = "FormatoControlCentral.txt" No newline at end of file
27 FileName = "FormatoControlCentral.txt"
28 F_Obj = open(FileName,"r") No newline at end of file
28 F_Obj = open(FileName,"r")
29 FileList = F_Obj.readlines() No newline at end of file
29 FileList = F_Obj.readlines()
30 F_Obj.close() No newline at end of file
30 F_Obj.close()
31 FileStr = "".join(FileList) No newline at end of file
31 FileStr = "".join(FileList)
32 data = FileStr No newline at end of file
32 data = FileStr
33 No newline at end of file
33
34 self.commObj.open_socket() No newline at end of file
34 self.commObj.open_socket()
35 # self.commObj.sendData(cmd="SNDF", data=data, id = 117) No newline at end of file
35 # self.commObj.sendData(cmd="SNDF", data=data, id = 117)
36 self.commObj.sendData2(cmd="SNDF", data=data, ipDestino = self.ipDestino) No newline at end of file
36 self.commObj.sendData2(cmd="SNDF", data=data, ipDestino = self.ipDestino)
37 # self.commObj.waitData() No newline at end of file
37 # self.commObj.waitData()
38 self.commObj.waitClient() No newline at end of file
38 self.commObj.waitClient()
39 self.commObj.close_socket() No newline at end of file
39 self.commObj.close_socket()
40 No newline at end of file
40
41 def changeBeam(self, newBeam): No newline at end of file
41 def changeBeam(self, newBeam):
42 No newline at end of file
42
43 self.commObj.open_socket() No newline at end of file
43 self.commObj.open_socket()
44 # self.commObj.sendData(cmd="CHGB", data=newBeam, id = 117) No newline at end of file
44 # self.commObj.sendData(cmd="CHGB", data=newBeam, id = 117)
45 self.commObj.sendData2(cmd="CHGB", data=newBeam, ipDestino = self.ipDestino) No newline at end of file
45 self.commObj.sendData2(cmd="CHGB", data=newBeam, ipDestino = self.ipDestino)
46 # self.commObj.waitData() No newline at end of file
46 # self.commObj.waitData()
47 self.commObj.waitClient() No newline at end of file
47 self.commObj.waitClient()
48 self.commObj.close_socket() No newline at end of file
48 self.commObj.close_socket()
49 No newline at end of file
49
50 def __writeFile(self, filename, data): No newline at end of file
50 def __writeFile(self, filename, data):
51 No newline at end of file
51
52 fobj = open(filename,"w") No newline at end of file
52 fobj = open(filename,"w")
53 fobj.writelines(data) No newline at end of file
53 fobj.writelines(data)
54 fobj.close() No newline at end of file
54 fobj.close()
55 No newline at end of file
55
56 def getControlModuleStatus(self, data): No newline at end of file
56 def getControlModuleStatus(self, data):
57 No newline at end of file
57
58 self.commObj.open_socket() No newline at end of file
58 self.commObj.open_socket()
59 # self.commObj.sendData(cmd="ANST", data = data, id = 117) No newline at end of file
59 # self.commObj.sendData(cmd="ANST", data = data, id = 117)
60 self.commObj.sendData2(cmd="ANST", data = data, ipDestino = self.ipDestino) No newline at end of file
60 self.commObj.sendData2(cmd="ANST", data = data, ipDestino = self.ipDestino)
61 # ipSource, ipDestino, cmd, data = self.commObj.waitData() No newline at end of file
61 # ipSource, ipDestino, cmd, data = self.commObj.waitData()
62 ipSource, ipDestino, cmd, data = self.commObj.waitClient() No newline at end of file
62 ipSource, ipDestino, cmd, data = self.commObj.waitClient()
63 self.commObj.close_socket() No newline at end of file
63 self.commObj.close_socket()
64 self.__writeFile("report.txt", data) No newline at end of file
64 self.__writeFile("report.txt", data)
65 No newline at end of file
65
66 def getConnectionStatus(self): No newline at end of file
66 def getConnectionStatus(self):
67 No newline at end of file
67
68 self.commObj.open_socket() No newline at end of file
68 self.commObj.open_socket()
69 self.commObj.sendData2(cmd="NTST", data = "none", ipDestino = "192.168.1.117") No newline at end of file
69 self.commObj.sendData2(cmd="NTST", data = "none", ipDestino = "192.168.1.117")
70 ipSource, ipDestino, cmd, data = self.commObj.waitClient() No newline at end of file
70 ipSource, ipDestino, cmd, data = self.commObj.waitClient()
71 self.commObj.close_socket() No newline at end of file
71 self.commObj.close_socket()
72 self.__writeFile("connection_status.txt", data) No newline at end of file
72 self.__writeFile("connection_status.txt", data)
73 No newline at end of file
73
74 ########## No newline at end of file
74 ##########
75 No newline at end of file
75
76 def FuncionMaestra_GeneraFormatoControlCentral(self,archivo): No newline at end of file
76 def FuncionMaestra_GeneraFormatoControlCentral(self,archivo):
77 """ Funcion que genera un archivo para el control central""" No newline at end of file
77 """ Funcion que genera un archivo para el control central"""
78 No newline at end of file
78
79 CarpetaDeTrabajo = os.getcwd() + '/' No newline at end of file
79 CarpetaDeTrabajo = os.getcwd() + '/'
80 No newline at end of file
80
81 def lst2string(lst): No newline at end of file
81 def lst2string(lst):
82 string='' No newline at end of file
82 string=''
83 for i in lst: No newline at end of file
83 for i in lst:
84 string=string+i No newline at end of file
84 string=string+i
85 return string No newline at end of file
85 return string
86 No newline at end of file
86
87 def string2lst(string): No newline at end of file
87 def string2lst(string):
88 lst = [] No newline at end of file
88 lst = []
89 for i in string: No newline at end of file
89 for i in string:
90 lst.append(i) No newline at end of file
90 lst.append(i)
91 return lst No newline at end of file
91 return lst
92 No newline at end of file
92
93 No newline at end of file
93
94 def file1(string, type): No newline at end of file
94 def file1(string, type):
95 lst = string2lst(archivo) No newline at end of file
95 lst = string2lst(archivo)
96 fin = -1 No newline at end of file
96 fin = -1
97 t = len(lst) No newline at end of file
97 t = len(lst)
98 for i in np.arange(-1,-t,-1): No newline at end of file
98 for i in np.arange(-1,-t,-1):
99 if lst[i]=='/': No newline at end of file
99 if lst[i]=='/':
100 fin=i No newline at end of file
100 fin=i
101 break No newline at end of file
101 break
102 if type == '1': No newline at end of file
102 if type == '1':
103 nombre2 = lst[fin+1:] No newline at end of file
103 nombre2 = lst[fin+1:]
104 nombre2[-1]='s' No newline at end of file
104 nombre2[-1]='s'
105 nombre2 = lst2string(nombre2) No newline at end of file
105 nombre2 = lst2string(nombre2)
106 return nombre2 No newline at end of file
106 return nombre2
107 if type == '2': No newline at end of file
107 if type == '2':
108 nombre2 = lst[fin+1:] No newline at end of file
108 nombre2 = lst[fin+1:]
109 nombre2[-1]='1' No newline at end of file
109 nombre2[-1]='1'
110 nombre2 = lst2string(nombre2) No newline at end of file
110 nombre2 = lst2string(nombre2)
111 return nombre2 No newline at end of file
111 return nombre2
112 No newline at end of file
112
113 No newline at end of file
113
114 def EliminaSaltoDeLinea(cadena): No newline at end of file
114 def EliminaSaltoDeLinea(cadena):
115 i = 0 No newline at end of file
115 i = 0
116 for elemento in cadena: No newline at end of file
116 for elemento in cadena:
117 if elemento =='\n' or elemento =='\r': No newline at end of file
117 if elemento =='\n' or elemento =='\r':
118 pass No newline at end of file
118 pass
119 else: No newline at end of file
119 else:
120 i=i+1 No newline at end of file
120 i=i+1
121 return cadena [:i] No newline at end of file
121 return cadena [:i]
122 No newline at end of file
122
123 def NumeroDeExperimentos(path): No newline at end of file
123 def NumeroDeExperimentos(path):
124 fichero1=open(path,'r') No newline at end of file
124 fichero1=open(path,'r')
125 cont=0 No newline at end of file
125 cont=0
126 for cadena in fichero1: No newline at end of file
126 for cadena in fichero1:
127 cont=cont+1 No newline at end of file
127 cont=cont+1
128 if cont==3: No newline at end of file
128 if cont==3:
129 nexp='' No newline at end of file
129 nexp=''
130 pos=0 No newline at end of file
130 pos=0
131 for elemento in cadena: No newline at end of file
131 for elemento in cadena:
132 pos=pos+1 No newline at end of file
132 pos=pos+1
133 if elemento=='=': No newline at end of file
133 if elemento=='=':
134 nexp=int(cadena[pos:]) No newline at end of file
134 nexp=int(cadena[pos:])
135 return nexp No newline at end of file
135 return nexp
136 fichero1.close() No newline at end of file
136 fichero1.close()
137 No newline at end of file
137
138 def Paridad(numero): No newline at end of file
138 def Paridad(numero):
139 if numero%2==0: return 'par' No newline at end of file
139 if numero%2==0: return 'par'
140 elif numero%2==1: return 'impar' No newline at end of file
140 elif numero%2==1: return 'impar'
141 No newline at end of file
141
142 def EvaluaCadena(cadena): No newline at end of file
142 def EvaluaCadena(cadena):
143 if len(cadena)>35: No newline at end of file
143 if len(cadena)>35:
144 if cadena[-1]=='$': No newline at end of file
144 if cadena[-1]=='$':
145 return cadena[-35:-2] No newline at end of file
145 return cadena[-35:-2]
146 elif cadena[-1]==']': No newline at end of file
146 elif cadena[-1]==']':
147 return cadena[-34:-1] No newline at end of file
147 return cadena[-34:-1]
148 else: No newline at end of file
148 else:
149 return None No newline at end of file
149 return None
150 No newline at end of file
150
151 def GuardaEnLista(path): No newline at end of file
151 def GuardaEnLista(path):
152 fichero=open(path,'r') No newline at end of file
152 fichero=open(path,'r')
153 lista=[] No newline at end of file
153 lista=[]
154 for cadena in fichero: No newline at end of file
154 for cadena in fichero:
155 cadena = EliminaSaltoDeLinea(cadena) No newline at end of file
155 cadena = EliminaSaltoDeLinea(cadena)
156 cadena = EvaluaCadena(cadena) No newline at end of file
156 cadena = EvaluaCadena(cadena)
157 if cadena != None: No newline at end of file
157 if cadena != None:
158 lista.append(cadena) No newline at end of file
158 lista.append(cadena)
159 fichero.close() No newline at end of file
159 fichero.close()
160 return lista No newline at end of file
160 return lista
161 No newline at end of file
161
162 def CreaFicherosPrevios(): No newline at end of file
162 def CreaFicherosPrevios():
163 vector = GuardaEnLista(archivo) No newline at end of file
163 vector = GuardaEnLista(archivo)
164 for i in range(1,NumeroDeExperimentos(archivo)+1): No newline at end of file
164 for i in range(1,NumeroDeExperimentos(archivo)+1):
165 fichero =open(CarpetaDeTrabajo+str(i)+'.txt','w') No newline at end of file
165 fichero =open(CarpetaDeTrabajo+str(i)+'.txt','w')
166 for j in range(0,16): No newline at end of file
166 for j in range(0,16):
167 fichero.write(vector[j+16*(i-1)]+'\n') No newline at end of file
167 fichero.write(vector[j+16*(i-1)]+'\n')
168 fichero.close() No newline at end of file
168 fichero.close()
169 No newline at end of file
169
170 def CapturaValoresEnArchivo(path,polarizacion='up'): No newline at end of file
170 def CapturaValoresEnArchivo(path,polarizacion='up'):
171 fichero =open(path,'r') No newline at end of file
171 fichero =open(path,'r')
172 cnt=0 No newline at end of file
172 cnt=0
173 lstup=[] No newline at end of file
173 lstup=[]
174 lstdw=[] No newline at end of file
174 lstdw=[]
175 for cadena in fichero: No newline at end of file
175 for cadena in fichero:
176 cnt=cnt+1 No newline at end of file
176 cnt=cnt+1
177 if cnt==5: No newline at end of file
177 if cnt==5:
178 su01=cadena[17:20] No newline at end of file
178 su01=cadena[17:20]
179 su02=cadena[21:24] No newline at end of file
179 su02=cadena[21:24]
180 su03=cadena[25:28] No newline at end of file
180 su03=cadena[25:28]
181 su04=cadena[29:32] No newline at end of file
181 su04=cadena[29:32]
182 if cnt==6: No newline at end of file
182 if cnt==6:
183 su05=cadena[17:20] No newline at end of file
183 su05=cadena[17:20]
184 su06=cadena[21:24] No newline at end of file
184 su06=cadena[21:24]
185 su07=cadena[25:28] No newline at end of file
185 su07=cadena[25:28]
186 su08=cadena[29:32] No newline at end of file
186 su08=cadena[29:32]
187 if cnt==7: No newline at end of file
187 if cnt==7:
188 su09=cadena[17:20] No newline at end of file
188 su09=cadena[17:20]
189 su10=cadena[21:24] No newline at end of file
189 su10=cadena[21:24]
190 su11=cadena[25:28] No newline at end of file
190 su11=cadena[25:28]
191 su12=cadena[29:32] No newline at end of file
191 su12=cadena[29:32]
192 if cnt==8: No newline at end of file
192 if cnt==8:
193 su13=cadena[17:20] No newline at end of file
193 su13=cadena[17:20]
194 su14=cadena[21:24] No newline at end of file
194 su14=cadena[21:24]
195 su15=cadena[25:28] No newline at end of file
195 su15=cadena[25:28]
196 su16=cadena[29:32] No newline at end of file
196 su16=cadena[29:32]
197 if cnt==13: No newline at end of file
197 if cnt==13:
198 sd01=cadena[17:20] No newline at end of file
198 sd01=cadena[17:20]
199 sd02=cadena[21:24] No newline at end of file
199 sd02=cadena[21:24]
200 sd03=cadena[25:28] No newline at end of file
200 sd03=cadena[25:28]
201 sd04=cadena[29:32] No newline at end of file
201 sd04=cadena[29:32]
202 if cnt==14: No newline at end of file
202 if cnt==14:
203 sd05=cadena[17:20] No newline at end of file
203 sd05=cadena[17:20]
204 sd06=cadena[21:24] No newline at end of file
204 sd06=cadena[21:24]
205 sd07=cadena[25:28] No newline at end of file
205 sd07=cadena[25:28]
206 sd08=cadena[29:32] No newline at end of file
206 sd08=cadena[29:32]
207 if cnt==15: No newline at end of file
207 if cnt==15:
208 sd09=cadena[17:20] No newline at end of file
208 sd09=cadena[17:20]
209 sd10=cadena[21:24] No newline at end of file
209 sd10=cadena[21:24]
210 sd11=cadena[25:28] No newline at end of file
210 sd11=cadena[25:28]
211 sd12=cadena[29:32] No newline at end of file
211 sd12=cadena[29:32]
212 if cnt==16: No newline at end of file
212 if cnt==16:
213 sd13=cadena[17:20] No newline at end of file
213 sd13=cadena[17:20]
214 sd14=cadena[21:24] No newline at end of file
214 sd14=cadena[21:24]
215 sd15=cadena[25:28] No newline at end of file
215 sd15=cadena[25:28]
216 sd16=cadena[29:32] No newline at end of file
216 sd16=cadena[29:32]
217 lstup=[su01,su02,su03,su04,su05,su06,su07,su08,su09,su10,su11,su12,su13,su14,su15,su16] No newline at end of file
217 lstup=[su01,su02,su03,su04,su05,su06,su07,su08,su09,su10,su11,su12,su13,su14,su15,su16]
218 lstdw=[sd01,sd02,sd03,sd04,sd05,sd06,sd07,sd08,sd09,sd10,sd11,sd12,sd13,sd14,sd15,sd16] No newline at end of file
218 lstdw=[sd01,sd02,sd03,sd04,sd05,sd06,sd07,sd08,sd09,sd10,sd11,sd12,sd13,sd14,sd15,sd16]
219 if polarizacion=='up': No newline at end of file
219 if polarizacion=='up':
220 return lstup No newline at end of file
220 return lstup
221 elif polarizacion=='dw': No newline at end of file
221 elif polarizacion=='dw':
222 return lstdw No newline at end of file
222 return lstdw
223 fichero.close() No newline at end of file
223 fichero.close()
224 No newline at end of file
224
225 def CapturaValoresEnArchivo2(path,polarizacion='up'): No newline at end of file
225 def CapturaValoresEnArchivo2(path,polarizacion='up'):
226 fichero =open(path,'r') No newline at end of file
226 fichero =open(path,'r')
227 cnt=0 No newline at end of file
227 cnt=0
228 lstup=[] No newline at end of file
228 lstup=[]
229 lstdw=[] No newline at end of file
229 lstdw=[]
230 for cadena in fichero: No newline at end of file
230 for cadena in fichero:
231 cnt=cnt+1 No newline at end of file
231 cnt=cnt+1
232 if cnt==1: No newline at end of file
232 if cnt==1:
233 nu01=cadena[1:4] No newline at end of file
233 nu01=cadena[1:4]
234 nu02=cadena[5:8] No newline at end of file
234 nu02=cadena[5:8]
235 nu03=cadena[9:12] No newline at end of file
235 nu03=cadena[9:12]
236 nu04=cadena[13:16] No newline at end of file
236 nu04=cadena[13:16]
237 eu01=cadena[17:20] No newline at end of file
237 eu01=cadena[17:20]
238 eu02=cadena[21:24] No newline at end of file
238 eu02=cadena[21:24]
239 eu03=cadena[25:28] No newline at end of file
239 eu03=cadena[25:28]
240 eu04=cadena[29:32] No newline at end of file
240 eu04=cadena[29:32]
241 if cnt==2: No newline at end of file
241 if cnt==2:
242 nu05=cadena[1:4] No newline at end of file
242 nu05=cadena[1:4]
243 nu06=cadena[5:8] No newline at end of file
243 nu06=cadena[5:8]
244 nu07=cadena[9:12] No newline at end of file
244 nu07=cadena[9:12]
245 nu08=cadena[13:16] No newline at end of file
245 nu08=cadena[13:16]
246 eu05=cadena[17:20] No newline at end of file
246 eu05=cadena[17:20]
247 eu06=cadena[21:24] No newline at end of file
247 eu06=cadena[21:24]
248 eu07=cadena[25:28] No newline at end of file
248 eu07=cadena[25:28]
249 eu08=cadena[29:32] No newline at end of file
249 eu08=cadena[29:32]
250 if cnt==3: No newline at end of file
250 if cnt==3:
251 nu09=cadena[1:4] No newline at end of file
251 nu09=cadena[1:4]
252 nu10=cadena[5:8] No newline at end of file
252 nu10=cadena[5:8]
253 nu11=cadena[9:12] No newline at end of file
253 nu11=cadena[9:12]
254 nu12=cadena[13:16] No newline at end of file
254 nu12=cadena[13:16]
255 eu09=cadena[17:20] No newline at end of file
255 eu09=cadena[17:20]
256 eu10=cadena[21:24] No newline at end of file
256 eu10=cadena[21:24]
257 eu11=cadena[25:28] No newline at end of file
257 eu11=cadena[25:28]
258 eu12=cadena[29:32] No newline at end of file
258 eu12=cadena[29:32]
259 if cnt==4: No newline at end of file
259 if cnt==4:
260 nu13=cadena[1:4] No newline at end of file
260 nu13=cadena[1:4]
261 nu14=cadena[5:8] No newline at end of file
261 nu14=cadena[5:8]
262 nu15=cadena[9:12] No newline at end of file
262 nu15=cadena[9:12]
263 nu16=cadena[13:16] No newline at end of file
263 nu16=cadena[13:16]
264 eu13=cadena[17:20] No newline at end of file
264 eu13=cadena[17:20]
265 eu14=cadena[21:24] No newline at end of file
265 eu14=cadena[21:24]
266 eu15=cadena[25:28] No newline at end of file
266 eu15=cadena[25:28]
267 eu16=cadena[29:32] No newline at end of file
267 eu16=cadena[29:32]
268 if cnt==5: No newline at end of file
268 if cnt==5:
269 wu01=cadena[1:4] No newline at end of file
269 wu01=cadena[1:4]
270 wu02=cadena[5:8] No newline at end of file
270 wu02=cadena[5:8]
271 wu03=cadena[9:12] No newline at end of file
271 wu03=cadena[9:12]
272 wu04=cadena[13:16] No newline at end of file
272 wu04=cadena[13:16]
273 su01=cadena[17:20] No newline at end of file
273 su01=cadena[17:20]
274 su02=cadena[21:24] No newline at end of file
274 su02=cadena[21:24]
275 su03=cadena[25:28] No newline at end of file
275 su03=cadena[25:28]
276 su04=cadena[29:32] No newline at end of file
276 su04=cadena[29:32]
277 if cnt==6: No newline at end of file
277 if cnt==6:
278 wu05=cadena[1:4] No newline at end of file
278 wu05=cadena[1:4]
279 wu06=cadena[5:8] No newline at end of file
279 wu06=cadena[5:8]
280 wu07=cadena[9:12] No newline at end of file
280 wu07=cadena[9:12]
281 wu08=cadena[13:16] No newline at end of file
281 wu08=cadena[13:16]
282 su05=cadena[17:20] No newline at end of file
282 su05=cadena[17:20]
283 su06=cadena[21:24] No newline at end of file
283 su06=cadena[21:24]
284 su07=cadena[25:28] No newline at end of file
284 su07=cadena[25:28]
285 su08=cadena[29:32] No newline at end of file
285 su08=cadena[29:32]
286 if cnt==7: No newline at end of file
286 if cnt==7:
287 wu09=cadena[1:4] No newline at end of file
287 wu09=cadena[1:4]
288 wu10=cadena[5:8] No newline at end of file
288 wu10=cadena[5:8]
289 wu11=cadena[9:12] No newline at end of file
289 wu11=cadena[9:12]
290 wu12=cadena[13:16] No newline at end of file
290 wu12=cadena[13:16]
291 su09=cadena[17:20] No newline at end of file
291 su09=cadena[17:20]
292 su10=cadena[21:24] No newline at end of file
292 su10=cadena[21:24]
293 su11=cadena[25:28] No newline at end of file
293 su11=cadena[25:28]
294 su12=cadena[29:32] No newline at end of file
294 su12=cadena[29:32]
295 if cnt==8: No newline at end of file
295 if cnt==8:
296 wu13=cadena[1:4] No newline at end of file
296 wu13=cadena[1:4]
297 wu14=cadena[5:8] No newline at end of file
297 wu14=cadena[5:8]
298 wu15=cadena[9:12] No newline at end of file
298 wu15=cadena[9:12]
299 wu16=cadena[13:16] No newline at end of file
299 wu16=cadena[13:16]
300 su13=cadena[17:20] No newline at end of file
300 su13=cadena[17:20]
301 su14=cadena[21:24] No newline at end of file
301 su14=cadena[21:24]
302 su15=cadena[25:28] No newline at end of file
302 su15=cadena[25:28]
303 su16=cadena[29:32] No newline at end of file
303 su16=cadena[29:32]
304 if cnt==9: No newline at end of file
304 if cnt==9:
305 nd01=cadena[1:4] No newline at end of file
305 nd01=cadena[1:4]
306 nd02=cadena[5:8] No newline at end of file
306 nd02=cadena[5:8]
307 nd03=cadena[9:12] No newline at end of file
307 nd03=cadena[9:12]
308 nd04=cadena[13:16] No newline at end of file
308 nd04=cadena[13:16]
309 ed01=cadena[17:20] No newline at end of file
309 ed01=cadena[17:20]
310 ed02=cadena[21:24] No newline at end of file
310 ed02=cadena[21:24]
311 ed03=cadena[25:28] No newline at end of file
311 ed03=cadena[25:28]
312 ed04=cadena[29:32] No newline at end of file
312 ed04=cadena[29:32]
313 if cnt==10: No newline at end of file
313 if cnt==10:
314 nd05=cadena[1:4] No newline at end of file
314 nd05=cadena[1:4]
315 nd06=cadena[5:8] No newline at end of file
315 nd06=cadena[5:8]
316 nd07=cadena[9:12] No newline at end of file
316 nd07=cadena[9:12]
317 nd08=cadena[13:16] No newline at end of file
317 nd08=cadena[13:16]
318 ed05=cadena[17:20] No newline at end of file
318 ed05=cadena[17:20]
319 ed06=cadena[21:24] No newline at end of file
319 ed06=cadena[21:24]
320 ed07=cadena[25:28] No newline at end of file
320 ed07=cadena[25:28]
321 ed08=cadena[29:32] No newline at end of file
321 ed08=cadena[29:32]
322 if cnt==11: No newline at end of file
322 if cnt==11:
323 nd09=cadena[1:4] No newline at end of file
323 nd09=cadena[1:4]
324 nd10=cadena[5:8] No newline at end of file
324 nd10=cadena[5:8]
325 nd11=cadena[9:12] No newline at end of file
325 nd11=cadena[9:12]
326 nd12=cadena[13:16] No newline at end of file
326 nd12=cadena[13:16]
327 ed09=cadena[17:20] No newline at end of file
327 ed09=cadena[17:20]
328 ed10=cadena[21:24] No newline at end of file
328 ed10=cadena[21:24]
329 ed11=cadena[25:28] No newline at end of file
329 ed11=cadena[25:28]
330 ed12=cadena[29:32] No newline at end of file
330 ed12=cadena[29:32]
331 if cnt==12: No newline at end of file
331 if cnt==12:
332 nd13=cadena[1:4] No newline at end of file
332 nd13=cadena[1:4]
333 nd14=cadena[5:8] No newline at end of file
333 nd14=cadena[5:8]
334 nd15=cadena[9:12] No newline at end of file
334 nd15=cadena[9:12]
335 nd16=cadena[13:16] No newline at end of file
335 nd16=cadena[13:16]
336 ed13=cadena[17:20] No newline at end of file
336 ed13=cadena[17:20]
337 ed14=cadena[21:24] No newline at end of file
337 ed14=cadena[21:24]
338 ed15=cadena[25:28] No newline at end of file
338 ed15=cadena[25:28]
339 ed16=cadena[29:32] No newline at end of file
339 ed16=cadena[29:32]
340 if cnt==13: No newline at end of file
340 if cnt==13:
341 wd01=cadena[1:4] No newline at end of file
341 wd01=cadena[1:4]
342 wd02=cadena[5:8] No newline at end of file
342 wd02=cadena[5:8]
343 wd03=cadena[9:12] No newline at end of file
343 wd03=cadena[9:12]
344 wd04=cadena[13:16] No newline at end of file
344 wd04=cadena[13:16]
345 sd01=cadena[17:20] No newline at end of file
345 sd01=cadena[17:20]
346 sd02=cadena[21:24] No newline at end of file
346 sd02=cadena[21:24]
347 sd03=cadena[25:28] No newline at end of file
347 sd03=cadena[25:28]
348 sd04=cadena[29:32] No newline at end of file
348 sd04=cadena[29:32]
349 if cnt==14: No newline at end of file
349 if cnt==14:
350 wd05=cadena[1:4] No newline at end of file
350 wd05=cadena[1:4]
351 wd06=cadena[5:8] No newline at end of file
351 wd06=cadena[5:8]
352 wd07=cadena[9:12] No newline at end of file
352 wd07=cadena[9:12]
353 wd08=cadena[13:16] No newline at end of file
353 wd08=cadena[13:16]
354 sd05=cadena[17:20] No newline at end of file
354 sd05=cadena[17:20]
355 sd06=cadena[21:24] No newline at end of file
355 sd06=cadena[21:24]
356 sd07=cadena[25:28] No newline at end of file
356 sd07=cadena[25:28]
357 sd08=cadena[29:32] No newline at end of file
357 sd08=cadena[29:32]
358 if cnt==15: No newline at end of file
358 if cnt==15:
359 wd09=cadena[1:4] No newline at end of file
359 wd09=cadena[1:4]
360 wd10=cadena[5:8] No newline at end of file
360 wd10=cadena[5:8]
361 wd11=cadena[9:12] No newline at end of file
361 wd11=cadena[9:12]
362 wd12=cadena[13:16] No newline at end of file
362 wd12=cadena[13:16]
363 sd09=cadena[17:20] No newline at end of file
363 sd09=cadena[17:20]
364 sd10=cadena[21:24] No newline at end of file
364 sd10=cadena[21:24]
365 sd11=cadena[25:28] No newline at end of file
365 sd11=cadena[25:28]
366 sd12=cadena[29:32] No newline at end of file
366 sd12=cadena[29:32]
367 if cnt==16: No newline at end of file
367 if cnt==16:
368 wd13=cadena[1:4] No newline at end of file
368 wd13=cadena[1:4]
369 wd14=cadena[5:8] No newline at end of file
369 wd14=cadena[5:8]
370 wd15=cadena[9:12] No newline at end of file
370 wd15=cadena[9:12]
371 wd16=cadena[13:16] No newline at end of file
371 wd16=cadena[13:16]
372 sd13=cadena[17:20] No newline at end of file
372 sd13=cadena[17:20]
373 sd14=cadena[21:24] No newline at end of file
373 sd14=cadena[21:24]
374 sd15=cadena[25:28] No newline at end of file
374 sd15=cadena[25:28]
375 sd16=cadena[29:32] No newline at end of file
375 sd16=cadena[29:32]
376 lst_n_up=[nu01,nu02,nu03,nu04,nu05,nu06,nu07,nu08,nu09,nu10,nu11,nu12,nu13,nu14,nu15,nu16] No newline at end of file
376 lst_n_up=[nu01,nu02,nu03,nu04,nu05,nu06,nu07,nu08,nu09,nu10,nu11,nu12,nu13,nu14,nu15,nu16]
377 lst_n_dw=[nd01,nd02,nd03,nd04,nd05,nd06,nd07,nd08,nd09,nd10,nd11,nd12,nd13,nd14,nd15,nd16] No newline at end of file
377 lst_n_dw=[nd01,nd02,nd03,nd04,nd05,nd06,nd07,nd08,nd09,nd10,nd11,nd12,nd13,nd14,nd15,nd16]
378 lst_s_up=[su01,su02,su03,su04,su05,su06,su07,su08,su09,su10,su11,su12,su13,su14,su15,su16] No newline at end of file
378 lst_s_up=[su01,su02,su03,su04,su05,su06,su07,su08,su09,su10,su11,su12,su13,su14,su15,su16]
379 lst_s_dw=[sd01,sd02,sd03,sd04,sd05,sd06,sd07,sd08,sd09,sd10,sd11,sd12,sd13,sd14,sd15,sd16] No newline at end of file
379 lst_s_dw=[sd01,sd02,sd03,sd04,sd05,sd06,sd07,sd08,sd09,sd10,sd11,sd12,sd13,sd14,sd15,sd16]
380 lst_w_up=[wu01,wu02,wu03,wu04,wu05,wu06,wu07,wu08,wu09,wu10,wu11,wu12,wu13,wu14,wu15,wu16] No newline at end of file
380 lst_w_up=[wu01,wu02,wu03,wu04,wu05,wu06,wu07,wu08,wu09,wu10,wu11,wu12,wu13,wu14,wu15,wu16]
381 lst_w_dw=[wd01,wd02,wd03,wd04,wd05,wd06,wd07,wd08,wd09,wd10,wd11,wd12,wd13,wd14,wd15,wd16] No newline at end of file
381 lst_w_dw=[wd01,wd02,wd03,wd04,wd05,wd06,wd07,wd08,wd09,wd10,wd11,wd12,wd13,wd14,wd15,wd16]
382 lst_e_up=[eu01,eu02,eu03,eu04,eu05,eu06,eu07,eu08,eu09,eu10,eu11,eu12,eu13,eu14,eu15,eu16] No newline at end of file
382 lst_e_up=[eu01,eu02,eu03,eu04,eu05,eu06,eu07,eu08,eu09,eu10,eu11,eu12,eu13,eu14,eu15,eu16]
383 lst_e_dw=[ed01,ed02,ed03,ed04,ed05,ed06,ed07,ed08,ed09,ed10,ed11,ed12,ed13,ed14,ed15,ed16] No newline at end of file
383 lst_e_dw=[ed01,ed02,ed03,ed04,ed05,ed06,ed07,ed08,ed09,ed10,ed11,ed12,ed13,ed14,ed15,ed16]
384 No newline at end of file
384
385 lstup = lst_n_up + lst_e_up + lst_w_up + lst_s_up
385 lstup = lst_n_up + lst_e_up + lst_w_up + lst_s_up
No newline at end of file
386 lstdw = lst_n_dw + lst_e_dw + lst_w_dw + lst_s_dw No newline at end of file
386 lstdw = lst_n_dw + lst_e_dw + lst_w_up + lst_s_up No newline at end of file
387 No newline at end of file
387
388 if polarizacion=='up': No newline at end of file
388 if polarizacion=='up':
389 return lstup No newline at end of file
389 return lstup
390 elif polarizacion=='dw': No newline at end of file
390 elif polarizacion=='dw':
391 return lstdw No newline at end of file
391 return lstdw
392 fichero.close() No newline at end of file
392 fichero.close()
393 No newline at end of file
393
394 No newline at end of file
394
395 def CreaFormatoFinal(): No newline at end of file
395 def CreaFormatoFinal():
396 ne=NumeroDeExperimentos(archivo) No newline at end of file
396 ne=NumeroDeExperimentos(archivo)
397 No newline at end of file
397
398 #nombre01 = file1(archivo,'1') No newline at end of file
398 #nombre01 = file1(archivo,'1')
399 nombre02 = file1(archivo,'2') No newline at end of file
399 nombre02 = file1(archivo,'2')
400 fichero=open(CarpetaDeTrabajo+'FormatoControlCentral.txt','w') No newline at end of file
400 fichero=open(CarpetaDeTrabajo+'FormatoControlCentral.txt','w')
401 fichero.write(nombre02+'\n') No newline at end of file
401 fichero.write(nombre02+'\n')
402 fichero.write(str(ne)+'\n') No newline at end of file
402 fichero.write(str(ne)+'\n')
403 for i in range(1,17): No newline at end of file
403 for i in range(1,17):
404 No newline at end of file
404
405 if i<10: No newline at end of file
405 if i<10:
406 nmod = '0'+str(i) No newline at end of file
406 nmod = '0'+str(i)
407 else: nmod = str(i) No newline at end of file
407 else: nmod = str(i)
408 No newline at end of file
408
409 No newline at end of file
409
410 fichero.write('S'+nmod+'\n') No newline at end of file
410 fichero.write('S'+nmod+'\n')
411 for j in range(1,ne+1): No newline at end of file
411 for j in range(1,ne+1):
412 ruta=CarpetaDeTrabajo+str(j)+'.txt' No newline at end of file
412 ruta=CarpetaDeTrabajo+str(j)+'.txt'
413 lu=CapturaValoresEnArchivo(ruta,polarizacion='up') No newline at end of file
413 lu=CapturaValoresEnArchivo(ruta,polarizacion='up')
414 ld=CapturaValoresEnArchivo(ruta,polarizacion='dw') No newline at end of file
414 ld=CapturaValoresEnArchivo(ruta,polarizacion='dw')
415 part1='' No newline at end of file
415 part1=''
416 part2='' No newline at end of file
416 part2=''
417 if lu[i-1]=='1.0': part1='000' No newline at end of file
417 if lu[i-1]=='1.0': part1='000'
418 if lu[i-1]=='2.0': part1='001' No newline at end of file
418 if lu[i-1]=='2.0': part1='001'
419 if lu[i-1]=='3.0': part1='010' No newline at end of file
419 if lu[i-1]=='3.0': part1='010'
420 if lu[i-1]=='0.0': part1='011' No newline at end of file
420 if lu[i-1]=='0.0': part1='011'
421 if lu[i-1]=='0.5': part1='100' No newline at end of file
421 if lu[i-1]=='0.5': part1='100'
422 if lu[i-1]=='1.5': part1='101' No newline at end of file
422 if lu[i-1]=='1.5': part1='101'
423 if lu[i-1]=='2.5': part1='110' No newline at end of file
423 if lu[i-1]=='2.5': part1='110'
424 if lu[i-1]=='3.5': part1='111' No newline at end of file
424 if lu[i-1]=='3.5': part1='111'
425 if ld[i-1]=='1.0': part2='000' No newline at end of file
425 if ld[i-1]=='1.0': part2='000'
426 if ld[i-1]=='2.0': part2='001' No newline at end of file
426 if ld[i-1]=='2.0': part2='001'
427 if ld[i-1]=='3.0': part2='010' No newline at end of file
427 if ld[i-1]=='3.0': part2='010'
428 if ld[i-1]=='0.0': part2='011' No newline at end of file
428 if ld[i-1]=='0.0': part2='011'
429 if ld[i-1]=='0.5': part2='100' No newline at end of file
429 if ld[i-1]=='0.5': part2='100'
430 if ld[i-1]=='1.5': part2='101' No newline at end of file
430 if ld[i-1]=='1.5': part2='101'
431 if ld[i-1]=='2.5': part2='110' No newline at end of file
431 if ld[i-1]=='2.5': part2='110'
432 if ld[i-1]=='3.5': part2='111' No newline at end of file
432 if ld[i-1]=='3.5': part2='111'
433 fichero.write(part1+part2+'\n') No newline at end of file
433 fichero.write(part1+part2+'\n')
434 fichero.write('------'+'\n') No newline at end of file
434 fichero.write('------'+'\n')
435 fichero.close() No newline at end of file
435 fichero.close()
436 No newline at end of file
436
437 def CreaFormatoFinal2(): No newline at end of file
437 def CreaFormatoFinal2():
438 ne=NumeroDeExperimentos(archivo) No newline at end of file
438 ne=NumeroDeExperimentos(archivo)
439 No newline at end of file
439
440 #nombre01 = file1(archivo,'1') No newline at end of file
440 #nombre01 = file1(archivo,'1')
441 nombre02 = file1(archivo,'2') No newline at end of file
441 nombre02 = file1(archivo,'2')
442 fichero=open(CarpetaDeTrabajo+'FormatoControlCentral.txt','w') No newline at end of file
442 fichero=open(CarpetaDeTrabajo+'FormatoControlCentral.txt','w')
443 fichero.write(nombre02+'\n') No newline at end of file
443 fichero.write(nombre02+'\n')
444 fichero.write(str(ne)+'\n') No newline at end of file
444 fichero.write(str(ne)+'\n')
445 No newline at end of file
445
446 for i in range(1,65): No newline at end of file
446 for i in range(1,65):
447 No newline at end of file
447
448 if i<10: No newline at end of file
448 if i<10:
449 nmod = '0'+str(i) No newline at end of file
449 nmod = '0'+str(i)
450 else: nmod = str(i) No newline at end of file
450 else: nmod = str(i)
451 No newline at end of file
451
452 fichero.write("ABS_" + nmod+'\n') No newline at end of file
452 fichero.write("ABS_" + nmod+'\n')
453 No newline at end of file
453
454 for j in range(1,ne+1): No newline at end of file
454 for j in range(1,ne+1):
455 ruta=CarpetaDeTrabajo+str(j)+'.txt' No newline at end of file
455 ruta=CarpetaDeTrabajo+str(j)+'.txt'
456 lu=CapturaValoresEnArchivo2(ruta,polarizacion='up') No newline at end of file
456 lu=CapturaValoresEnArchivo2(ruta,polarizacion='up')
457 ld=CapturaValoresEnArchivo2(ruta,polarizacion='dw') No newline at end of file
457 ld=CapturaValoresEnArchivo2(ruta,polarizacion='dw')
458 part1='' No newline at end of file
458 part1=''
459 part2='' No newline at end of file
459 part2=''
460 if lu[i-1]=='1.0': part1='000' No newline at end of file
460 if lu[i-1]=='1.0': part1='000'
461 if lu[i-1]=='2.0': part1='001' No newline at end of file
461 if lu[i-1]=='2.0': part1='001'
462 if lu[i-1]=='3.0': part1='010' No newline at end of file
462 if lu[i-1]=='3.0': part1='010'
463 if lu[i-1]=='0.0': part1='011' No newline at end of file
463 if lu[i-1]=='0.0': part1='011'
464 if lu[i-1]=='0.5': part1='100' No newline at end of file
464 if lu[i-1]=='0.5': part1='100'
465 if lu[i-1]=='1.5': part1='101' No newline at end of file
465 if lu[i-1]=='1.5': part1='101'
466 if lu[i-1]=='2.5': part1='110' No newline at end of file
466 if lu[i-1]=='2.5': part1='110'
467 if lu[i-1]=='3.5': part1='111' No newline at end of file
467 if lu[i-1]=='3.5': part1='111'
468 if ld[i-1]=='1.0': part2='000' No newline at end of file
468 if ld[i-1]=='1.0': part2='000'
469 if ld[i-1]=='2.0': part2='001' No newline at end of file
469 if ld[i-1]=='2.0': part2='001'
470 if ld[i-1]=='3.0': part2='010' No newline at end of file
470 if ld[i-1]=='3.0': part2='010'
471 if ld[i-1]=='0.0': part2='011' No newline at end of file
471 if ld[i-1]=='0.0': part2='011'
472 if ld[i-1]=='0.5': part2='100' No newline at end of file
472 if ld[i-1]=='0.5': part2='100'
473 if ld[i-1]=='1.5': part2='101' No newline at end of file
473 if ld[i-1]=='1.5': part2='101'
474 if ld[i-1]=='2.5': part2='110' No newline at end of file
474 if ld[i-1]=='2.5': part2='110'
475 if ld[i-1]=='3.5': part2='111' No newline at end of file
475 if ld[i-1]=='3.5': part2='111'
476 fichero.write(part1+part2+'\n') No newline at end of file
476 fichero.write(part1+part2+'\n')
477 fichero.write('------'+'\n') No newline at end of file
477 fichero.write('------'+'\n')
478 fichero.close() No newline at end of file
478 fichero.close()
479 No newline at end of file
479
480 def EliminaArchivosEnLaCarpeta(): No newline at end of file
480 def EliminaArchivosEnLaCarpeta():
481 ne=NumeroDeExperimentos(archivo) No newline at end of file
481 ne=NumeroDeExperimentos(archivo)
482 for i in range(1,ne+1): No newline at end of file
482 for i in range(1,ne+1):
483 os.remove(CarpetaDeTrabajo+str(i)+'.txt') No newline at end of file
483 os.remove(CarpetaDeTrabajo+str(i)+'.txt')
484 No newline at end of file
484
485 CreaFicherosPrevios() No newline at end of file
485 CreaFicherosPrevios()
486 CreaFormatoFinal2() No newline at end of file
486 CreaFormatoFinal2()
487 EliminaArchivosEnLaCarpeta() No newline at end of file
487 EliminaArchivosEnLaCarpeta()
488 No newline at end of file
488
489 ########## No newline at end of file
489 ##########
490 No newline at end of file
490
491 if __name__ == '__main__': No newline at end of file
491 if __name__ == '__main__':
492 No newline at end of file
492
493 filename = "experimento1.abs" No newline at end of file
493 filename = "experimento1.abs"
494 No newline at end of file
494
495 absObj = ABSClient() No newline at end of file
495 absObj = ABSClient()
496 absObj.sendFile(filename) No newline at end of file
496 absObj.sendFile(filename)
General Comments 0
You need to be logged in to leave comments. Login now