From d79e35072207450de8e49fe0e75d21fa3be37c93 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 8 Dec 2018 21:38:41 +0800 Subject: astro/fitscube.py: Warn but not assert unit mismatch --- astro/fitscube.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/astro/fitscube.py b/astro/fitscube.py index 404425d..5a1d3c3 100755 --- a/astro/fitscube.py +++ b/astro/fitscube.py @@ -357,7 +357,12 @@ def cmd_add(args): for f in args.infiles[1:]: cube2 = FITSCube(f) - assert (cube.unit, cube.zunit) == (cube2.unit, cube2.zunit) + if cube.unit != cube2.unit: + print("WARNING: data unit mismatch: %s <-> %s" % + (cube.unit, cube2.unit)) + if cube.zunit != cube2.zunit: + print("WARNING: Z-axis unit mismatch: %s <-> %s" % + (cube.zunit, cube2.zunit)) print("Adding cube %s ..." % f) cube.data = cube.data + cube2.data -- cgit v1.2.2