From 6aa2d065c3a1fca95e10fdbd33bf4e19f06a28b6 Mon Sep 17 00:00:00 2001 From: Eric Fielding Date: Sun, 4 Oct 2020 16:30:18 -0700 Subject: [PATCH] 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 --- .../stack/stripmapStack/prepareUAVSAR_coregStack.py | 3 ++- contrib/stack/stripmapStack/unpackFrame_UAVSAR.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py b/contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py index 5c952d5..84935ec 100755 --- a/contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py +++ b/contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py @@ -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) diff --git a/contrib/stack/stripmapStack/unpackFrame_UAVSAR.py b/contrib/stack/stripmapStack/unpackFrame_UAVSAR.py index 18f6ae0..833fbef 100755 --- a/contrib/stack/stripmapStack/unpackFrame_UAVSAR.py +++ b/contrib/stack/stripmapStack/unpackFrame_UAVSAR.py @@ -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)