diff options
author | Aaron LI <aly@aaronly.me> | 2018-12-08 21:38:41 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-12-08 21:38:41 +0800 |
commit | d79e35072207450de8e49fe0e75d21fa3be37c93 (patch) | |
tree | e2d2f060a9ecef3cab11d2b346a013a0db0a751c /astro | |
parent | 31bae857a36eb7296397fb9452aea071cfc68188 (diff) | |
download | atoolbox-d79e35072207450de8e49fe0e75d21fa3be37c93.tar.bz2 |
astro/fitscube.py: Warn but not assert unit mismatch
Diffstat (limited to 'astro')
-rwxr-xr-x | astro/fitscube.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |