[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master aad6317a: Library (txt.c): better error messag

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master aad6317a: Library (txt.c): better error message when _:_:_ can't be parsed
Date: Thu, 7 Jul 2022 19:09:50 -0400 (EDT)

branch: master
commit aad6317a8d31129f2ca904a7ba0fc6fcac6829ab
Author: Mohammad Akhlaghi <>
Commit: Mohammad Akhlaghi <>

    Library (txt.c): better error message when _:_:_ can't be parsed
    Until now, the error message that was printed when a celestial coordinate
    in the format of '_:_:_' was input wasn't clear: it didn't clarify that it
    is important to have metadata to have a string column.
    With this commit, the last part of the error message has been extended to
    make it clear that metadata is necessary for the 'ra-to-degree' or
    'dec-to-degree' operators (and that it is easier to simply use the
    unambiguous '_h_m_' and '_d_m_' formats).
    This was suggested by Manuel Sánchez-Benavente.
 lib/txt.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/txt.c b/lib/txt.c
index 6491c42a..c8ac34c6 100644
--- a/lib/txt.c
+++ b/lib/txt.c
@@ -899,14 +899,22 @@ txt_read_token(gal_data_t *data, gal_data_t *info, char 
             error_at_line(EXIT_FAILURE, 0, filename, lineno, "column %zu "
                           "('%s') couldn't be read as a '%s' number.\n\n"
                           "If it was meant to be celestial coordinates (RA "
-                          "or Dec), please use the '_h_m_s' format for RA "
-                          "or '_d_m_s' for Dec. The '_:_:_' format is "
+                          "or Dec), please use the '_h_m_' format for RA "
+                          "or '_d_m_' for Dec. The '_:_:_' format is "
                           "ambiguous (can be used for both RA and Dec). "
                           "Alternatively, you can use the column arithmetic "
                           "operators 'ra-to-degree' or 'dec-to-degree' of "
                           "'asttable' which also accept the '_:_:_' "
-                          "format. For more, please run this command\n\n"
-                          "   $ info gnuastro \"column arithmetic\"",
+                          "format. However, the 'ra-to-degree' or "
+                          "'dec-to-degree' operators require the column "
+                          "to be identified as a string with metadata. "
+                          "Please run the command below to learn more "
+                          "about column metadata and columns with string "
+                          "contents (it is easier to just use the '_h_m_' "
+                          "or '_d_m_' formats which will be automatically "
+                          "converted to degrees without any operators or "
+                          "metadata):\n\n"
+                          "   $ info gnuastro \"Gnuastro text table format\"",
                           colnum, token,
                           gal_type_name(data->type, 1) );

reply via email to

[Prev in Thread] Current Thread [Next in Thread]