Add Sentinel-1 asset management and PyINT pipeline support
This commit is contained in:
+25
-4
@@ -32,9 +32,27 @@ def work(data0):
|
||||
stderr = p.stderr
|
||||
|
||||
if type(stderr) == bytes:
|
||||
aa=stderr.decode("utf-8")
|
||||
aa=stderr.decode("utf-8", errors="replace")
|
||||
else:
|
||||
aa = stderr
|
||||
if type(stdout) == bytes:
|
||||
bb=stdout.decode("utf-8", errors="replace")
|
||||
else:
|
||||
bb = stdout
|
||||
if p.returncode != 0:
|
||||
detail_parts = []
|
||||
if bb:
|
||||
detail_parts.append(bb)
|
||||
if aa:
|
||||
detail_parts.append(aa)
|
||||
detail = '\n'.join(part.strip() for part in detail_parts if part and part.strip())
|
||||
str0 = cmd[0] + ' ' + cmd[1] + ' ' + cmd[2] + '\n'
|
||||
with open(err_txt, 'a') as f:
|
||||
f.write(str0)
|
||||
if detail:
|
||||
f.write(detail)
|
||||
f.write('\n')
|
||||
raise RuntimeError(str0.strip() + ' failed with rc=' + str(p.returncode) + ('\n' + detail if detail else ''))
|
||||
|
||||
if aa:
|
||||
str0 = cmd[0] + ' ' + cmd[1] + ' ' + cmd[2] + '\n'
|
||||
@@ -83,7 +101,7 @@ def main(argv):
|
||||
projectDir = scratchDir + '/' + projectName
|
||||
downDir = scratchDir + '/' + projectName + "/DOWNLOAD"
|
||||
slcDir = scratchDir + '/' + projectName + "/SLC"
|
||||
raw_file_list = glob.glob(downDir + '/S1*.zip')
|
||||
raw_file_list = glob.glob(downDir + '/S1*.zip') + glob.glob(downDir + '/S1*.SAFE')
|
||||
templateDir = os.getenv('TEMPLATEDIR')
|
||||
templateFile = templateDir + "/" + projectName + ".template"
|
||||
templateDict=ut.update_template(templateFile)
|
||||
@@ -139,12 +157,15 @@ def main(argv):
|
||||
k00 = 0
|
||||
if k00==0:
|
||||
data_para.append(data0)
|
||||
ut.parallel_process(data_para, work, n_jobs=inps.parallelNumb, use_kwargs=False)
|
||||
results = ut.parallel_process(data_para, work, n_jobs=inps.parallelNumb, use_kwargs=False)
|
||||
failures = [str(item) for item in results if isinstance(item, Exception)]
|
||||
if failures:
|
||||
raise RuntimeError('\n\n'.join(failures))
|
||||
os.chdir(downDir)
|
||||
print("Down to SLC for project %s is done! " % projectName)
|
||||
ut.print_process_time(start_time, time.time())
|
||||
|
||||
sys.exit(1)
|
||||
sys.exit(0)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[:])
|
||||
|
||||
Reference in New Issue
Block a user