##// END OF EJS Templates
Changes to meteor detection and phase correction because of relocation of antenna
Julio Valdez -
r819:c63b6bff3798
parent child
Show More
@@ -365,12 +365,14 class ParametersProc(ProcessingUnit):
365 #------------------- Detect Meteors ------------------------------
365 #------------------- Detect Meteors ------------------------------
366
366
367 def MeteorDetection(self, hei_ref = None, tauindex = 0,
367 def MeteorDetection(self, hei_ref = None, tauindex = 0,
368 predefinedPhaseShifts = None, centerReceiverIndex = 2,
368 phaseOffsets = None,
369 cohDetection = False, cohDet_timeStep = 1, cohDet_thresh = 25,
369 cohDetection = False, cohDet_timeStep = 1, cohDet_thresh = 25,
370 noise_timeStep = 4, noise_multiple = 4,
370 noise_timeStep = 4, noise_multiple = 4,
371 multDet_timeLimit = 1, multDet_rangeLimit = 3,
371 multDet_timeLimit = 1, multDet_rangeLimit = 3,
372 phaseThresh = 20, SNRThresh = 8,
372 phaseThresh = 20, SNRThresh = 8,
373 hmin = 50, hmax=150, azimuth = 0) :
373 hmin = 50, hmax=150, azimuth = 0,
374 channel25X = 0, channel20X = 4, channelCentX = 2,
375 channel25Y = 1, channel20Y = 3, channelCentY = 2) :
374
376
375 '''
377 '''
376 Function DetectMeteors()
378 Function DetectMeteors()
@@ -447,32 +449,31 class ParametersProc(ProcessingUnit):
447 '''
449 '''
448 Cambiar este pairslist
450 Cambiar este pairslist
449 '''
451 '''
450 pairslist = []
452 pairslist = [(channelCentX, channel25X),(channelCentX, channel20X),(channelCentY,channel25Y),(channelCentY, channel20Y)]
451 nChannel = self.dataOut.nChannels
453
452 for i in range(nChannel):
454 # nChannel = self.dataOut.nChannels
453 if i != centerReceiverIndex:
455 # for i in range(nChannel):
454 pairslist.append((centerReceiverIndex,i))
456 # if i != centerReceiverIndex:
457 # pairslist.append((centerReceiverIndex,i))
455
458
456 #****************REMOVING HARDWARE PHASE DIFFERENCES***************
459 #****************REMOVING HARDWARE PHASE DIFFERENCES***************
457 # see if the user put in pre defined phase shifts
460 # see if the user put in pre defined phase shifts
458 voltsPShift = self.dataOut.data_pre.copy()
461 voltsPShift = self.dataOut.data_pre.copy()
459
462
460 if predefinedPhaseShifts != None:
463 # if predefinedPhaseShifts != None:
461 hardwarePhaseShifts = numpy.array(predefinedPhaseShifts)*numpy.pi/180
464 # hardwarePhaseShifts = numpy.array(predefinedPhaseShifts)*numpy.pi/180
462
465 #
463 # elif beaconPhaseShifts:
466 # # elif beaconPhaseShifts:
464 # #get hardware phase shifts using beacon signal
467 # # #get hardware phase shifts using beacon signal
465 # hardwarePhaseShifts = self.__getHardwarePhaseDiff(self.dataOut.data_pre, pairslist, newheis, 10)
468 # # hardwarePhaseShifts = self.__getHardwarePhaseDiff(self.dataOut.data_pre, pairslist, newheis, 10)
466 # hardwarePhaseShifts = numpy.insert(hardwarePhaseShifts,centerReceiverIndex,0)
469 # # hardwarePhaseShifts = numpy.insert(hardwarePhaseShifts,centerReceiverIndex,0)
467
470 #
468 else:
471 # else:
469 hardwarePhaseShifts = numpy.zeros(5)
472 # hardwarePhaseShifts = numpy.zeros(5)
470
473 #
471
474 # voltsPShift = numpy.zeros((self.dataOut.data_pre.shape[0],self.dataOut.data_pre.shape[1],self.dataOut.data_pre.shape[2]), dtype = 'complex')
472 voltsPShift = numpy.zeros((self.dataOut.data_pre.shape[0],self.dataOut.data_pre.shape[1],self.dataOut.data_pre.shape[2]), dtype = 'complex')
475 # for i in range(self.dataOut.data_pre.shape[0]):
473 for i in range(self.dataOut.data_pre.shape[0]):
476 # voltsPShift[i,:,:] = self.__shiftPhase(self.dataOut.data_pre[i,:,:], hardwarePhaseShifts[i])
474 voltsPShift[i,:,:] = self.__shiftPhase(self.dataOut.data_pre[i,:,:], hardwarePhaseShifts[i])
475
476
477
477 #******************END OF REMOVING HARDWARE PHASE DIFFERENCES*********
478 #******************END OF REMOVING HARDWARE PHASE DIFFERENCES*********
478
479
@@ -537,9 +538,15 class ParametersProc(ProcessingUnit):
537 date = self.dataOut.utctime
538 date = self.dataOut.utctime
538 arrayParameters = self.__setNewArrays(listMeteors4, date, heiRang)
539 arrayParameters = self.__setNewArrays(listMeteors4, date, heiRang)
539
540
541 #Correcting phase offset
542 if phaseOffsets != None:
543 phaseOffsets = numpy.array(phaseOffsets)*numpy.pi/180
544 arrayParameters[:,8:12] = numpy.unwrap(arrayParameters[:,8:12] + phaseOffsets)
545
546 #Second Pairslist
540 pairsList = []
547 pairsList = []
541 pairx = (0,3)
548 pairx = (0,1)
542 pairy = (1,2)
549 pairy = (2,3)
543 pairsList.append(pairx)
550 pairsList.append(pairx)
544 pairsList.append(pairy)
551 pairsList.append(pairy)
545
552
@@ -1981,14 +1988,10 class PhaseCalibration(Operation):
1981 return phOffset
1988 return phOffset
1982
1989
1983
1990
1984 def run(self, dataOut, pairs, distances, hmin, hmax, nHours = None):
1991 def run(self, dataOut, hmin, hmax, direction_25X=-1, direction_20X=1, direction_25Y=-1, direction_20Y=1, nHours = 1):
1985
1992
1986 dataOut.flagNoData = True
1993 dataOut.flagNoData = True
1987 self.__dataReady = False
1994 self.__dataReady = False
1988
1989 if nHours == None:
1990 nHours = 1
1991
1992 dataOut.outputInterval = nHours*3600
1995 dataOut.outputInterval = nHours*3600
1993
1996
1994 if self.__isConfig == False:
1997 if self.__isConfig == False:
@@ -2003,7 +2006,7 class PhaseCalibration(Operation):
2003 self.__buffer = dataOut.data_param.copy()
2006 self.__buffer = dataOut.data_param.copy()
2004
2007
2005 else:
2008 else:
2006 self.__buffer = numpy.hstack((self.__buffer, dataOut.data_param))
2009 self.__buffer = numpy.vstack((self.__buffer, dataOut.data_param))
2007
2010
2008 self.__dataReady = self.__checkTime(dataOut.utctime, self.__initime, dataOut.paramInterval, dataOut.outputInterval) #Check if the buffer is ready
2011 self.__dataReady = self.__checkTime(dataOut.utctime, self.__initime, dataOut.paramInterval, dataOut.outputInterval) #Check if the buffer is ready
2009
2012
@@ -2017,7 +2020,8 class PhaseCalibration(Operation):
2017 k = 2*numpy.pi/lamb
2020 k = 2*numpy.pi/lamb
2018 azimuth = 0
2021 azimuth = 0
2019 h = (hmin, hmax)
2022 h = (hmin, hmax)
2020 pairsList = ((0,3),(1,2))
2023 pairs = ((0,1),(2,3))
2024 distances = [direction_25X*2.5*lamb, direction_20X*2*lamb, direction_25Y*2.5*lamb, direction_20Y*2*lamb]
2021
2025
2022 meteorsArray = self.__buffer
2026 meteorsArray = self.__buffer
2023 error = meteorsArray[:,-1]
2027 error = meteorsArray[:,-1]
@@ -2031,7 +2035,7 class PhaseCalibration(Operation):
2031 gammas = self.__getGammas(pairs, k, distances, phases)
2035 gammas = self.__getGammas(pairs, k, distances, phases)
2032 # gammas = numpy.array([-21.70409463,45.76935864])*numpy.pi/180
2036 # gammas = numpy.array([-21.70409463,45.76935864])*numpy.pi/180
2033 #Calculate Phases
2037 #Calculate Phases
2034 phasesOff = self.__getPhases(azimuth, h, pairsList, distances, gammas, meteorsArray)
2038 phasesOff = self.__getPhases(azimuth, h, pairs, distances, gammas, meteorsArray)
2035 phasesOff = phasesOff.reshape((1,phasesOff.size))
2039 phasesOff = phasesOff.reshape((1,phasesOff.size))
2036 dataOut.data_output = -phasesOff
2040 dataOut.data_output = -phasesOff
2037 dataOut.flagNoData = False
2041 dataOut.flagNoData = False
General Comments 0
You need to be logged in to leave comments. Login now