[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 6dc1fd4 2/2: Warp: warning is printed when ali
[gnuastro-commits] master 6dc1fd4 2/2: Warp: warning is printed when alignment is not correct
Thu, 28 May 2020 00:04:11 -0400 (EDT)
Author: Mohammad Akhlaghi <firstname.lastname@example.org>
Commit: Mohammad Akhlaghi <email@example.com>
Warp: warning is printed when alignment is not correct
Until now, when the North and East axis are not properly oriented
(left-hand orientation), Warp would simply fail to make the correct
rotation and wouldn't give any warning. It has been recognized as bug
With this commit, it prints a warning when such cases may occur. We still
haven't had time to fix it, but atleast the warning will tell the users how
to fix it.
Also, Warp now prints the name of its output file.
bin/warp/ui.c | 17 +++++++++++++++++
bin/warp/warp.c | 2 ++
2 files changed, 19 insertions(+)
diff --git a/bin/warp/ui.c b/bin/warp/ui.c
index 3f5d49d..f821f47 100644
@@ -483,6 +483,8 @@ ui_matrix_make_align(struct warpparams *p, double *tmatrix)
to find as 'X' and the final (aligned matrix) 'P' (which is the pixel
+ X W P
+ ------ ------ -------
x0 x1 w0 w1 -P0 0
x2 x3 * w2 w3 = 0 P1
@@ -541,6 +543,21 @@ ui_matrix_make_align(struct warpparams *p, double *tmatrix)
x = P / w / A;
x = -1 * x * w / w;
x = -1 * x * w / w;
+ /* When the input matrix is flipped, the diagonal elements of the
+ necessary rotation will have a different sign. */
+ error(0, 0, "%s (hdu %s): WARNING (bug #55217)! The alignment may "
+ "not be correct! This is a recognized bug, we just haven't "
+ "had enough time to fix it yet, any help or support is "
+ "most welcome.\n\n"
+ "This may be due to the East and North not being left-hand "
+ "oriented. If this is the case, you can fix it by flipping "
+ "the image along the problematic axis (with '--flip=1,0' or "
+ "'--flip=0,1') and re-running Warp with '--align'. Note "
+ "that you can't yet call '--flip' in the same command as "
+ "'--align'", p->inputname, p->cp.hdu);
/* For a check:
diff --git a/bin/warp/warp.c b/bin/warp/warp.c
index 285027c..b67629d 100644
@@ -581,6 +581,8 @@ warp(struct warpparams *p)
/* Save the output. */
+ printf(" Output: %s\n", p->cp.output);
/* Free the allocated spaces: */