modified prepareUAVSAR_coregStack to support segment of stack

LT1AB
Eric Jameson Fielding 2019-05-05 23:31:27 -07:00
parent dcc642a3c5
commit 58f5044b92
2 changed files with 9 additions and 9 deletions

View File

@ -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":

View File

@ -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):