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_UAVSAR
LT1AB
Eric Fielding 2020-10-04 16:30:18 -07:00 committed by GitHub
parent ecf865af0b
commit 6aa2d065c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3 #!/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 # modified to work for different UAVSAR stack segments EJF 2019/05/04
import os import os
@ -78,7 +79,7 @@ def main(iargs=None):
imgDir = os.path.join(outputDir,imgDate) imgDir = os.path.join(outputDir,imgDate)
os.makedirs(imgDir, exist_ok=True) 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) print (cmd)
os.system(cmd) os.system(cmd)

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# modified to pass the segment number to UAVSAR_STACK sensor EJF 2020/08/02
import isce import isce
from isceobj.Sensor import createSensor from isceobj.Sensor import createSensor
@ -14,17 +15,19 @@ def cmdLineParse():
Command line parser. 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, 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, parser.add_argument('-d','--dop_file', dest='dopFile', type=str,
default=None, help='Doppler file') 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, parser.add_argument('-o', '--output', dest='slcdir', type=str,
required=True, help='Output SLC directory') required=True, help='Output SLC directory')
return parser.parse_args() 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. Unpack HDF5 to binary SLC file.
''' '''
@ -33,6 +36,7 @@ def unpack(hdf5, slcname, dopFile, parse=False):
obj.configure() obj.configure()
obj.metadataFile = hdf5 obj.metadataFile = hdf5
obj.dopplerFile = dopFile obj.dopplerFile = dopFile
obj.segment_index = stackSegment
obj.parse() obj.parse()
if not os.path.isdir(slcname): if not os.path.isdir(slcname):
@ -54,4 +58,4 @@ if __name__ == '__main__':
if inps.h5dir.endswith('/'): if inps.h5dir.endswith('/'):
inps.h5dir = inps.h5dir[:-1] inps.h5dir = inps.h5dir[:-1]
unpack(inps.h5dir, inps.slcdir, inps.dopFile) unpack(inps.h5dir, inps.slcdir, inps.dopFile, inps.stackSegment)