适配了HJ2EF
parent
936b0ee9ac
commit
def642fada
|
|
@ -8,14 +8,44 @@
|
||||||
"name": "Python: prepSlcLT1AB File",
|
"name": "Python: prepSlcLT1AB File",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/prepSlcLT1AB.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/prepSlcLT1AB.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
"-i",
|
"-i",
|
||||||
"/mnt/d/LTInsar/download/",
|
"/mnt/d/LTInsar/download/",
|
||||||
"-o",
|
"-o",
|
||||||
"/mnt/d/LTInsar/slc/",
|
"/mnt/d/LTInsar/slc/"
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Python: unpackFrame_HJ2 File 20230522",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/unpackFrame_HJ2.py",
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"justMyCode": false,
|
||||||
|
"args": [
|
||||||
|
"-i",
|
||||||
|
"/mnt/f/ChenZenghui/SSARDEM/STRIP1/20230522",
|
||||||
|
"-o",
|
||||||
|
"/mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/slc/20230522"
|
||||||
|
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Python: unpackFrame_HJ2 File 20230601",
|
||||||
|
"type": "python",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/unpackFrame_HJ2.py",
|
||||||
|
"console": "integratedTerminal",
|
||||||
|
"justMyCode": false,
|
||||||
|
"args": [
|
||||||
|
"-i",
|
||||||
|
"/mnt/f/ChenZenghui/SSARDEM/STRIP1/20230601",
|
||||||
|
"-o",
|
||||||
|
"/mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/slc/20230601",
|
||||||
"--linux"
|
"--linux"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -23,7 +53,7 @@
|
||||||
"name": "Python: DEM2ISCE File",
|
"name": "Python: DEM2ISCE File",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/DEM2ISCE.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/DEM2ISCE.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
|
|
@ -37,7 +67,7 @@
|
||||||
"name": "Python: stackStripMap File",
|
"name": "Python: stackStripMap File",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/stackStripMap.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/stackStripMap.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
|
|
@ -57,39 +87,39 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Python: run 01 20230327",
|
"name": "Python: run 01 20230522",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/stripmapWrapper.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/stripmapWrapper.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
"-c",
|
"-c",
|
||||||
"/mnt/d/LTInsar/work/configs/config_crop_20230327"
|
"/mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/configs/config_crop_20230522"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Python: run 01 20230404",
|
"name": "Python: run 01 20230601",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/stripmapWrapper.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/stripmapWrapper.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
"-c",
|
"-c",
|
||||||
"/mnt/d/LTInsar/work/configs/config_crop_20230404"
|
"/mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/configs/config_crop_20230601"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Python: run 02",
|
"name": "Python: run 02",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/stripmapWrapper.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/stripmapWrapper.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
"-c",
|
"-c",
|
||||||
"/mnt/d/LTInsar/work/configs/config_reference_20230523"
|
"/mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/configs/config_reference_20230522"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -108,7 +138,7 @@
|
||||||
"name": "Python: run 08 20230327",
|
"name": "Python: run 08 20230327",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/stripmapWrapper.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/stripmapWrapper.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
|
|
@ -120,7 +150,7 @@
|
||||||
"name": "Python: run 07 20230404",
|
"name": "Python: run 07 20230404",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/stripmapWrapper.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/stripmapWrapper.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
|
|
@ -132,7 +162,7 @@
|
||||||
"name": "Python: run 09",
|
"name": "Python: run 09",
|
||||||
"type": "python",
|
"type": "python",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "/mnt/d/codestorage/isce2/isce2/contrib/stack/stripmapStack/stripmapWrapper.py",
|
"program": "/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack/stripmapWrapper.py",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"justMyCode": false,
|
"justMyCode": false,
|
||||||
"args": [
|
"args": [
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -153,9 +153,12 @@ class Baseline(Component):
|
||||||
#TODO This could be further refactored into a method that calculates the baseline between
|
#TODO This could be further refactored into a method that calculates the baseline between
|
||||||
#TODO frames when given a reference time and a secondary time and a method that calls this method
|
#TODO frames when given a reference time and a secondary time and a method that calls this method
|
||||||
#TODO multiple times to calculate the rate of baseline change over time.
|
#TODO multiple times to calculate the rate of baseline change over time.
|
||||||
|
print("*"*20)
|
||||||
|
print("The number of ports:",len(self._inputPorts))
|
||||||
for port in self.inputPorts:
|
for port in self.inputPorts:
|
||||||
port()
|
print("self.inputPorts:",port.getName())
|
||||||
|
#port()
|
||||||
|
print("*"*20)
|
||||||
lookVector = self.calculateLookVector()
|
lookVector = self.calculateLookVector()
|
||||||
|
|
||||||
az_offset = []
|
az_offset = []
|
||||||
|
|
@ -329,7 +332,28 @@ class Baseline(Component):
|
||||||
return (td.microseconds + (td.seconds + td.days * 24.0 * 3600) * 10**6) / 10**6
|
return (td.microseconds + (td.seconds + td.days * 24.0 * 3600) * 10**6) / 10**6
|
||||||
|
|
||||||
|
|
||||||
|
def addReferenceFrame_new(self,frame):
|
||||||
|
print("add referenceFrame in addReferenceFrame_new..................................................................")
|
||||||
|
self.referenceFrame = frame
|
||||||
|
self.startingRange1 = frame.getStartingRange()
|
||||||
|
|
||||||
|
prf = frame.getInstrument().getPulseRepetitionFrequency()
|
||||||
|
self.rangePixelSize = frame.getInstrument().getRangePixelSize()
|
||||||
|
self.referenceOrbit = frame.getOrbit()
|
||||||
|
midSV = self.referenceOrbit.interpolateOrbit(frame.getSensingMid(), method='hermite')
|
||||||
|
|
||||||
|
self.azimuthPixelSize = midSV.getScalarVelocity()/prf
|
||||||
|
try:
|
||||||
|
ellipsoid = frame._ellipsoid #UAVSAR frame creates ellipsoid with peg
|
||||||
|
self.radius = ellipsoid.pegRadCur
|
||||||
|
self.height = frame.platformHeight
|
||||||
|
except:
|
||||||
|
ellipsoid = frame.getInstrument().getPlatform().getPlanet().get_elp()
|
||||||
|
self.radius = ellipsoid.get_a()
|
||||||
|
self.height = midSV.calculateHeight(ellipsoid)
|
||||||
|
|
||||||
def addReferenceFrame(self):
|
def addReferenceFrame(self):
|
||||||
|
print("add addReferenceFrame inaddReferenceFrame..............................")
|
||||||
frame = self._inputPorts.getPort(name='referenceFrame').getObject()
|
frame = self._inputPorts.getPort(name='referenceFrame').getObject()
|
||||||
self.referenceFrame = frame
|
self.referenceFrame = frame
|
||||||
self.startingRange1 = frame.getStartingRange()
|
self.startingRange1 = frame.getStartingRange()
|
||||||
|
|
@ -349,7 +373,14 @@ class Baseline(Component):
|
||||||
self.radius = ellipsoid.get_a()
|
self.radius = ellipsoid.get_a()
|
||||||
self.height = midSV.calculateHeight(ellipsoid)
|
self.height = midSV.calculateHeight(ellipsoid)
|
||||||
|
|
||||||
|
def addSecondaryFrame_new(self,frame):
|
||||||
|
print("add addSecondaryFrame in addSecondaryFrame_new..................................................................")
|
||||||
|
self.secondaryFrame = frame
|
||||||
|
self.startingRange2 = frame.getStartingRange()
|
||||||
|
self.secondaryOrbit = frame.getOrbit()
|
||||||
|
|
||||||
def addSecondaryFrame(self):
|
def addSecondaryFrame(self):
|
||||||
|
print("add addSecondaryFrame addSecondaryFrame..............................")
|
||||||
frame = self._inputPorts.getPort(name='secondaryFrame').getObject()
|
frame = self._inputPorts.getPort(name='secondaryFrame').getObject()
|
||||||
self.secondaryFrame = frame
|
self.secondaryFrame = frame
|
||||||
self.startingRange2 = frame.getStartingRange()
|
self.startingRange2 = frame.getStartingRange()
|
||||||
|
|
|
||||||
|
|
@ -716,10 +716,10 @@ def baselinePair(baselineDir, reference, secondary,doBaselines=True):
|
||||||
|
|
||||||
bObj = Baseline()
|
bObj = Baseline()
|
||||||
bObj.configure()
|
bObj.configure()
|
||||||
bObj.wireInputPort(name='referenceFrame', object=mFrame) # 原始代码
|
# bObj.wireInputPort(name='referenceFrame', object=mFrame) # 原始代码
|
||||||
bObj.wireInputPort(name='secondaryFrame', object=sFrame)
|
# bObj.wireInputPort(name='secondaryFrame', object=sFrame)
|
||||||
# bObj.addReferenceFrame_new(mFrame)
|
bObj.addReferenceFrame_new(mFrame)
|
||||||
# bObj.addSecondaryFrame_new(sFrame)
|
bObj.addSecondaryFrame_new(sFrame)
|
||||||
bObj.baseline() # calculate baseline from orbits
|
bObj.baseline() # calculate baseline from orbits
|
||||||
pBaselineBottom = bObj.pBaselineBottom
|
pBaselineBottom = bObj.pBaselineBottom
|
||||||
pBaselineTop = bObj.pBaselineTop
|
pBaselineTop = bObj.pBaselineTop
|
||||||
|
|
@ -767,6 +767,8 @@ def selectPairs(inps,stackReference, secondaryDates, acuisitionDates,doBaselines
|
||||||
for j in range(i+1,numDates):
|
for j in range(i+1,numDates):
|
||||||
db = np.abs(baselineDict[acuisitionDates[j]] - baselineDict[acuisitionDates[i]])
|
db = np.abs(baselineDict[acuisitionDates[j]] - baselineDict[acuisitionDates[i]])
|
||||||
dt = np.abs(timeDict[acuisitionDates[j]].days - timeDict[acuisitionDates[i]].days)
|
dt = np.abs(timeDict[acuisitionDates[j]].days - timeDict[acuisitionDates[i]].days)
|
||||||
|
print("baseline distance ",db)
|
||||||
|
print("time distance ",dt)
|
||||||
if (db < inps.dbThr) and (dt < inps.dtThr):
|
if (db < inps.dbThr) and (dt < inps.dtThr):
|
||||||
pairs.append((acuisitionDates[i],acuisitionDates[j]))
|
pairs.append((acuisitionDates[i],acuisitionDates[j]))
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,23 @@
|
||||||
|
<VRTDataset rasterXSize="243" rasterYSize="322">
|
||||||
|
<VRTRasterBand dataType="Float32" band="1" subClass="VRTRawRasterBand">
|
||||||
|
<SourceFilename relativeToVRT="1">dense_ampcor_cov.bil</SourceFilename>
|
||||||
|
<ByteOrder>LSB</ByteOrder>
|
||||||
|
<ImageOffset>0</ImageOffset>
|
||||||
|
<PixelOffset>4</PixelOffset>
|
||||||
|
<LineOffset>2916</LineOffset>
|
||||||
|
</VRTRasterBand>
|
||||||
|
<VRTRasterBand dataType="Float32" band="2" subClass="VRTRawRasterBand">
|
||||||
|
<SourceFilename relativeToVRT="1">dense_ampcor_cov.bil</SourceFilename>
|
||||||
|
<ByteOrder>LSB</ByteOrder>
|
||||||
|
<ImageOffset>972</ImageOffset>
|
||||||
|
<PixelOffset>4</PixelOffset>
|
||||||
|
<LineOffset>2916</LineOffset>
|
||||||
|
</VRTRasterBand>
|
||||||
|
<VRTRasterBand dataType="Float32" band="3" subClass="VRTRawRasterBand">
|
||||||
|
<SourceFilename relativeToVRT="1">dense_ampcor_cov.bil</SourceFilename>
|
||||||
|
<ByteOrder>LSB</ByteOrder>
|
||||||
|
<ImageOffset>1944</ImageOffset>
|
||||||
|
<PixelOffset>4</PixelOffset>
|
||||||
|
<LineOffset>2916</LineOffset>
|
||||||
|
</VRTRasterBand>
|
||||||
|
</VRTDataset>
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
<imageFile>
|
||||||
|
<property name="ISCE_VERSION">
|
||||||
|
<value>Release: 2.6.1, svn-, 20220811. Current: svn-.</value>
|
||||||
|
</property>
|
||||||
|
<property name="access_mode">
|
||||||
|
<value>read</value>
|
||||||
|
<doc>Image access mode.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="byte_order">
|
||||||
|
<value>l</value>
|
||||||
|
<doc>Endianness of the image.</doc>
|
||||||
|
</property>
|
||||||
|
<component name="coordinate1">
|
||||||
|
<factorymodule>isceobj.Image</factorymodule>
|
||||||
|
<factoryname>createCoordinate</factoryname>
|
||||||
|
<doc>First coordinate of a 2D image (width).</doc>
|
||||||
|
<property name="delta">
|
||||||
|
<value>1</value>
|
||||||
|
<doc>Coordinate quantization.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="endingvalue">
|
||||||
|
<value>243</value>
|
||||||
|
<doc>Ending value of the coordinate.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="family">
|
||||||
|
<value>imagecoordinate</value>
|
||||||
|
<doc>Instance family name</doc>
|
||||||
|
</property>
|
||||||
|
<property name="name">
|
||||||
|
<value>imagecoordinate_name</value>
|
||||||
|
<doc>Instance name</doc>
|
||||||
|
</property>
|
||||||
|
<property name="size">
|
||||||
|
<value>243</value>
|
||||||
|
<doc>Coordinate size.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="startingvalue">
|
||||||
|
<value>0</value>
|
||||||
|
<doc>Starting value of the coordinate.</doc>
|
||||||
|
</property>
|
||||||
|
</component>
|
||||||
|
<component name="coordinate2">
|
||||||
|
<factorymodule>isceobj.Image</factorymodule>
|
||||||
|
<factoryname>createCoordinate</factoryname>
|
||||||
|
<doc>Second coordinate of a 2D image (length).</doc>
|
||||||
|
<property name="delta">
|
||||||
|
<value>1</value>
|
||||||
|
<doc>Coordinate quantization.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="endingvalue">
|
||||||
|
<value>322</value>
|
||||||
|
<doc>Ending value of the coordinate.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="family">
|
||||||
|
<value>imagecoordinate</value>
|
||||||
|
<doc>Instance family name</doc>
|
||||||
|
</property>
|
||||||
|
<property name="name">
|
||||||
|
<value>imagecoordinate_name</value>
|
||||||
|
<doc>Instance name</doc>
|
||||||
|
</property>
|
||||||
|
<property name="size">
|
||||||
|
<value>322</value>
|
||||||
|
<doc>Coordinate size.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="startingvalue">
|
||||||
|
<value>0</value>
|
||||||
|
<doc>Starting value of the coordinate.</doc>
|
||||||
|
</property>
|
||||||
|
</component>
|
||||||
|
<property name="data_type">
|
||||||
|
<value>FLOAT</value>
|
||||||
|
<doc>Image data type.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="family">
|
||||||
|
<value>image</value>
|
||||||
|
<doc>Instance family name</doc>
|
||||||
|
</property>
|
||||||
|
<property name="file_name">
|
||||||
|
<value>dense_ampcor_cov.bil</value>
|
||||||
|
<doc>Name of the image file.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="length">
|
||||||
|
<value>322</value>
|
||||||
|
<doc>Image length</doc>
|
||||||
|
</property>
|
||||||
|
<property name="name">
|
||||||
|
<value>image_name</value>
|
||||||
|
<doc>Instance name</doc>
|
||||||
|
</property>
|
||||||
|
<property name="number_bands">
|
||||||
|
<value>3</value>
|
||||||
|
<doc>Number of image bands.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="scheme">
|
||||||
|
<value>BIL</value>
|
||||||
|
<doc>Interleaving scheme of the image.</doc>
|
||||||
|
</property>
|
||||||
|
<property name="width">
|
||||||
|
<value>243</value>
|
||||||
|
<doc>Image width</doc>
|
||||||
|
</property>
|
||||||
|
<property name="xmax">
|
||||||
|
<value>243</value>
|
||||||
|
<doc>Maximum range value</doc>
|
||||||
|
</property>
|
||||||
|
<property name="xmin">
|
||||||
|
<value>0</value>
|
||||||
|
<doc>Minimum range value</doc>
|
||||||
|
</property>
|
||||||
|
</imageFile>
|
||||||
|
|
@ -136,7 +136,7 @@ def main(iargs=None):
|
||||||
|
|
||||||
inps = cmdLineParse(iargs)
|
inps = cmdLineParse(iargs)
|
||||||
os.makedirs(inps.output, exist_ok=True)
|
os.makedirs(inps.output, exist_ok=True)
|
||||||
|
print("input",inps.input)
|
||||||
pairDirs = glob.glob(os.path.join(inps.input,'*'))
|
pairDirs = glob.glob(os.path.join(inps.input,'*'))
|
||||||
polyInfo = getPolyInfo(pairDirs[0])
|
polyInfo = getPolyInfo(pairDirs[0])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,193 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# David Bekaert
|
||||||
|
import os
|
||||||
|
import glob
|
||||||
|
import argparse
|
||||||
|
from uncompressFile import uncompressfile
|
||||||
|
import shutil
|
||||||
|
import xml.etree.ElementTree as etree
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def createParser():
|
||||||
|
'''
|
||||||
|
Create command line parser.
|
||||||
|
'''
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description='Prepare HJ2 SLC processing (unzip/untar files, organize in date folders, generate script to unpack into isce formats). For now, it cannot merge multiple scenes')
|
||||||
|
parser.add_argument('-i', '--input', dest='input', type=str, required=False,
|
||||||
|
help='directory with the slc data')
|
||||||
|
parser.add_argument('-rmfile', '--rmfile', dest='rmfile',action='store_true', default=False,
|
||||||
|
help='Optional: remove zip/tar/compressed files after unpacking into date structure (default is to keep in archive folder)')
|
||||||
|
parser.add_argument('-o', '--output', dest='output', type=str, required=False,
|
||||||
|
help='output directory where data needs to be unpacked into isce format (for script generation).')
|
||||||
|
parser.add_argument('-t', '--text_cmd', dest='text_cmd', type=str, default='source ~/.bash_profile;',
|
||||||
|
help='text command to be added to the beginning of each line of the run files. Default: source ~/.bash_profile;')
|
||||||
|
|
||||||
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
def cmdLineParse(iargs=None):
|
||||||
|
'''
|
||||||
|
Command line parser.
|
||||||
|
'''
|
||||||
|
|
||||||
|
parser = createParser()
|
||||||
|
return parser.parse_args(args = iargs)
|
||||||
|
|
||||||
|
def get_Date(RSAT2folder):
|
||||||
|
|
||||||
|
# will search for different version of workreport to be compatible with ASf, WInSAR etc
|
||||||
|
RSAT2file = glob.glob(os.path.join(RSAT2folder,'*.xml'))
|
||||||
|
# if nothing is found return a failure
|
||||||
|
if len(RSAT2file) > 0:
|
||||||
|
RSAT2file = RSAT2file[0]
|
||||||
|
# loading the date information from the product.xml file
|
||||||
|
tree = etree.parse(RSAT2file)
|
||||||
|
root = tree.getroot()
|
||||||
|
# for attributes in root.iter('{http://www.rsi.ca/rs2/prod/xml/schemas}sensor'):
|
||||||
|
# attribute_list = list(attributes)
|
||||||
|
# for attribute in attribute_list:
|
||||||
|
# if attribute.tag=='{http://www.rsi.ca/rs2/prod/xml/schemas}rawDataStartTime':
|
||||||
|
# date = attribute.text
|
||||||
|
# UTC = date[11:16]
|
||||||
|
# acquisitionDate = date[0:4]+date[5:7]+date[8:10]
|
||||||
|
image_time = root.find('imageinfo').find('imagingTime').find('start').text
|
||||||
|
if image_time != None:
|
||||||
|
acquisitionDate = image_time[0:4]+image_time[5:7]+image_time[8:10]
|
||||||
|
|
||||||
|
if len(acquisitionDate)==8:
|
||||||
|
successflag = True
|
||||||
|
return successflag, acquisitionDate
|
||||||
|
|
||||||
|
# if it reached here it could not find the acqusiitionDate
|
||||||
|
successflag = False
|
||||||
|
acquisitionDate = 'FAIL'
|
||||||
|
return successflag, acquisitionDate
|
||||||
|
|
||||||
|
def main(iargs=None):
|
||||||
|
'''
|
||||||
|
The main driver.
|
||||||
|
'''
|
||||||
|
|
||||||
|
inps = cmdLineParse(iargs)
|
||||||
|
# parsing required inputs
|
||||||
|
inputDir = os.path.abspath(inps.input)
|
||||||
|
# parsing optional inputs
|
||||||
|
if inps.output:
|
||||||
|
outputDir = os.path.abspath(inps.output)
|
||||||
|
else:
|
||||||
|
outputDir = None
|
||||||
|
rmfile = inps.rmfile
|
||||||
|
|
||||||
|
# inputDirs = r'/mnt/e/MicroWorkspace/GF3-Deformation/download/'
|
||||||
|
# inputDir = os.path.abspath(inputDirs)
|
||||||
|
# outputDirs = r'/mnt/e/MicroWorkspace/GF3-Deformation/SLC'
|
||||||
|
# outputDir = os.path.abspath(outputDirs)
|
||||||
|
# rmfile = False
|
||||||
|
|
||||||
|
# filename of the runfile
|
||||||
|
run_unPack = os.path.join(inputDir, 'run_unPackHJ2.txt')
|
||||||
|
|
||||||
|
|
||||||
|
# loop over the different folder, RSAT2 zip/tar files and unzip them, make the names consistent
|
||||||
|
RSAT2_extensions = (os.path.join(inputDir, 'HJ2*.zip'),os.path.join(inputDir, 'HJ2*.tar'),os.path.join(inputDir, 'HJ2*.gz'))
|
||||||
|
for RSAT2_extension in RSAT2_extensions:
|
||||||
|
RSAT2_filesfolders = glob.glob(RSAT2_extension)
|
||||||
|
for RSAT2_infilefolder in RSAT2_filesfolders:
|
||||||
|
## the path to the folder/zip
|
||||||
|
workdir = os.path.dirname(RSAT2_infilefolder)
|
||||||
|
|
||||||
|
## get the output name folder without any extensions
|
||||||
|
temp = os.path.basename(RSAT2_infilefolder)
|
||||||
|
# trim the extensions and keep only very first part
|
||||||
|
parts = temp.split(".tar.gz")
|
||||||
|
parts = parts[0].split('-')
|
||||||
|
RSAT2_outfolder = parts[0]
|
||||||
|
# add the path back in
|
||||||
|
RSAT2_outfolder = os.path.join(workdir,RSAT2_outfolder)
|
||||||
|
|
||||||
|
# loop over two cases (either file or folder):
|
||||||
|
### this is a file, try to unzip/untar it
|
||||||
|
if os.path.isfile(RSAT2_infilefolder):
|
||||||
|
# unzip the file in the outfolder
|
||||||
|
successflag_unzip = uncompressfile(RSAT2_infilefolder,RSAT2_outfolder)
|
||||||
|
|
||||||
|
# put failed files in a seperate directory
|
||||||
|
if not successflag_unzip:
|
||||||
|
os.makedirs(os.path.join(workdir,'FAILED_FILES'), exist_ok=True)
|
||||||
|
os.rename(RSAT2_infilefolder,os.path.join(workdir,'FAILED_FILES','.'))
|
||||||
|
else:
|
||||||
|
# check if file needs to be removed or put in archive folder
|
||||||
|
if rmfile:
|
||||||
|
os.remove(RSAT2_infilefolder)
|
||||||
|
# print('Deleting: ' + RSAT2_infilefolder)
|
||||||
|
else:
|
||||||
|
os.makedirs(os.path.join(workdir,'ARCHIVED_FILES'), exist_ok=True)
|
||||||
|
# cmd = 'mv ' + RSAT2_infilefolder + ' ' + os.path.join(workdir,'ARCHIVED_FILES','.')
|
||||||
|
# os.system(cmd)
|
||||||
|
shutil.move(RSAT2_infilefolder, os.path.join(workdir,'ARCHIVED_FILES','.'))
|
||||||
|
|
||||||
|
# loop over the different RSAT2 folders and make sure the folder names are consistent.
|
||||||
|
# this step is not needed unless the user has manually unzipped data before.
|
||||||
|
RSAT2_folders = glob.glob(os.path.join(inputDir, 'HJ2*'))
|
||||||
|
for RSAT2_folder in RSAT2_folders:
|
||||||
|
# in case the user has already unzipped some files, make sure they are unzipped similar like the uncompressfile code
|
||||||
|
temp = os.path.basename(RSAT2_folder)
|
||||||
|
parts = temp.split(".tar.gz")
|
||||||
|
parts = parts[0].split('-')
|
||||||
|
RSAT2_outfolder_temp = parts[0]
|
||||||
|
RSAT2_outfolder_temp = os.path.join(os.path.dirname(RSAT2_folder),RSAT2_outfolder_temp)
|
||||||
|
# check if the folder (RSAT2_folder) has a different filename as generated from the uncompressFile code (RSAT2_outfolder_temp)
|
||||||
|
if not (RSAT2_outfolder_temp == RSAT2_folder):
|
||||||
|
# it is different, check if the RSAT2_outfolder_temp already exists, if yes, delete the current folder
|
||||||
|
if os.path.isdir(RSAT2_outfolder_temp):
|
||||||
|
# print('Remove ' + RSAT2_folder + ' as ' + RSAT2_outfolder_temp + ' exists...')
|
||||||
|
# check if this folder already exist, if so overwrite it
|
||||||
|
shutil.rmtree(RSAT2_folder)
|
||||||
|
|
||||||
|
# loop over the different RSAT2 folders and organize in date folders
|
||||||
|
RSAT2_folders = glob.glob(os.path.join(inputDir, 'HJ2*'))
|
||||||
|
for RSAT2_folder in RSAT2_folders:
|
||||||
|
# get the date
|
||||||
|
successflag, imgDate = get_Date(RSAT2_folder)
|
||||||
|
|
||||||
|
workdir = os.path.dirname(RSAT2_folder)
|
||||||
|
if successflag:
|
||||||
|
# move the file into the date folder
|
||||||
|
SLC_dir = os.path.join(workdir,imgDate,'')
|
||||||
|
if os.path.isdir(SLC_dir):
|
||||||
|
shutil.rmtree(SLC_dir)
|
||||||
|
|
||||||
|
# cmd = 'mv ' + RSAT2_folder + ' ' + SLC_dir
|
||||||
|
# os.system(cmd)
|
||||||
|
print("move ",RSAT2_folder,"\tto\t",SLC_dir)
|
||||||
|
shutil.move(RSAT2_folder, SLC_dir)
|
||||||
|
print ('Succes: ' + imgDate)
|
||||||
|
else:
|
||||||
|
print('Failed: ' + RSAT2_folder)
|
||||||
|
|
||||||
|
|
||||||
|
# now generate the unpacking script for all the date dirs
|
||||||
|
dateDirs = glob.glob(os.path.join(inputDir,'2*'))
|
||||||
|
if outputDir is not None:
|
||||||
|
f = open(run_unPack,'w')
|
||||||
|
for dateDir in dateDirs:
|
||||||
|
RSAT2Files = glob.glob(os.path.join(dateDir, 'HJ2*.tiff'))
|
||||||
|
if len(RSAT2Files) <= 0:
|
||||||
|
RSAT2Files = glob.glob(os.path.join(dateDir, 'HJ2*.tif'))
|
||||||
|
if len(RSAT2Files)>0:
|
||||||
|
acquisitionDate = os.path.basename(dateDir)
|
||||||
|
slcDir = os.path.join(outputDir, acquisitionDate)
|
||||||
|
os.makedirs(slcDir, exist_ok=True)
|
||||||
|
cmd = 'unpackFrame_HJ2.py -i ' + os.path.abspath(dateDir) + ' -o ' + slcDir
|
||||||
|
result = os.system(cmd)
|
||||||
|
# f.write(inps.text_cmd + cmd+'\n')
|
||||||
|
print(cmd, result)
|
||||||
|
f.write(cmd+'\n')
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ def createParser():
|
||||||
parser.add_argument('-t', '--time_threshold', dest='dtThr', type=float, default=10000.0,
|
parser.add_argument('-t', '--time_threshold', dest='dtThr', type=float, default=10000.0,
|
||||||
help='Time threshold (max temporal baseline in days)')
|
help='Time threshold (max temporal baseline in days)')
|
||||||
|
|
||||||
parser.add_argument('-b', '--baseline_threshold', dest='dbThr', type=float, default=5000.0,
|
parser.add_argument('-b', '--baseline_threshold', dest='dbThr', type=float, default=50000.0,
|
||||||
help='Baseline threshold (max bperp in meters)')
|
help='Baseline threshold (max bperp in meters)')
|
||||||
|
|
||||||
parser.add_argument('-a', '--azimuth_looks', dest='alks', type=str, default='10',
|
parser.add_argument('-a', '--azimuth_looks', dest='alks', type=str, default='10',
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# import isce
|
||||||
|
from isce.components.isceobj.Sensor import createSensor
|
||||||
|
import shelve
|
||||||
|
import argparse
|
||||||
|
import glob
|
||||||
|
from isce.components.isceobj.Util import Poly1D
|
||||||
|
from isce.components.isceobj.Planet.AstronomicalHandbook import Const
|
||||||
|
from isce.components.isceobj.Util.decorators import use_api
|
||||||
|
import os
|
||||||
|
|
||||||
|
def cmdLineParse():
|
||||||
|
'''
|
||||||
|
Command line parser.
|
||||||
|
'''
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description='Unpack HJ2E SLC data and store metadata in pickle file.')
|
||||||
|
parser.add_argument('-i','--input', dest='RSATdir', type=str,
|
||||||
|
required=True, help='Input HJ2EF SLC directory')
|
||||||
|
parser.add_argument('-o', '--output', dest='slcdir', type=str,
|
||||||
|
required=True, help='Output unpacked SLC directory')
|
||||||
|
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@use_api
|
||||||
|
def unpack(RSATdir, slcname):
|
||||||
|
'''
|
||||||
|
Unpack HJ2E data to binary SLC file. assume HH only for now
|
||||||
|
'''
|
||||||
|
|
||||||
|
###Search for imagery and XML files in input directory
|
||||||
|
imgnames = glob.glob(os.path.join(RSATdir,'HJ2*.tiff'))
|
||||||
|
if len(imgnames) <= 0:
|
||||||
|
imgnames = glob.glob(os.path.join(RSATdir,'HJ2*.tif'))
|
||||||
|
imgname = imgnames[0]
|
||||||
|
xmlname = glob.glob(os.path.join(RSATdir, 'HJ2*.xml'))[0]
|
||||||
|
print("imgname ",imgname)
|
||||||
|
####Create output SLC directory if needed
|
||||||
|
if not os.path.isdir(slcname):
|
||||||
|
os.mkdir(slcname)
|
||||||
|
|
||||||
|
date = os.path.basename(slcname)
|
||||||
|
|
||||||
|
#####Create an HJ2E object and wire it
|
||||||
|
obj = createSensor('HJ2_SLC')
|
||||||
|
obj.configure()
|
||||||
|
obj.xml = xmlname
|
||||||
|
obj.tiff = imgname
|
||||||
|
obj.output = os.path.join(slcname, date+'.slc')
|
||||||
|
|
||||||
|
####Extract the image and write the XML file for the SLC
|
||||||
|
obj.extractImage()
|
||||||
|
obj.frame.getImage().renderHdr()
|
||||||
|
|
||||||
|
|
||||||
|
####Save the doppler polynomial
|
||||||
|
####CEOS already provides doppler polynomial
|
||||||
|
####as a function of range pixel
|
||||||
|
coeffs = obj.doppler_coeff
|
||||||
|
poly = Poly1D.Poly1D()
|
||||||
|
poly.initPoly(order=len(coeffs)-1)
|
||||||
|
poly.setCoeffs(coeffs)
|
||||||
|
|
||||||
|
|
||||||
|
####Save the FMrate polynomial
|
||||||
|
####CEOS already provides FMrate polynomial
|
||||||
|
####as a function of range pixel
|
||||||
|
fcoeffs = obj.azfmrate_coeff
|
||||||
|
# fcoeffs = [0.0, 0.0, 0.0] # zero-Doppler geometry, so this is not used
|
||||||
|
fpoly = Poly1D.Poly1D()
|
||||||
|
fpoly.initPoly(order=len(fcoeffs)-1)
|
||||||
|
fpoly.setCoeffs(fcoeffs)
|
||||||
|
|
||||||
|
|
||||||
|
####Save required metadata for further use
|
||||||
|
####All data is output to a shelve file
|
||||||
|
pickName = os.path.join(slcname, 'data')
|
||||||
|
with shelve.open(pickName) as db:
|
||||||
|
db['frame'] = obj.frame
|
||||||
|
db['doppler'] = poly
|
||||||
|
db['fmrate'] = fpoly
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
'''
|
||||||
|
Main driver.
|
||||||
|
'''
|
||||||
|
|
||||||
|
inps = cmdLineParse()
|
||||||
|
if inps.slcdir.endswith('/'):
|
||||||
|
inps.slcdir = inps.slcdir[:-1]
|
||||||
|
|
||||||
|
if inps.RSATdir.endswith('/'):
|
||||||
|
inps.RSATdir = inps.RSATdir[:-1]
|
||||||
|
|
||||||
|
unpack(inps.RSATdir, inps.slcdir)
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
|
||||||
|
2025/2/5 S-SAR DEM干涉适配
|
||||||
|
|
||||||
|
/mnt/d/WBJY/ISCE_INSAR/components
|
||||||
|
/mnt/d/WBJY/ISCE_INSAR/applications
|
||||||
|
/mnt/d/WBJY/ISCE_INSAR/contrib/stack/stripmapStack
|
||||||
|
export
|
||||||
|
|
||||||
|
step 1 解压文件
|
||||||
|
prepSlcSensors.py -i /mnt/f/ChenZenghui/SSARDEM/STRIP1 -o /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/slc
|
||||||
|
|
||||||
|
step 2 生成执行流程
|
||||||
|
|
||||||
|
stackStripMap.py
|
||||||
|
unpackFrame_HJ2.py -i /mnt/f/ChenZenghui/SSARDEM/STRIP1/20230601 -o /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/slc/20230601
|
||||||
|
unpackFrame_HJ2.py -i /mnt/f/ChenZenghui/SSARDEM/STRIP1/20230522 -o /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/slc/20230522
|
||||||
|
|
||||||
|
stackStripMap.py -s /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/slc/ -d /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/dem/demLat_N21_N33_Lon_E97_E103.dem.wgs84 -w /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace -m 20230522 -a 5 -r 10 -u snaphu --nofocus -W interferogram -x '26.76 27.75 99.87 100.3' -b 50000
|
||||||
|
|
||||||
|
|
||||||
|
stackStripMap.py -s /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/slc/ -d /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/preprocessed/dem/demLat_N21_N33_Lon_E97_E103.dem.wgs84 -w /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace -m 20230522 -a 5 -r 10 -u snaphu --nofocus -W interferogram -b 50000
|
||||||
|
|
||||||
|
S-SAR DEM 生产流程
|
||||||
|
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_01_reference
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_02_focus_split
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_03_geo2rdr_coarseResamp
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_04_refineSecondaryTiming -- 存在脚本生成问题
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_05_invertMisreg
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_06_fineResamp
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_07_denseOffset
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_08_invertDenseOffsets
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_09_resampleOffset
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_10_replaceOffsets
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_11_fineResamp
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_12_grid_baseline
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_13_igram
|
||||||
|
|
||||||
|
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_01_crop
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_02_reference
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_03_focus_split
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_04_geo2rdr_coarseResamp
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_05_refineSecondaryTiming
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_06_invertMisreg
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_07_fineResamp
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_08_denseOffset
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_09_invertDenseOffsets
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_10_resampleOffset
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_11_replaceOffsets
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_12_fineResamp
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_13_grid_baseline
|
||||||
|
writing /mnt/f/ChenZenghui/SSARDEM/work1/Dem/Temporary/processing/isce_workspace/run_files/run_14_igram
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2025.02.06 工作日志
|
||||||
|
1. S-SAR卫星DEM生产处理,正射组件不适用,需要排查问题
|
||||||
|
目前已经处理了 FPS的采样单位问题,确定baseline.py 文件没有修改,并且已经修改了相关的问题
|
||||||
|
正在进行第一次测试中
|
||||||
|
2.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue