Speed up spectral fit; take into account that in seldom cases not all

pick information in pick dictionary are available.
This commit is contained in:
2020-07-30 10:37:39 +02:00
parent f49b9054b0
commit 6d81e4a132
2 changed files with 31 additions and 5 deletions

View File

@@ -751,13 +751,16 @@ def fitSourceModel(f, S, fc0, iplot, verbosity=False):
# check difference of il and ir in order to
# keep calculation time acceptable
idiff = ir - il
if idiff > 10000:
print(idiff)
if idiff > 100000:
increment = 1000
elif idiff <= 100000 and idiff > 10000:
increment = 100
elif idiff <= 20:
increment = 1
else:
increment = 10
print(increment)
for i in range(il, ir, increment):
FC = f[i]
indexdc = np.where((f > 0) & (f <= FC))