##// END OF EJS Templates
AMISR correcciones, procesamientos
joabAM -
r1417:1ff56cfe5bef
parent child
Show More
@@ -635,7 +635,9 class Project(Process):
635 635 n = len(self.configurations)
636 636
637 637 while not err:
638 #print("STAR")
638 639 for conf in self.getUnits():
640 #print("CONF: ",conf)
639 641 ok = conf.run()
640 642 if ok == 'Error':
641 643 n -= 1
@@ -57,13 +57,15 class ProcessingUnit(object):
57 57 '''
58 58
59 59 try:
60 if self.dataIn is not None and self.dataIn.flagNoData and not self.dataIn.error:
61 return self.dataIn.isReady()
62 elif self.dataIn is None or not self.dataIn.error:
60 # if self.dataIn is not None and self.dataIn.flagNoData and not self.dataIn.error:
61 # return self.dataIn.isReady()
62 #dataIn=None es unidades de Lectura, segunda parte unidades de procesamiento
63 if self.dataIn is None or (not self.dataIn.error and not self.dataIn.flagNoData):
63 64 self.run(**kwargs)
64 65 elif self.dataIn.error:
65 66 self.dataOut.error = self.dataIn.error
66 67 self.dataOut.flagNoData = True
68
67 69 except:
68 70
69 71 err = traceback.format_exc()
@@ -76,18 +78,19 class ProcessingUnit(object):
76 78 self.dataOut.error = True
77 79
78 80 for op, optype, opkwargs in self.operations:
79 if optype == 'other' and not self.dataOut.flagNoData:
81 if optype == 'other' and self.dataOut.isReady():
80 82 try:
81 83 self.dataOut = op.run(self.dataOut, **opkwargs)
82 84 except Exception as e:
85 print(e)
83 86 self.dataOut.error = True
84 87 return 'Error'
85 88 elif optype == 'external' and self.dataOut.isReady() :
86 89 op.queue.put(copy.deepcopy(self.dataOut))
87 90 elif optype == 'external' and self.dataOut.error:
88 op.queue.put(self.dataOut)
91 op.queue.put(copy.deepcopy(self.dataOut))
89 92
90 return 'Error' if self.dataOut.error else self.dataOut.isReady()
93 return 'Error' if self.dataOut.error else True#self.dataOut.isReady()
91 94
92 95 def setup(self):
93 96
@@ -1663,7 +1663,7 class IncohInt(Operation):
1663 1663 dataOut.nIncohInt *= self.n
1664 1664 dataOut.utctime = avgdatatime
1665 1665 dataOut.flagNoData = False
1666
1666
1667 1667 return dataOut
1668 1668
1669 1669 class dopplerFlip(Operation):
@@ -5,7 +5,7 from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation, MPDecora
5 5 from schainpy.model.data.jrodata import Voltage,hildebrand_sekhon
6 6 from schainpy.utils import log
7 7 from time import time
8
8 import numpy
9 9
10 10
11 11 class VoltageProc(ProcessingUnit):
@@ -61,16 +61,12 class selectChannels(Operation):
61 61 print("Missing channelList")
62 62 return dataOut
63 63 channelIndexList = []
64 if type(self.channelList) is list:
65 pass
66 elif type(self.channelList) is tuple:
67 self.channelList = list(self.channelList)
68 else:
69 self.channelList = self.channelList.tolist()
70
71 if type(dataOut.channelList) is not list:
72 dataOut.channelList = dataOut.channelList.tolist()
73 64
65 if type(dataOut.channelList) is not list: #leer array desde HDF5
66 try:
67 dataOut.channelList = dataOut.channelList.tolist()
68 except Exception as e:
69 print("Select Channels: ",e)
74 70 for channel in self.channelList:
75 71 if channel not in dataOut.channelList:
76 72 raise ValueError("Channel %d is not in %s" %(channel, str(dataOut.channelList)))
@@ -98,7 +94,7 class selectChannels(Operation):
98 94 Return:
99 95 None
100 96 """
101
97 #print("selectChannelsByIndex")
102 98 # for channelIndex in channelIndexList:
103 99 # if channelIndex not in dataOut.channelIndexList:
104 100 # raise ValueError("The value %d in channelIndexList is not valid" %channelIndex)
@@ -117,11 +113,21 class selectChannels(Operation):
117 113 dataOut.channelList = range(len(channelIndexList))
118 114
119 115 elif dataOut.type == 'Spectra':
120 data_spc = dataOut.data_spc[channelIndexList, :]
121 dataOut.data_spc = data_spc
122 if hasattr(dataOut, 'data_dc') and dataOut.data_dc != None:
123 data_dc = dataOut.data_dc[channelIndexList, :]
124 dataOut.data_dc = data_dc
116 if hasattr(dataOut, 'data_spc'):
117 if dataOut.data_spc is None:
118 raise ValueError("data_spc is None")
119 return dataOut
120 else:
121 data_spc = dataOut.data_spc[channelIndexList, :]
122 dataOut.data_spc = data_spc
123
124 # if hasattr(dataOut, 'data_dc') :# and
125 # if dataOut.data_dc is None:
126 # raise ValueError("data_dc is None")
127 # return dataOut
128 # else:
129 # data_dc = dataOut.data_dc[channelIndexList, :]
130 # dataOut.data_dc = data_dc
125 131 # dataOut.channelList = [dataOut.channelList[i] for i in channelIndexList]
126 132 dataOut.channelList = channelIndexList
127 133 dataOut = self.__selectPairsByChannel(dataOut,channelIndexList)
@@ -129,7 +135,7 class selectChannels(Operation):
129 135 return dataOut
130 136
131 137 def __selectPairsByChannel(self, dataOut, channelList=None):
132
138 #print("__selectPairsByChannel")
133 139 if channelList == None:
134 140 return
135 141
@@ -143,7 +149,6 class selectChannels(Operation):
143 149 continue
144 150
145 151 pairsIndexListSelected.append(pairIndex)
146
147 152 if not pairsIndexListSelected:
148 153 dataOut.data_cspc = None
149 154 dataOut.pairsList = []
General Comments 0
You need to be logged in to leave comments. Login now