From 58f5044b92374a0cd471dd4e09908d3499f7421f Mon Sep 17 00:00:00 2001 From: Eric Jameson Fielding Date: Sun, 5 May 2019 23:31:27 -0700 Subject: [PATCH] modified prepareUAVSAR_coregStack to support segment of stack --- contrib/stack/README_stripmapStack.txt | 2 +- .../stripmapStack/prepareUAVSAR_coregStack.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/stack/README_stripmapStack.txt b/contrib/stack/README_stripmapStack.txt index e6ae915..fd6c377 100644 --- a/contrib/stack/README_stripmapStack.txt +++ b/contrib/stack/README_stripmapStack.txt @@ -31,7 +31,7 @@ fixImageXml.py -f -i demLat_S37_S31_Lon_W072_W069.dem.wgs84 mkdir download cd download -6- Download the data that that you want to process to the downlowd directory. +6- Download the data that that you want to process to the download directory. 7- once all data have been downloaded, we need to unzip them and move them to different folders and getting ready for unpacking and then SLC generation. This can be done by running the following command in a directory above "download": diff --git a/contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py b/contrib/stack/stripmapStack/prepareUAVSAR_coregStack.py index 1c175b3..91571b8 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 work for different UAVSAR stack segments EJF 2019/05/04 import os import glob @@ -14,15 +15,15 @@ def createParser(): Create command line parser. ''' - parser = argparse.ArgumentParser(description='Unzip Alos zip files.') + parser = argparse.ArgumentParser(description='Prepare UAVSAR SLC Stack files.') parser.add_argument('-i', '--input', dest='input', type=str, required=True, - help='directory which has all dates as directories. Inside each date, zip files are expected.') + help='directory which has all dates.') parser.add_argument('-d', '--dop_file', dest='dopFile', type=str, required=True, - help='Doppler file for the stack.') + help='Doppler file for the stack. Needs to be in directory where command is run.') parser.add_argument('-o', '--output', dest='output', type=str, required=True, help='output directory which will be used for unpacking.') - 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. Example : source ~/.bash_profile;') + parser.add_argument('-s', '--segment', dest='segment', type=str, default='1', + help='segment of the UAVSAR stack to prepare. For "s2" use "2", etc. Default is "1" ') return parser @@ -64,14 +65,13 @@ def main(iargs=None): inps = cmdLineParse(iargs) outputDir = os.path.abspath(inps.output) - run_unPack = 'run_unPackAlos' ####################################### - slc_files = glob.glob(os.path.join(inps.input, '*_s5_1x1.slc')) + slc_files = glob.glob(os.path.join(inps.input, '*_s'+segment+'_1x1.slc')) for file in slc_files: imgDate = get_Date(file) print (imgDate) - annFile = file.replace('_s5_1x1.slc','')+'.ann' + annFile = file.replace('_s'+segment+'_1x1.slc','')+'.ann' print (annFile) imgDir = os.path.join(outputDir,imgDate) if not os.path.exists(imgDir):