[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 7babeb6: Library (wcs.h): added step to help i
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 7babeb6: Library (wcs.h): added step to help in debugging errors |
Date: |
Sat, 10 Jul 2021 21:21:07 -0400 (EDT) |
branch: master
commit 7babeb601d8a4a19edaea05d06a80f0939549e56
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Library (wcs.h): added step to help in debugging errors
Until now, when a WCSLIB error came up the only hint of the cause was the
finally printed WCSLIB error message.
With this commit, a commented line has been added to the WCS library so if
necessary, we can activate more detailed error messages (tracking the error
string to the first function that caused it). By default it is commented to
avoid slowing down the process, but when something is not clear, we can
just uncomment it.
---
lib/wcs.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/lib/wcs.c b/lib/wcs.c
index 72b7324..b29db3d 100644
--- a/lib/wcs.c
+++ b/lib/wcs.c
@@ -33,6 +33,7 @@ along with Gnuastro. If not, see
<http://www.gnu.org/licenses/>.
#include <gsl/gsl_linalg.h>
#include <wcslib/wcsmath.h>
+#include <wcslib/wcsprintf.h>
#include <gnuastro/wcs.h>
#include <gnuastro/tile.h>
@@ -326,6 +327,15 @@ gal_wcs_read_fitsptr(fitsfile *fptr, int linearmatrix,
size_t hstartwcs,
__func__, fixstatus[CYLFIX]);
}
+ /* Enable wcserr if necessary (can help in debugging situations
+ when the default error message isn't enough). If you confront
+ an error, un-comment the two lines below and put
+ 'wcsperr(wcs,NULL);' after the problematic WCSLIB
+ command. This will print a trace-back of the cause.
+ wcserr_enable(1);
+ wcsprintf_set(stderr);
+ */
+
/* Set the WCS structure. */
status=wcsset(wcs);
if(status)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master 7babeb6: Library (wcs.h): added step to help in debugging errors,
Mohammad Akhlaghi <=