added option to pass segment number through unpackFrame_UAVSAR (#171)
* added option to pass segment number through unpackFrame_UAVSAR * changed type of segment number * changed segment type in prepareUAVSAR_coregstack * Revert "changed type of segment number" This reverts commit a18c6452d4b5c95ce869dab2ee1e3bcf6ff2b1d9. * Revert "changed segment type in prepareUAVSAR_coregstack" This reverts commit 6cf3ebadb3a6e119c6084c8e03b8cc68d7eccc3f. * changed type of segment number in unpackFrame_UAVSARLT1AB
parent
ecf865af0b
commit
6aa2d065c3
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# modified to pass the segment number to unpackFrame_UAVSAR EJF 2020/08/02
|
||||
# modified to work for different UAVSAR stack segments EJF 2019/05/04
|
||||
|
||||
import os
|
||||
|
@ -78,7 +79,7 @@ def main(iargs=None):
|
|||
imgDir = os.path.join(outputDir,imgDate)
|
||||
os.makedirs(imgDir, exist_ok=True)
|
||||
|
||||
cmd = 'unpackFrame_UAVSAR.py -i ' + annFile + ' -d '+ inps.dopFile + ' -o ' + imgDir
|
||||
cmd = 'unpackFrame_UAVSAR.py -i ' + annFile + ' -d '+ inps.dopFile + ' -s '+ inps.segment + ' -o ' + imgDir
|
||||
print (cmd)
|
||||
os.system(cmd)
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
# modified to pass the segment number to UAVSAR_STACK sensor EJF 2020/08/02
|
||||
|
||||
import isce
|
||||
from isceobj.Sensor import createSensor
|
||||
|
@ -14,17 +15,19 @@ def cmdLineParse():
|
|||
Command line parser.
|
||||
'''
|
||||
|
||||
parser = argparse.ArgumentParser(description='Unpack CSK SLC data and store metadata in pickle file.')
|
||||
parser = argparse.ArgumentParser(description='Unpack UAVSAR SLC data and store metadata in pickle file.')
|
||||
parser.add_argument('-i','--input', dest='h5dir', type=str,
|
||||
required=True, help='Input CSK directory')
|
||||
required=True, help='Input UAVSAR directory')
|
||||
parser.add_argument('-d','--dop_file', dest='dopFile', type=str,
|
||||
default=None, help='Doppler file')
|
||||
parser.add_argument('-s','--segment', dest='stackSegment', type=int,
|
||||
default=1, help='stack segment')
|
||||
parser.add_argument('-o', '--output', dest='slcdir', type=str,
|
||||
required=True, help='Output SLC directory')
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def unpack(hdf5, slcname, dopFile, parse=False):
|
||||
def unpack(hdf5, slcname, dopFile, stackSegment, parse=False):
|
||||
'''
|
||||
Unpack HDF5 to binary SLC file.
|
||||
'''
|
||||
|
@ -33,6 +36,7 @@ def unpack(hdf5, slcname, dopFile, parse=False):
|
|||
obj.configure()
|
||||
obj.metadataFile = hdf5
|
||||
obj.dopplerFile = dopFile
|
||||
obj.segment_index = stackSegment
|
||||
obj.parse()
|
||||
|
||||
if not os.path.isdir(slcname):
|
||||
|
@ -54,4 +58,4 @@ if __name__ == '__main__':
|
|||
if inps.h5dir.endswith('/'):
|
||||
inps.h5dir = inps.h5dir[:-1]
|
||||
|
||||
unpack(inps.h5dir, inps.slcdir, inps.dopFile)
|
||||
unpack(inps.h5dir, inps.slcdir, inps.dopFile, inps.stackSegment)
|
||||
|
|
Loading…
Reference in New Issue