Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stackSentinel background task fix #271

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
23 changes: 13 additions & 10 deletions contrib/stack/topsStack/Stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def denseOffset(self, function):
#self.f.write('ww : 256\n')
#self.f.write('wh : 128\n')

def write_wrapper_config2run_file(self, configName, line_cnt, numProcess = 1):
def write_wrapper_config2run_file(self, configName, line_cnt, last_line = False, numProcess = 1):
# dispassionate list of commands for single process
if numProcess == 1:
self.runf.write(self.text_cmd + 'SentinelWrapper.py -c ' + configName + '\n')
Expand All @@ -270,6 +270,9 @@ def write_wrapper_config2run_file(self, configName, line_cnt, numProcess = 1):
if line_cnt == numProcess:
self.runf.write('wait\n\n')
line_cnt = 0
hardreddata marked this conversation as resolved.
Show resolved Hide resolved
# last line of file, wait for any background processes to complete
if last_line:
self.runf.write('wait\n')
hardreddata marked this conversation as resolved.
Show resolved Hide resolved
return line_cnt

def finalize(self):
Expand Down Expand Up @@ -358,7 +361,7 @@ def unpackSecondarysSLC(self, stackReferenceDate, secondaryList, safe_dict):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, secondary == secondaryList[-1], self.numProcess)
hardreddata marked this conversation as resolved.
Show resolved Hide resolved
del configObj

def averageBaseline(self, stackReferenceDate, secondaryList):
Expand All @@ -375,7 +378,7 @@ def averageBaseline(self, stackReferenceDate, secondaryList):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, secondary == secondaryList[-1], self.numProcess)
del configObj

def gridBaseline(self, stackReferenceDate, secondaryList):
Expand Down Expand Up @@ -440,7 +443,7 @@ def geo2rdr_offset(self, secondaryList, fullBurst='False'):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, secondary == secondaryList[-1], self.numProcess)
del configObj

def resample_with_carrier(self, secondaryList, fullBurst='False'):
Expand Down Expand Up @@ -470,7 +473,7 @@ def resample_with_carrier(self, secondaryList, fullBurst='False'):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, secondary == secondaryList[-1], self.numProcess)
del configObj


Expand Down Expand Up @@ -521,7 +524,7 @@ def pairs_misregistration(self, dateList, safe_dict):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, pair == pairs[-1], self.numProcess)
del configObj
########################

Expand Down Expand Up @@ -560,7 +563,7 @@ def generate_burstIgram(self, dateList, safe_dict, pairs):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, pair == pairs[-1], self.numProcess)
del configObj


Expand Down Expand Up @@ -594,7 +597,7 @@ def igram_mergeBurst(self, dateList, safe_dict, pairs):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, pair == pairs[-1], self.numProcess)
del configObj

def mergeSecondarySLC(self, secondaryList, virtual='True'):
Expand Down Expand Up @@ -746,7 +749,7 @@ def filter_coherence(self, pairs):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, pair == pairs[-1], self.numProcess)
del configObj


Expand All @@ -772,7 +775,7 @@ def unwrap(self, pairs):
configObj.finalize()

line_cnt += 1
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, self.numProcess)
line_cnt = configObj.write_wrapper_config2run_file(configName, line_cnt, pair == pairs[-1], self.numProcess)
del configObj

def denseOffsets(self, pairs):
Expand Down