From 28bb81ed03629aa9375fa9d1d6dcfc7e4af8b386 Mon Sep 17 00:00:00 2001 From: CunrenLiang <56097947+CunrenLiang@users.noreply.github.com> Date: Mon, 11 May 2020 18:05:30 -0700 Subject: [PATCH] improve ALOS-2 ionospheric correciton and geocode --- .../isceobj/Alos2burstProc/runGeocodeSd.py | 5 ++- .../isceobj/Alos2burstProc/runIonSubband.py | 42 ++++++++++++++++++- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/components/isceobj/Alos2burstProc/runGeocodeSd.py b/components/isceobj/Alos2burstProc/runGeocodeSd.py index e8634e3..445fa68 100644 --- a/components/isceobj/Alos2burstProc/runGeocodeSd.py +++ b/components/isceobj/Alos2burstProc/runGeocodeSd.py @@ -4,6 +4,7 @@ # import os +import glob import logging import numpy as np @@ -31,7 +32,9 @@ def runGeocodeSd(self): if self.geocodeListSd == None: geocodeList = self._insar.multilookCoherenceSd + self._insar.azimuthDeformationSd + self._insar.maskedAzimuthDeformationSd else: - geocodeList = self.geocodeListSd + geocodeList = [] + for xxx in self.geocodeListSd: + geocodeList += glob.glob(xxx) if self.bbox == None: bbox = getBboxGeo(masterTrack) diff --git a/components/isceobj/Alos2burstProc/runIonSubband.py b/components/isceobj/Alos2burstProc/runIonSubband.py index 131b6f3..f02a781 100644 --- a/components/isceobj/Alos2burstProc/runIonSubband.py +++ b/components/isceobj/Alos2burstProc/runIonSubband.py @@ -252,18 +252,56 @@ def runIonSubband(self): #list of input files inputInterferograms = [] inputAmplitudes = [] + phaseDiff = [None] for j, swathNumber in enumerate(range(self._insar.startingSwath, self._insar.endingSwath + 1)): swathDir = 's{}'.format(swathNumber) inputInterferograms.append(os.path.join('../', swathDir, self._insar.interferogram)) inputAmplitudes.append(os.path.join('../', swathDir, self._insar.amplitude)) + #compute phase needed to be compensated using startingRange + if j >= 1: + #phaseDiffSwath1 = -4.0 * np.pi * (masterTrack.frames[i].swaths[j-1].startingRange - slaveTrack.frames[i].swaths[j-1].startingRange)/subbandRadarWavelength[k] + #phaseDiffSwath2 = -4.0 * np.pi * (masterTrack.frames[i].swaths[j].startingRange - slaveTrack.frames[i].swaths[j].startingRange)/subbandRadarWavelength[k] + phaseDiffSwath1 = +4.0 * np.pi * masterTrack.frames[i].swaths[j-1].startingRange * (1.0/radarWavelength - 1.0/subbandRadarWavelength[k]) \ + -4.0 * np.pi * slaveTrack.frames[i].swaths[j-1].startingRange * (1.0/radarWavelength - 1.0/subbandRadarWavelength[k]) + phaseDiffSwath2 = +4.0 * np.pi * masterTrack.frames[i].swaths[j].startingRange * (1.0/radarWavelength - 1.0/subbandRadarWavelength[k]) \ + -4.0 * np.pi * slaveTrack.frames[i].swaths[j].startingRange * (1.0/radarWavelength - 1.0/subbandRadarWavelength[k]) + if masterTrack.frames[i].swaths[j-1].startingRange - slaveTrack.frames[i].swaths[j-1].startingRange == \ + masterTrack.frames[i].swaths[j].startingRange - slaveTrack.frames[i].swaths[j].startingRange: + #phaseDiff.append(phaseDiffSwath2 - phaseDiffSwath1) + #if master and slave versions are all before or after version 2.025 (starting range error < 0.5 m), + #it should be OK to do the above. + #see results in neom where it meets the above requirement, but there is still phase diff + #to be less risky, we do not input values here + phaseDiff.append(None) + else: + phaseDiff.append(None) + #note that frame parameters are updated after mosaicking #mosaic amplitudes swathMosaic(masterTrack.frames[i], inputAmplitudes, self._insar.amplitude, rangeOffsets, azimuthOffsets, self._insar.numberRangeLooks1, self._insar.numberAzimuthLooks1, resamplingMethod=0) #mosaic interferograms - swathMosaic(masterTrack.frames[i], inputInterferograms, self._insar.interferogram, - rangeOffsets, azimuthOffsets, self._insar.numberRangeLooks1, self._insar.numberAzimuthLooks1, updateFrame=False, phaseCompensation=True, resamplingMethod=1) + #These are for ALOS-2, may need to change for ALOS-4! + phaseDiffFixed = [0.0, 0.4754024578084084, 0.9509913179406437, 1.4261648478671614, 2.179664007520499, 2.6766909968024932, 3.130810857] + + snapThreshold = 0.2 + (phaseDiffEst, phaseDiffUsed, phaseDiffSource) = swathMosaic(masterTrack.frames[i], inputInterferograms, self._insar.interferogram, + rangeOffsets, azimuthOffsets, self._insar.numberRangeLooks1, self._insar.numberAzimuthLooks1, updateFrame=False, + phaseCompensation=True, phaseDiff=phaseDiff, phaseDiffFixed=phaseDiffFixed, snapThreshold=snapThreshold, pcRangeLooks=1, pcAzimuthLooks=3, + filt=False, resamplingMethod=1) + + #the first item is meaningless for all the following list, so only record the following items + catalog.addItem('{} subswath phase difference input'.format(ionDir['subband'][k]), phaseDiff[1:], 'runIonSubband') + catalog.addItem('{} subswath phase difference estimated'.format(ionDir['subband'][k]), phaseDiffEst[1:], 'runIonSubband') + catalog.addItem('{} subswath phase difference used'.format(ionDir['subband'][k]), phaseDiffUsed[1:], 'runIonSubband') + catalog.addItem('{} subswath phase difference used source'.format(ionDir['subband'][k]), phaseDiffSource[1:], 'runIonSubband') + #check if there is value around 3.130810857, which may not be stable + phaseDiffUnstableExist = False + for xxx in phaseDiffUsed: + if abs(abs(xxx) - 3.130810857) < 0.2: + phaseDiffUnstableExist = True + catalog.addItem('{} subswath phase difference unstable exists'.format(ionDir['subband'][k]), phaseDiffUnstableExist, 'runIonSubband') create_xml(self._insar.amplitude, masterTrack.frames[i].numberOfSamples, masterTrack.frames[i].numberOfLines, 'amp') create_xml(self._insar.interferogram, masterTrack.frames[i].numberOfSamples, masterTrack.frames[i].numberOfLines, 'int')