From 2693141018259f1e3fc4defd6bbd5746b2627aa8 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 6 Sep 2021 19:08:50 +0800 Subject: [PATCH] try except to catch bad lmfit params setup --- AegeanTools/source_finder.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/AegeanTools/source_finder.py b/AegeanTools/source_finder.py index 962fc2ae..6958d909 100755 --- a/AegeanTools/source_finder.py +++ b/AegeanTools/source_finder.py @@ -2109,16 +2109,21 @@ def _fit_island(self, island_data): self.log.debug("=====") self.log.debug("Island ({0})".format(isle_num)) - params = self.estimate_lmfit_parinfo( - idata, - rms, - icurve, - beam, - innerclip, - outerclip, - offsets=[xmin, ymin], - max_summits=max_summits, - ) + try: + params = self.estimate_lmfit_parinfo( + idata, + rms, + icurve, + beam, + innerclip, + outerclip, + offsets=[xmin, ymin], + max_summits=max_summits, + ) + except: + self.log.debug("Estimaste lfit params failed, setting to None") + params = None + # params = estimate_parinfo_image() # islands at the edge of a region of nans # result in no components