import os import sys import sys from schainpy.controller import Project controllerObj = Project() desc = '' controllerObj.setup(id='191', name='test01', description=desc) readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', path='/home/nanosat/data/jasmet', startDate='2010/10/28', endDate='2017/10/28', startTime='00:00:00', endTime='23:59:59', walk=1, online=0) procUnitConfObj0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) # opObj11 = procUnitConfObj0.addOperation(name='Scope', optype='external') # opObj11.addParameter(name='id', value='121', format='int') # opObj11.addParameter(name='wintitle', value='Scope', format='str') # opObj10 = procUnitConfObj0.addOperation(name='DigitalRFWriter', optype='other') # opObj10.addParameter( # name='path', value='/home/nanosat/data/digitalrf', format='str') # opObj10.addParameter( # name='fileCadence', value='1000000', format='int') # opObj10.addParameter(name='minHei', value='0', format='float')
def fiber(cursor, skip, q, dt): controllerObj = Project() controllerObj.setup(id='191', name='test01', description=desc) readUnitConfObj = controllerObj.addReadUnit( datatype='SpectraReader', path='/home/nanosat/data/julia', startDate=dt, endDate=dt, startTime="00:00:00", endTime="23:59:59", online=0, #set=1426485881, delay=10, walk=1, queue=q, cursor=cursor, skip=skip, #timezone=-5*3600 ) # #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') # procUnitConfObj2 = controllerObj.addProcUnit( datatype='Spectra', inputId=readUnitConfObj.getId()) # procUnitConfObj2.addParameter(name='nipp', value='5', format='int') # procUnitConfObj3 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=readUnitConfObj.getId()) # opObj11 = procUnitConfObj3.addOperation(name='SpectralMoments', optype='other') # opObj11 = procUnitConfObj2.addOperation(name='RTIPlot', optype='other') opObj11.addParameter(name='id', value='1000', format='int') opObj11.addParameter(name='wintitle', value='HF_Jicamarca_Spc', format='str') opObj11.addParameter(name='xmin', value='0', format='int') opObj11.addParameter(name='xmax', value='24', format='int') # opObj11 = procUnitConfObj3.addOperation(name='Parameters1Plot', optype='other') # opObj11.addParameter(name='channelList', value='0', format='intList') # # opObj11.addParameter(name='id', value='2000', format='int') # # opObj11.addParameter(name='colormap', value='0', format='bool') # opObj11.addParameter(name='onlySNR', value='1', format='bool') # opObj11.addParameter(name='DOP', value='0', format='bool') # opObj11.addParameter(name='showSNR', value='1', format='bool') # opObj11.addParameter(name='SNRthresh', value='0', format='int') # opObj11.addParameter(name='SNRmin', value='-10', format='int') # opObj11.addParameter(name='SNRmax', value='30', format='int') # opObj11.addParameter(name='showSNR', value='1', format='int') # # opObj11.addParameter(name='channelList', value='0', format='intlist') # # opObj11.addParameter(name='xmin', value='0', format='float') # opObj11.addParameter(name='xmin', value='0', format='float') # opObj11.addParameter(name='xmax', value='24', format='float') # opObj11.addParameter(name='zmin', value='-110', format='float') # opObj11.addParameter(name='zmax', value='-70', format='float') # opObj11.addParameter(name='save', value='0', format='int') # # opObj11.addParameter(name='figpath', value='/tmp/', format='str') # # opObj12 = procUnitConfObj2.addOperation(name='PublishData', optype='other') # opObj12.addParameter(name='zeromq', value=1, format='int') # opObj12.addParameter(name='server', value='tcp://10.10.10.82:7000', format='str') # opObj13 = procUnitConfObj3.addOperation(name='PublishData', optype='other') # opObj13.addParameter(name='zeromq', value=1, format='int') # opObj13.addParameter(name='server', value="juanca", format='str') # opObj12.addParameter(name='delay', value=1, format='int') # print "Escribiendo el archivo XML" # controllerObj.writeXml(filename) # print "Leyendo el archivo XML" # controllerObj.readXml(filename) # timeit.timeit('controllerObj.run()', number=2) controllerObj.start()
xmin = '0' xmax = '24' ymin = '0' ymax = '600' ########################FECHA########################################## str = datetime.date.today() today = str.strftime("%Y/%m/%d") str2 = str - datetime.timedelta(days=1) yesterday = str2.strftime("%Y/%m/%d") ######################## UNIDAD DE LECTURA############################# readUnitConfObj = controllerObj.addReadUnit( datatype='VoltageReader', path=path, startDate="2020/01/01", #"2020/01/01",#today, endDate="2020/12/01", #"2020/12/30",#today, startTime='00:00:00', endTime='23:59:59', delay=0, #set=0, online=0, walk=1) opObj11 = readUnitConfObj.addOperation(name='printInfo') #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') ####################################################################### ################ OPERACIONES DOMINIO DEL TIEMPO######################## ####################################################################### procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) '''
####################################################################### ########################FECHA########################################## ####################################################################### str = datetime.date.today() today = str.strftime("%Y/%m/%d") str2 = str - datetime.timedelta(days=1) yesterday = str2.strftime("%Y/%m/%d") ####################################################################### ######################## UNIDAD DE LECTURA############################# ####################################################################### readUnitConfObj = controllerObj.addReadUnit( datatype='DigitalRFReader', path=path, startDate="2019/07/02", #today, endDate="2109/07/03", #today, startTime='00:00:00', endTime='23:59:59', delay=0, #set=0, online=0, walk=1, ippKm=1500) opObj11 = readUnitConfObj.addOperation(name='printInfo') opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') ####################################################################### ################ OPERACIONES DOMINIO DEL TIEMPO######################## ####################################################################### procUnitConfObjA = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) #
####################################################################### ########################FECHA########################################## ####################################################################### str = datetime.date.today() today = str.strftime("%Y/%m/%d") str2 = str - datetime.timedelta(days=1) yesterday = str2.strftime("%Y/%m/%d") ####################################################################### ######################## UNIDAD DE LECTURA############################# ####################################################################### readUnitConfObj = controllerObj.addReadUnit( datatype='USRP', path=path, startDate="2019/05/16", #today, endDate="2019/05/16", #today, startTime='03:00:00', endTime='23:59:59', delay=0, #set=0, online=0, walk=1, ippKm=937.5) #opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') ####################################################################### ################ OPERACIONES DOMINIO DEL TIEMPO######################## ####################################################################### procUnitConfObjSousy = controllerObj.addProcUnit( datatype='Voltage', inputId=readUnitConfObj.getId()) #
def main(): desc = "Testing USRP data reader" filename = "schain.xml" figpath = "./" remotefolder = "/home/wmaster/graficos" # this controller object save all user configuration and then execute each module # with their parameters. controllerObj = Project() controllerObj.setup(id='191', name='test01', description=desc) # Creating a reader object with its parameters # schainpy.model.io.jroIO_usrp.USRPReader.setup() readUnitConfObj = controllerObj.addReadUnit(datatype='DigitalRF', path='/home/nanosat/data', startDate='2000/07/03', endDate='2017/07/03', startTime='00:00:00', endTime='23:59:59', online=0) # procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', # inputId=readUnitConfObj.getId()) # opObj10 = procUnitConfObj0.addOperation(name='selectHeights') # opObj10.addParameter(name='minHei', value='0', format='float') # opObj10.addParameter(name='maxHei', value='8', format='float') # opObj10 = procUnitConfObj0.addOperation(name='setH0') # opObj10.addParameter(name='h0', value='5.4', format='float') # opObj10 = procUnitConfObj0.addOperation(name='Decoder', optype='external') # opObj10.addParameter(name='code', value='1,-1', format='intlist') # opObj10.addParameter(name='nCode', value='2', format='float') # opObj10.addParameter(name='nBaud', value='1', format='float') # opObj10 = procUnitConfObj0.addOperation(name='CohInt', optype='external') # opObj10.addParameter(name='n', value='128', format='float') # opObj11 = procUnitConfObj0.addOperation(name='Scope', optype='external') # opObj11.addParameter(name='id', value='121', format='int') # opObj11.addParameter(name='wintitle', value='Scope', format='str') # procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', # inputId=procUnitConfObj0.getId()) # #Creating a processing object with its parameters # #schainpy.model.proc.jroproc_spectra.SpectraProc.run() # #If you need to add more parameters can use the "addParameter method" # procUnitConfObj1.addParameter(name='nFFTPoints', value='8', format='int') # procUnitConfObj1.addParameter(name='pairsList', value='(0,1)', format='pairslist') # opObj10 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') # opObj10.addParameter(name='n', value='2', format='float') # # Using internal methods # schainpy.model.proc.jroproc_spectra.SpectraProc.selectChannels() # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') # opObj10.addParameter(name='channelList', value='0,1', format='intlist') # Using internal methods # schainpy.model.proc.jroproc_spectra.SpectraProc.selectHeights() # opObj10 = procUnitConfObj1.addOperation(name='selectHeights') # opObj10.addParameter(name='minHei', value='90', format='float') # opObj10.addParameter(name='maxHei', value='180', format='float') # Using external methods (new modules) # #schainpy.model.proc.jroproc_spectra.IncohInt.setup() # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='other') # opObj12.addParameter(name='n', value='1', format='int') # Using external methods (new modules) # schainpy.model.graphics.jroplot_spectra.SpectraPlot.setup() # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') # opObj11.addParameter(name='id', value='11', format='int') # opObj11.addParameter(name='wintitle', value='SpectraPlot', format='str') # opObj11.addParameter(name='zmin', value='0', format='int') # opObj11.addParameter(name='zmax', value='90', format='int') # opObj11.addParameter(name='save', value='1', format='int') # opObj11.addParameter(name='xmin', value='-20', format='float') # opObj11.addParameter(name='xmax', value='20', format='float') # Using external methods (new modules) # schainpy.model.graphics.jroplot_spectra.RTIPlot.setup() # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='other') # opObj11.addParameter(name='id', value='30', format='int') # opObj11.addParameter(name='wintitle', value='RTI', format='str') # # opObj11.addParameter(name='zmin', value='0', format='int') # # opObj11.addParameter(name='zmax', value='90', format='int') # opObj11.addParameter(name='showprofile', value='1', format='int') # opObj11.addParameter(name='timerange', value=str(2*60*60), format='int') # opObj11.addParameter(name='xmin', value='19.5', format='float') # opObj11.addParameter(name='xmax', value='20', format='float') # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='other') # opObj11.addParameter(name='id', value='3', format='int') # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') # opObj11.addParameter(name='zmin', value='30', format='int') # opObj11.addParameter(name='zmax', value='120', format='int') # opObj11.addParameter(name='pairsList', value='(0,1)', format='pairslist') controllerObj.start()
path = '/home/alex/Downloads/NEW_WR2/spc16removeDC' figpath = path desc = "Simulator Test" controllerObj = Project() controllerObj.setup(id='10',name='Test Simulator',description=desc) readUnitConfObj = controllerObj.addReadUnit(datatype='SimulatorReader', frequency=9.345e9, FixRCP_IPP= 60, Tau_0 = 30, AcqH0_0=0, samples=330, AcqDH_0=0.15, FixRCP_TXA=0.15, FixRCP_TXB=0.15, Fdoppler=200.0, Hdoppler=36, Adoppler=300, delay=0, online=0, walk=0, nTotalReadFiles=4) opObj11 = readUnitConfObj.addOperation(name='printInfo') procUnitConfObjA = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) opObj10 = procUnitConfObjA.addOperation(name='selectChannels') opObj10.addParameter(name='channelList', value=[0,1])
#Fechas para busqueda de archivos startDate = '2016/08/29' endDate = '2016/09/11' #Horas para busqueda de archivos startTime = '00:00:00' endTime = '23:59:59' #Offsets optimos obtenidos con OptimumOffset.py phaseOffsets = '-2.84, -1.77, 11.94, 9.71' phaseOffsets = '-5.86, -0.93, -7.29, 23.35' #------------------------------------------------------------------------------------------------ readUnitConfObj = controllerObj.addReadUnit(datatype='ParamReader', path=path, startDate=startDate, endDate=endDate, startTime=startTime, endTime=endTime, walk=1) #-------------------------------------------------------------------------------------------------- procUnitConfObj1 = controllerObj.addProcUnit(datatype='ParametersProc', inputId=readUnitConfObj.getId()) opObj10 = procUnitConfObj1.addOperation(name='CorrectSMPhases',optype='other') opObj10.addParameter(name='phaseOffsets', value=phaseOffsets, format='floatlist') opObj13 = procUnitConfObj1.addOperation(name='SkyMapPlot', optype='other') opObj13.addParameter(name='id', value='1', format='int') opObj13.addParameter(name='wintitle', value='Sky Map', format='str') opObj13.addParameter(name='save', value='1', format='bool') opObj13.addParameter(name='figpath', value=pathfig, format='str') opObj13.addParameter(name='ftp', value='1', format='int')
#Fechas para busqueda de archivos startDate = '2010/08/29' endDate = '2017/09/11' #Horas para busqueda de archivos startTime = '00:00:00' endTime = '23:59:59' #------------------------------ Voltage Reading Unit ---------------------------------- readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', path=path, startDate=startDate, endDate=endDate, startTime=startTime, endTime=endTime, online=0, delay=30, walk=1, getblock=1, blocktime=100) opObj11 = readUnitConfObj.addOperation(name='printNumberOfBlock') #-------------------------- Voltage Processing Unit ------------------------------------ procUnitConfObj0 = controllerObj.addProcUnit(datatype='VoltageProc', inputId=readUnitConfObj.getId()) opObj00 = procUnitConfObj0.addOperation(name='selectChannels') opObj00.addParameter(name='channelList', value='0,1,2,3,4', format='intlist')
figpath = path desc = "Simulator Test" controllerObj = Project() controllerObj.setup(id='10', name='Test Simulator', description=desc) readUnitConfObj = controllerObj.addReadUnit( datatype='SimulatorReader', frequency=9.345e9, FixRCP_IPP=60, Tau_0=30, AcqH0_0=0, samples=330, AcqDH_0=0.15, FixRCP_TXA=0.15, FixRCP_TXB=0.15, Fdoppler=600.0, Hdoppler=36, Adoppler=300, #300 delay=0, online=0, walk=0, profilesPerBlock=625, dataBlocksPerFile=100) #,#nTotalReadFiles=2) ''' readUnitConfObj = controllerObj.addReadUnit(datatype='VoltageReader', path=path, startDate="2020/01/01", #"2020/01/01",#today, endDate= "2020/12/01", #"2020/12/30",#today, startTime='00:00:00', endTime='23:59:59',