Skip to content

Commit

Permalink
Reduce verbosity of check_wlcalb_sp function.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicocardiel committed Nov 13, 2017
1 parent feb5ecb commit d956f25
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions numina/array/wavecalib/check_wlcalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def check_wlcalib_sp(sp, crpix1, crval1, cdelt1, wv_master,
deg=poldeg_effective,
times_sigma_reject=times_sigma_reject,
use_r=use_r,
debugplot=10
debugplot=0
)
nlines_ok = len(lines_ok[0])
else:
Expand All @@ -279,21 +279,26 @@ def check_wlcalib_sp(sp, crpix1, crval1, cdelt1, wv_master,
poldeg_effective = 0
ysummary = summary(np.array([]))

print('-' * 79)
list_wv_found = [str(round(wv, 4))
for wv in wv_verified_all_peaks if wv != 0]
list_wv_master = [str(round(wv, 4)) for wv in wv_master]
set1 = set(list_wv_master)
set2 = set(list_wv_found)
missing_wv = list(set1.symmetric_difference(set2))
missing_wv.sort()
print(">>> Unmatched lines...................:", missing_wv)
print(">>> Number of arc lines in master file:", len(wv_master))
print(">>> Number of line peaks found........:", npeaks)
print(">>> Number of identified lines........:", nlines_ok)
print(">>> Number of unmatched lines.........:", len(missing_wv))
print(">>> Polynomial degree in residuals fit:", poldeg_effective)
print(">>> Polynomial fit to residuals.......:", polyres)
if abs(debugplot) >= 10:
print('-' * 79)
print(">>> Number of arc lines in master file:", len(wv_master))
if abs(debugplot) in [21, 22]:
print(">>> Unmatched lines...................:", missing_wv)
elif abs(debugplot) >= 10:
print(">>> Number of unmatched lines.........:", len(missing_wv))
if abs(debugplot) >= 10:
print(">>> Number of line peaks found........:", npeaks)
print(">>> Number of identified lines........:", nlines_ok)
print(">>> Number of unmatched lines.........:", len(missing_wv))
print(">>> Polynomial degree in residuals fit:", poldeg_effective)
print(">>> Polynomial fit to residuals.......:", polyres)

# display results
if abs(debugplot) % 10 != 0:
Expand Down

0 comments on commit d956f25

Please sign in to comment.