@@ -365,12 +365,14 class ParametersProc(ProcessingUnit): | |||
|
365 | 365 | #------------------- Detect Meteors ------------------------------ |
|
366 | 366 | |
|
367 | 367 | def MeteorDetection(self, hei_ref = None, tauindex = 0, |
|
368 |
p |
|
|
368 | phaseOffsets = None, | |
|
369 | 369 | cohDetection = False, cohDet_timeStep = 1, cohDet_thresh = 25, |
|
370 | 370 | noise_timeStep = 4, noise_multiple = 4, |
|
371 | 371 | multDet_timeLimit = 1, multDet_rangeLimit = 3, |
|
372 | 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 | 378 | Function DetectMeteors() |
@@ -447,32 +449,31 class ParametersProc(ProcessingUnit): | |||
|
447 | 449 | ''' |
|
448 | 450 | Cambiar este pairslist |
|
449 | 451 | ''' |
|
450 | pairslist = [] | |
|
451 | nChannel = self.dataOut.nChannels | |
|
452 | for i in range(nChannel): | |
|
453 | if i != centerReceiverIndex: | |
|
454 |
|
|
|
452 | pairslist = [(channelCentX, channel25X),(channelCentX, channel20X),(channelCentY,channel25Y),(channelCentY, channel20Y)] | |
|
453 | ||
|
454 | # nChannel = self.dataOut.nChannels | |
|
455 | # for i in range(nChannel): | |
|
456 | # if i != centerReceiverIndex: | |
|
457 | # pairslist.append((centerReceiverIndex,i)) | |
|
455 | 458 | |
|
456 | 459 | #****************REMOVING HARDWARE PHASE DIFFERENCES*************** |
|
457 | 460 | # see if the user put in pre defined phase shifts |
|
458 | 461 | voltsPShift = self.dataOut.data_pre.copy() |
|
459 | 462 | |
|
460 | if predefinedPhaseShifts != None: | |
|
461 | hardwarePhaseShifts = numpy.array(predefinedPhaseShifts)*numpy.pi/180 | |
|
462 | ||
|
463 | # elif beaconPhaseShifts: | |
|
464 | # #get hardware phase shifts using beacon signal | |
|
465 | # hardwarePhaseShifts = self.__getHardwarePhaseDiff(self.dataOut.data_pre, pairslist, newheis, 10) | |
|
466 | # hardwarePhaseShifts = numpy.insert(hardwarePhaseShifts,centerReceiverIndex,0) | |
|
467 | ||
|
468 | else: | |
|
469 | hardwarePhaseShifts = numpy.zeros(5) | |
|
470 | ||
|
471 | ||
|
472 | voltsPShift = numpy.zeros((self.dataOut.data_pre.shape[0],self.dataOut.data_pre.shape[1],self.dataOut.data_pre.shape[2]), dtype = 'complex') | |
|
473 | for i in range(self.dataOut.data_pre.shape[0]): | |
|
474 | voltsPShift[i,:,:] = self.__shiftPhase(self.dataOut.data_pre[i,:,:], hardwarePhaseShifts[i]) | |
|
475 | ||
|
463 | # if predefinedPhaseShifts != None: | |
|
464 | # hardwarePhaseShifts = numpy.array(predefinedPhaseShifts)*numpy.pi/180 | |
|
465 | # | |
|
466 | # # elif beaconPhaseShifts: | |
|
467 | # # #get hardware phase shifts using beacon signal | |
|
468 | # # hardwarePhaseShifts = self.__getHardwarePhaseDiff(self.dataOut.data_pre, pairslist, newheis, 10) | |
|
469 | # # hardwarePhaseShifts = numpy.insert(hardwarePhaseShifts,centerReceiverIndex,0) | |
|
470 | # | |
|
471 | # else: | |
|
472 | # hardwarePhaseShifts = numpy.zeros(5) | |
|
473 | # | |
|
474 | # 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]): | |
|
476 | # voltsPShift[i,:,:] = self.__shiftPhase(self.dataOut.data_pre[i,:,:], hardwarePhaseShifts[i]) | |
|
476 | 477 | |
|
477 | 478 | #******************END OF REMOVING HARDWARE PHASE DIFFERENCES********* |
|
478 | 479 | |
@@ -537,9 +538,15 class ParametersProc(ProcessingUnit): | |||
|
537 | 538 | date = self.dataOut.utctime |
|
538 | 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 | 547 | pairsList = [] |
|
541 |
pairx = (0, |
|
|
542 |
pairy = ( |
|
|
548 | pairx = (0,1) | |
|
549 | pairy = (2,3) | |
|
543 | 550 | pairsList.append(pairx) |
|
544 | 551 | pairsList.append(pairy) |
|
545 | 552 | |
@@ -1981,14 +1988,10 class PhaseCalibration(Operation): | |||
|
1981 | 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 | 1993 | dataOut.flagNoData = True |
|
1987 | self.__dataReady = False | |
|
1988 | ||
|
1989 | if nHours == None: | |
|
1990 | nHours = 1 | |
|
1991 | ||
|
1994 | self.__dataReady = False | |
|
1992 | 1995 | dataOut.outputInterval = nHours*3600 |
|
1993 | 1996 | |
|
1994 | 1997 | if self.__isConfig == False: |
@@ -2003,7 +2006,7 class PhaseCalibration(Operation): | |||
|
2003 | 2006 | self.__buffer = dataOut.data_param.copy() |
|
2004 | 2007 | |
|
2005 | 2008 | else: |
|
2006 |
self.__buffer = numpy. |
|
|
2009 | self.__buffer = numpy.vstack((self.__buffer, dataOut.data_param)) | |
|
2007 | 2010 | |
|
2008 | 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 | 2020 | k = 2*numpy.pi/lamb |
|
2018 | 2021 | azimuth = 0 |
|
2019 | 2022 | h = (hmin, hmax) |
|
2020 |
pairs |
|
|
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 | 2026 | meteorsArray = self.__buffer |
|
2023 | 2027 | error = meteorsArray[:,-1] |
@@ -2031,7 +2035,7 class PhaseCalibration(Operation): | |||
|
2031 | 2035 | gammas = self.__getGammas(pairs, k, distances, phases) |
|
2032 | 2036 | # gammas = numpy.array([-21.70409463,45.76935864])*numpy.pi/180 |
|
2033 | 2037 | #Calculate Phases |
|
2034 |
phasesOff = self.__getPhases(azimuth, h, pairs |
|
|
2038 | phasesOff = self.__getPhases(azimuth, h, pairs, distances, gammas, meteorsArray) | |
|
2035 | 2039 | phasesOff = phasesOff.reshape((1,phasesOff.size)) |
|
2036 | 2040 | dataOut.data_output = -phasesOff |
|
2037 | 2041 | dataOut.flagNoData = False |
General Comments 0
You need to be logged in to leave comments.
Login now