@@ -0,0 +1,1 | |||||
|
1 | You should install "digital_rf_hdf5" module if you want to read USRP data |
@@ -1,1 +1,1 | |||||
1 |
<Project description="A schain project" id="191" name="project"><ReadUnit datatype="Voltage" id="1911" inputId="0" name="VoltageReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="VoltageReader" /><Parameter format="str" id="191112" name="path" value="/home/nanosat/schain" /><Parameter format="date" id="191113" name="startDate" value="1970/01/01" /><Parameter format="date" id="191114" name="endDate" value="2017/12/31" /><Parameter format="time" id="191115" name="startTime" value="00:00:00" /><Parameter format="time" id="191116" name="endTime" value="23:59:59" /><Parameter format="int" id="191118" name="walk" value="1" /><Parameter format="int" id="191119" name="verbose" value="1" /><Parameter format="int" id="191120" name="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="Voltage" id="1912" inputId="1911" name="VoltageProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="ProfileSelector" priority="2" type="other"><Parameter format="intlist" id="191221" name="profileRangeList" value="120,183" /></Operation><Operation id="19123" name="RTIPlot" priority="3" type=" |
|
1 | <Project description="A schain project" id="191" name="project"><ReadUnit datatype="VoltageReader" id="1911" inputId="0" name="VoltageReader"><Operation id="19111" name="run" priority="1" type="self"><Parameter format="str" id="191111" name="datatype" value="VoltageReader" /><Parameter format="str" id="191112" name="path" value="/home/nanosat/schain" /><Parameter format="date" id="191113" name="startDate" value="1970/01/01" /><Parameter format="date" id="191114" name="endDate" value="2017/12/31" /><Parameter format="time" id="191115" name="startTime" value="00:00:00" /><Parameter format="time" id="191116" name="endTime" value="23:59:59" /><Parameter format="int" id="191118" name="walk" value="1" /><Parameter format="int" id="191119" name="verbose" value="1" /><Parameter format="int" id="191120" name="online" value="0" /></Operation></ReadUnit><ProcUnit datatype="VoltageProc" id="1912" inputId="1911" name="VoltageProc"><Operation id="19121" name="run" priority="1" type="self" /><Operation id="19122" name="ProfileSelector" priority="2" type="other"><Parameter format="intlist" id="191221" name="profileRangeList" value="120,183" /></Operation><Operation id="19123" name="RTIPlot" priority="3" type="other"><Parameter format="str" id="191231" name="wintitle" value="Jicamarca Radio Observatory" /><Parameter format="int" id="191232" name="showprofile" value="0" /><Parameter format="int" id="191233" name="xmin" value="0" /><Parameter format="int" id="191234" name="xmax" value="24" /><Parameter format="str" id="191235" name="figpath" value="/home/nanosat/schain/figs" /><Parameter format="int" id="191236" name="wr_period" value="5" /><Parameter format="int" id="191237" name="exp_code" value="22" /></Operation></ProcUnit></Project> No newline at end of file |
@@ -11,7 +11,6 import numpy | |||||
11 | import fnmatch |
|
11 | import fnmatch | |
12 | import inspect |
|
12 | import inspect | |
13 | import time, datetime |
|
13 | import time, datetime | |
14 | #import h5py |
|
|||
15 | import traceback |
|
14 | import traceback | |
16 |
|
15 | |||
17 | try: |
|
16 | try: | |
@@ -1274,8 +1273,22 class JRODataReader(JRODataIO): | |||||
1274 | skip=None, |
|
1273 | skip=None, | |
1275 | cursor=None, |
|
1274 | cursor=None, | |
1276 | warnings=True, |
|
1275 | warnings=True, | |
1277 |
verbose=True |
|
1276 | verbose=True, | |
|
1277 | server=None): | |||
1278 |
|
1278 | |||
|
1279 | if server is not None: | |||
|
1280 | server = kwargs.get('server', 'zmq.pipe') | |||
|
1281 | if 'tcp://' in server: | |||
|
1282 | address = server | |||
|
1283 | else: | |||
|
1284 | address = 'ipc:///tmp/%s' % server | |||
|
1285 | self.address = address | |||
|
1286 | self.context = zmq.Context() | |||
|
1287 | self.receiver = self.context.socket(zmq.PULL) | |||
|
1288 | self.receiver.bind(self.address) | |||
|
1289 | time.sleep(0.5) | |||
|
1290 | print '[Starting] ReceiverData from {}'.format(self.address) | |||
|
1291 | else: | |||
1279 | if path == None: |
|
1292 | if path == None: | |
1280 | raise ValueError, "[Reading] The path is not valid" |
|
1293 | raise ValueError, "[Reading] The path is not valid" | |
1281 |
|
1294 | |||
@@ -1304,7 +1317,6 class JRODataReader(JRODataIO): | |||||
1304 | self.path = path |
|
1317 | self.path = path | |
1305 | self.foldercounter = foldercounter |
|
1318 | self.foldercounter = foldercounter | |
1306 | last_set = None |
|
1319 | last_set = None | |
1307 |
|
||||
1308 | else: |
|
1320 | else: | |
1309 | print "[Reading] Searching files in offline mode ..." |
|
1321 | print "[Reading] Searching files in offline mode ..." | |
1310 | pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate, |
|
1322 | pathList, filenameList = self.__searchFilesOffLine(path, startDate=startDate, endDate=endDate, | |
@@ -1457,6 +1469,7 class JRODataReader(JRODataIO): | |||||
1457 | skip=None, |
|
1469 | skip=None, | |
1458 | cursor=None, |
|
1470 | cursor=None, | |
1459 | warnings=True, |
|
1471 | warnings=True, | |
|
1472 | server=None, | |||
1460 | verbose=True, **kwargs): |
|
1473 | verbose=True, **kwargs): | |
1461 |
|
1474 | |||
1462 | if not(self.isConfig): |
|
1475 | if not(self.isConfig): | |
@@ -1481,10 +1494,13 class JRODataReader(JRODataIO): | |||||
1481 | skip=skip, |
|
1494 | skip=skip, | |
1482 | cursor=cursor, |
|
1495 | cursor=cursor, | |
1483 | warnings=warnings, |
|
1496 | warnings=warnings, | |
|
1497 | server=None, | |||
1484 | verbose=verbose) |
|
1498 | verbose=verbose) | |
1485 | self.isConfig = True |
|
1499 | self.isConfig = True | |
1486 |
|
1500 | if self.server is None: | ||
1487 | self.getData() |
|
1501 | self.getData() | |
|
1502 | else: | |||
|
1503 | self.getFromZMQ() | |||
1488 |
|
1504 | |||
1489 | class JRODataWriter(JRODataIO): |
|
1505 | class JRODataWriter(JRODataIO): | |
1490 |
|
1506 |
@@ -10,6 +10,7 from jroIO_base import LOCALTIME, JRODataReader, JRODataWriter | |||||
10 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation |
|
10 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation | |
11 | from schainpy.model.data.jroheaderIO import PROCFLAG, BasicHeader, SystemHeader, RadarControllerHeader, ProcessingHeader |
|
11 | from schainpy.model.data.jroheaderIO import PROCFLAG, BasicHeader, SystemHeader, RadarControllerHeader, ProcessingHeader | |
12 | from schainpy.model.data.jrodata import Voltage |
|
12 | from schainpy.model.data.jrodata import Voltage | |
|
13 | import zmq | |||
13 | # from _sha import blocksize |
|
14 | # from _sha import blocksize | |
14 |
|
15 | |||
15 | class VoltageReader(JRODataReader, ProcessingUnit): |
|
16 | class VoltageReader(JRODataReader, ProcessingUnit): | |
@@ -301,6 +302,12 class VoltageReader(JRODataReader, ProcessingUnit): | |||||
301 |
|
302 | |||
302 | return |
|
303 | return | |
303 |
|
304 | |||
|
305 | ||||
|
306 | def getFromZMQ(self): | |||
|
307 | self.dataOut = self.receiver.recv_pyobj() | |||
|
308 | print '[Receiving] {} - {}'.format(self.dataOut.type, | |||
|
309 | self.dataOut.datatime.ctime()) | |||
|
310 | ||||
304 | def getData(self): |
|
311 | def getData(self): | |
305 | """ |
|
312 | """ | |
306 | getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut |
|
313 | getData obtiene una unidad de datos del buffer de lectura, un perfil, y la copia al objeto self.dataOut |
General Comments 0
You need to be logged in to leave comments.
Login now