simonsobs / sodetlib

Tools for performing core instrument testing, quality control, and analysis tasks.
BSD 2-Clause "Simplified" License
5 stars 0 forks source link

Add try/except to np.polyfit #380

Closed dpdutcher closed 1 year ago

dpdutcher commented 1 year ago

np.polyfit can fail for some complicated reasons, and it's better to skip a problematic channel than to fail the whole algorithm. I think a try/except here is the easiest solution.

I also don't know all the failure modes (TypeError, SystemError, etc.), so I left it as a generic except.

msilvafe commented 1 year ago

Should we leave this except in here even after Jack tracked down the cause and merged the fix?

jlashner commented 1 year ago

I think it's good to keep this, we really don't want the analysis function to fail out if we can avoid it, since then you lose the iva object. Its much easier to inspect bad channels and failures if the function finishes and returns the iva object