From ee2fab75856ff79e198fb07e6d2b302fea5d0458 Mon Sep 17 00:00:00 2001 From: Coda Phillips <cphillips@sean.ssec.wisc.edu> Date: Tue, 12 Jul 2016 14:37:17 -0500 Subject: [PATCH] refactor mirror safing code --- scene_checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene_checks.py b/scene_checks.py index d1d6971..828ef71 100644 --- a/scene_checks.py +++ b/scene_checks.py @@ -24,7 +24,7 @@ def safing_check(frame, parameters): if not np.in1d(['hatchOpen','sceneMirrorPosition'], frame.columns).all(): return frame - hatch_closing = ((frame.hatchOpen == 1) & ((frame.hatchOpen == -3).diff(-1) == 1)).shift(1) + hatch_closing = (frame.hatchOpen == 1).shift(1) & (frame.hatchOpen == -3) mirror_safing = (hatch_closing & frame.sceneMirrorPosition.isin([ord('H'), ord('A')])) frame['safing_check'] = mirror_safing * 1 annotate_all(frame, mirror_safing, 'mirror likely safed during view') -- GitLab