@@ -18,19 +18,9 from xml.dom import minidom | |||
|
18 | 18 | |
|
19 | 19 | |
|
20 | 20 | from schainpy.admin import Alarm, SchainWarning |
|
21 | ||
|
22 | ### Temporary imports!!! | |
|
23 | # from schainpy.model import * | |
|
24 | from schainpy.model.io import * | |
|
25 | from schainpy.model.graphics import * | |
|
26 | from schainpy.model.proc.jroproc_base import * | |
|
27 | from schainpy.model.proc.bltrproc_parameters import * | |
|
28 | from schainpy.model.proc.jroproc_spectra import * | |
|
29 | from schainpy.model.proc.jroproc_voltage import * | |
|
30 | from schainpy.model.proc.jroproc_parameters import * | |
|
31 | from schainpy.model.utils.jroutils_publish import * | |
|
21 | from schainpy.model import * | |
|
32 | 22 | from schainpy.utils import log |
|
33 | ### | |
|
23 | ||
|
34 | 24 | |
|
35 | 25 | DTYPES = { |
|
36 | 26 | 'Voltage': '.r', |
@@ -683,6 +673,7 class ProcUnitConf(): | |||
|
683 | 673 | ''' |
|
684 | 674 | Instancia de unidades de procesamiento. |
|
685 | 675 | ''' |
|
676 | ||
|
686 | 677 | className = eval(self.name) |
|
687 | 678 | kwargs = self.getKwargs() |
|
688 | 679 | procUnitObj = className(self.id, self.inputId, self.project_id, **kwargs) # necesitan saber su id y su entrada por fines de ipc |
@@ -368,7 +368,7 class Voltage(JROData): | |||
|
368 | 368 | # self.nChannels = 0 |
|
369 | 369 | # self.nHeights = 0 |
|
370 | 370 | self.nProfiles = None |
|
371 | self.heightList = Non | |
|
371 | self.heightList = None | |
|
372 | 372 | self.channelList = None |
|
373 | 373 | # self.channelIndexList = None |
|
374 | 374 | self.flagNoData = True |
@@ -848,6 +848,12 class Fits(JROData): | |||
|
848 | 848 | |
|
849 | 849 | return timeInterval |
|
850 | 850 | |
|
851 | def get_ippSeconds(self): | |
|
852 | ''' | |
|
853 | ''' | |
|
854 | return self.ipp_sec | |
|
855 | ||
|
856 | ||
|
851 | 857 | datatime = property(getDatatime, "I'm the 'datatime' property") |
|
852 | 858 | nHeights = property(getNHeights, "I'm the 'nHeights' property.") |
|
853 | 859 | nChannels = property(getNChannels, "I'm the 'nChannel' property.") |
@@ -857,7 +863,7 class Fits(JROData): | |||
|
857 | 863 | |
|
858 | 864 | ltctime = property(getltctime, "I'm the 'ltctime' property") |
|
859 | 865 | timeInterval = property(getTimeInterval, "I'm the 'timeInterval' property") |
|
860 | ||
|
866 | ippSeconds = property(get_ippSeconds, '') | |
|
861 | 867 | |
|
862 | 868 | class Correlation(JROData): |
|
863 | 869 |
@@ -9,7 +9,10 import numpy | |||
|
9 | 9 | |
|
10 | 10 | from .figure import Figure, isRealtime |
|
11 | 11 | from .plotting_codes import * |
|
12 | from schainpy.model.proc.jroproc_base import MPDecorator | |
|
12 | 13 | |
|
14 | ||
|
15 | @MPDecorator | |
|
13 | 16 | class SpectraHeisScope_(Figure): |
|
14 | 17 | |
|
15 | 18 | |
@@ -20,9 +23,9 class SpectraHeisScope_(Figure): | |||
|
20 | 23 | HEIGHTPROF = None |
|
21 | 24 | PREFIX = 'spc' |
|
22 | 25 | |
|
23 |
def __init__(self |
|
|
26 | def __init__(self):#, **kwargs): | |
|
24 | 27 | |
|
25 |
Figure.__init__(self |
|
|
28 | Figure.__init__(self)#, **kwargs) | |
|
26 | 29 | self.isConfig = False |
|
27 | 30 | self.__nsubplots = 1 |
|
28 | 31 | |
@@ -96,6 +99,9 class SpectraHeisScope_(Figure): | |||
|
96 | 99 | ymax : None, |
|
97 | 100 | """ |
|
98 | 101 | |
|
102 | if dataOut.flagNoData: | |
|
103 | return dataOut | |
|
104 | ||
|
99 | 105 | if dataOut.realtime: |
|
100 | 106 | if not(isRealtime(utcdatatime = dataOut.utctime)): |
|
101 | 107 | print('Skipping this plot function') |
@@ -173,6 +179,9 class SpectraHeisScope_(Figure): | |||
|
173 | 179 | wr_period=wr_period, |
|
174 | 180 | thisDatetime=thisDatetime) |
|
175 | 181 | |
|
182 | return dataOut | |
|
183 | ||
|
184 | @MPDecorator | |
|
176 | 185 | class RTIfromSpectraHeis_(Figure): |
|
177 | 186 | |
|
178 | 187 | isConfig = None |
@@ -180,8 +189,8 class RTIfromSpectraHeis_(Figure): | |||
|
180 | 189 | |
|
181 | 190 | PREFIX = 'rtinoise' |
|
182 | 191 | |
|
183 |
def __init__(self |
|
|
184 |
Figure.__init__(self |
|
|
192 | def __init__(self):#, **kwargs): | |
|
193 | Figure.__init__(self)#, **kwargs) | |
|
185 | 194 | self.timerange = 24*60*60 |
|
186 | 195 | self.isConfig = False |
|
187 | 196 | self.__nsubplots = 1 |
@@ -231,6 +240,10 class RTIfromSpectraHeis_(Figure): | |||
|
231 | 240 | server=None, folder=None, username=None, password=None, |
|
232 | 241 | ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0): |
|
233 | 242 | |
|
243 | if dataOut.flagNoData: | |
|
244 | return dataOut | |
|
245 | ||
|
246 | ||
|
234 | 247 | if channelList == None: |
|
235 | 248 | channelIndexList = dataOut.channelIndexList |
|
236 | 249 | channelList = dataOut.channelList |
@@ -327,3 +340,6 class RTIfromSpectraHeis_(Figure): | |||
|
327 | 340 | wr_period=wr_period, |
|
328 | 341 | thisDatetime=thisDatetime, |
|
329 | 342 | update_figfile=update_figfile) |
|
343 | ||
|
344 | ||
|
345 | return dataOut No newline at end of file |
@@ -20,7 +20,9 from xml.etree.ElementTree import ElementTree | |||
|
20 | 20 | |
|
21 | 21 | from .jroIO_base import isRadarFolder, isNumber |
|
22 | 22 | from schainpy.model.data.jrodata import Fits |
|
23 | from schainpy.model.proc.jroproc_base import Operation, ProcessingUnit | |
|
23 | from schainpy.model.proc.jroproc_base import Operation, ProcessingUnit, MPDecorator | |
|
24 | from schainpy.utils import log | |
|
25 | ||
|
24 | 26 | |
|
25 | 27 | class PyFits(object): |
|
26 | 28 | name=None |
@@ -281,7 +283,7 class FitsWriter(Operation): | |||
|
281 | 283 | self.isConfig = True |
|
282 | 284 | self.putData() |
|
283 | 285 | |
|
284 | ||
|
286 | @MPDecorator | |
|
285 | 287 | class FitsReader(ProcessingUnit): |
|
286 | 288 | |
|
287 | 289 | # __TIMEZONE = time.timezone |
@@ -298,8 +300,8 class FitsReader(ProcessingUnit): | |||
|
298 | 300 | data = None |
|
299 | 301 | data_header_dict = None |
|
300 | 302 | |
|
301 |
def __init__(self |
|
|
302 |
ProcessingUnit.__init__(self |
|
|
303 | def __init__(self):#, **kwargs): | |
|
304 | ProcessingUnit.__init__(self)#, **kwargs) | |
|
303 | 305 | self.isConfig = False |
|
304 | 306 | self.ext = '.fits' |
|
305 | 307 | self.setFile = 0 |
@@ -391,8 +393,7 class FitsReader(ProcessingUnit): | |||
|
391 | 393 | |
|
392 | 394 | self.dataOut.nCohInt = self.nCohInt |
|
393 | 395 | self.dataOut.nIncohInt = self.nIncohInt |
|
394 | ||
|
395 | self.dataOut.ippSeconds = self.ippSeconds | |
|
396 | self.dataOut.ipp_sec = self.ippSeconds | |
|
396 | 397 | |
|
397 | 398 | def readHeader(self): |
|
398 | 399 | headerObj = self.fitsObj[0] |
@@ -691,18 +692,17 class FitsReader(ProcessingUnit): | |||
|
691 | 692 | |
|
692 | 693 | if self.flagNoMoreFiles: |
|
693 | 694 | self.dataOut.flagNoData = True |
|
694 |
|
|
|
695 | return 0 | |
|
695 | return (0, 'No more files') | |
|
696 | 696 | |
|
697 | 697 | self.flagDiscontinuousBlock = 0 |
|
698 | 698 | self.flagIsNewBlock = 0 |
|
699 | 699 | |
|
700 | 700 | if not(self.readNextBlock()): |
|
701 | return 0 | |
|
701 | return (1, 'Error reading data') | |
|
702 | 702 | |
|
703 | 703 | if self.data is None: |
|
704 | 704 | self.dataOut.flagNoData = True |
|
705 | return 0 | |
|
705 | return (0, 'No more data') | |
|
706 | 706 | |
|
707 | 707 | self.dataOut.data = self.data |
|
708 | 708 | self.dataOut.data_header = self.data_header_dict |
@@ -718,8 +718,7 class FitsReader(ProcessingUnit): | |||
|
718 | 718 | # self.dataOut.channelList = self.channelList |
|
719 | 719 | # self.dataOut.heightList = self.heightList |
|
720 | 720 | self.dataOut.flagNoData = False |
|
721 | ||
|
722 | return self.dataOut.data | |
|
721 | # return self.dataOut.data | |
|
723 | 722 | |
|
724 | 723 | def run(self, **kwargs): |
|
725 | 724 | |
@@ -729,6 +728,7 class FitsReader(ProcessingUnit): | |||
|
729 | 728 | |
|
730 | 729 | self.getData() |
|
731 | 730 | |
|
731 | @MPDecorator | |
|
732 | 732 | class SpectraHeisWriter(Operation): |
|
733 | 733 | # set = None |
|
734 | 734 | setFile = None |
@@ -736,8 +736,8 class SpectraHeisWriter(Operation): | |||
|
736 | 736 | doypath = None |
|
737 | 737 | subfolder = None |
|
738 | 738 | |
|
739 |
def __init__(self |
|
|
740 |
Operation.__init__(self |
|
|
739 | def __init__(self):#, **kwargs): | |
|
740 | Operation.__init__(self)#, **kwargs) | |
|
741 | 741 | self.wrObj = PyFits() |
|
742 | 742 | # self.dataOut = dataOut |
|
743 | 743 | self.nTotalBlocks=0 |
@@ -846,3 +846,4 class SpectraHeisWriter(Operation): | |||
|
846 | 846 | self.isConfig = True |
|
847 | 847 | |
|
848 | 848 | self.putData() |
|
849 | return dataOut No newline at end of file |
@@ -285,6 +285,9 def MPDecorator(BaseClass): | |||
|
285 | 285 | |
|
286 | 286 | BaseClass.run(self, **self.kwargs) |
|
287 | 287 | |
|
288 | if self.dataOut.flagNoData: | |
|
289 | continue | |
|
290 | ||
|
288 | 291 | for op, optype, opId, kwargs in self.operations: |
|
289 | 292 | if optype == 'self': |
|
290 | 293 | op(**kwargs) |
@@ -316,11 +319,12 def MPDecorator(BaseClass): | |||
|
316 | 319 | time.sleep(1) |
|
317 | 320 | |
|
318 | 321 | def run(self): |
|
319 | ||
|
320 | 322 | if self.typeProc is "ProcUnit": |
|
321 | 323 | |
|
322 | 324 | if self.inputId is not None: |
|
325 | ||
|
323 | 326 | self.subscribe() |
|
327 | ||
|
324 | 328 | self.set_publisher() |
|
325 | 329 | |
|
326 | 330 | if 'Reader' not in BaseClass.__name__: |
@@ -1,13 +1,16 | |||
|
1 | 1 | import numpy |
|
2 | 2 | |
|
3 | from .jroproc_base import ProcessingUnit, Operation | |
|
3 | from .jroproc_base import ProcessingUnit, Operation, MPDecorator | |
|
4 | 4 | from schainpy.model.data.jrodata import SpectraHeis |
|
5 | from schainpy.utils import log | |
|
5 | 6 | |
|
7 | ||
|
8 | @MPDecorator | |
|
6 | 9 | class SpectraHeisProc(ProcessingUnit): |
|
7 | 10 | |
|
8 |
def __init__(self |
|
|
11 | def __init__(self):#, **kwargs): | |
|
9 | 12 | |
|
10 |
ProcessingUnit.__init__(self |
|
|
13 | ProcessingUnit.__init__(self)#, **kwargs) | |
|
11 | 14 | |
|
12 | 15 | # self.buffer = None |
|
13 | 16 | # self.firstdatatime = None |
@@ -145,6 +148,7 class SpectraHeisProc(ProcessingUnit): | |||
|
145 | 148 | |
|
146 | 149 | return 1 |
|
147 | 150 | |
|
151 | ||
|
148 | 152 | class IncohInt4SpectraHeis(Operation): |
|
149 | 153 | |
|
150 | 154 | isConfig = False |
@@ -163,9 +167,9 class IncohInt4SpectraHeis(Operation): | |||
|
163 | 167 | |
|
164 | 168 | n = None |
|
165 | 169 | |
|
166 |
def __init__(self |
|
|
170 | def __init__(self):#, **kwargs): | |
|
167 | 171 | |
|
168 |
Operation.__init__(self |
|
|
172 | Operation.__init__(self)#, **kwargs) | |
|
169 | 173 | # self.isConfig = False |
|
170 | 174 | |
|
171 | 175 | def setup(self, n=None, timeInterval=None, overlapping=False): |
@@ -342,3 +346,5 class IncohInt4SpectraHeis(Operation): | |||
|
342 | 346 | # dataOut.timeInterval = dataOut.ippSeconds * dataOut.nIncohInt |
|
343 | 347 | # dataOut.timeInterval = self.__timeInterval*self.n |
|
344 | 348 | dataOut.flagNoData = False |
|
349 | ||
|
350 | return dataOut No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now