gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master bd52be3: MakeCatalog: corrected metadata of fr


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master bd52be3: MakeCatalog: corrected metadata of fractional maximum values
Date: Mon, 9 Nov 2020 15:42:45 -0500 (EST)

branch: master
commit bd52be32d1a7d2b79a0949bd3809cdd6359255a2
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    MakeCatalog: corrected metadata of fractional maximum values
    
    Until now, the metadata of the 'FRAC_MAX_SUM_1' and 'FRAC_MAX_SUM_2'
    columns was wrong in both the numerical data type of the column (it was
    mistakenly written as an integer), and the column comment didn't contain
    the number of fraction.
    
    With this commit, the numeric data type is now 32-bit floating point and
    the description is also customized for the number of the fraction.
    
    This issue was reported by Joanna Sakowska.
---
 bin/mkcatalog/columns.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/bin/mkcatalog/columns.c b/bin/mkcatalog/columns.c
index 46437af..3024f35 100644
--- a/bin/mkcatalog/columns.c
+++ b/bin/mkcatalog/columns.c
@@ -1793,20 +1793,25 @@ columns_define_alloc(struct mkcatalogparams *p)
           name           = ( colcode->v==UI_KEY_FRACMAXSUM1
                              ? "FRAC_MAX_SUM_1"
                              : "FRAC_MAX_SUM_2" );
-          unit           = "counter";
-          ocomment       = "Sum of pixels brighter than given fraction of 
maximum value.";
+          unit           = MKCATALOG_NO_UNIT;
           ccomment       = ocomment;
-          otype          = GAL_TYPE_INT32;
-          ctype          = GAL_TYPE_INT32;
+          otype          = GAL_TYPE_FLOAT32;
+          ctype          = GAL_TYPE_FLOAT32;
           disp_fmt       = 0;
           disp_width     = 6;
           disp_precision = 0;
           oiflag[ OCOL_NUM ] = ciflag[ CCOL_NUM ] = 1;
           oiflag[ OCOL_SUM ] = ciflag[ CCOL_SUM ] = 1;
           if(colcode->v==UI_KEY_FRACMAXSUM1)
-            oiflag[ OCOL_FRACMAX1SUM ] = ciflag[ CCOL_FRACMAX1SUM ] = 1;
+            {
+              ocomment = "Sum of pixels brighter than 1st fraction of 
maximum.";
+              oiflag[ OCOL_FRACMAX1SUM ] = ciflag[ CCOL_FRACMAX1SUM ] = 1;
+            }
           else
-            oiflag[ OCOL_FRACMAX2SUM ] = ciflag[ CCOL_FRACMAX2SUM ] = 1;
+            {
+              ocomment = "Sum of pixels brighter than 2nd fraction of 
maximum.";
+              oiflag[ OCOL_FRACMAX2SUM ] = ciflag[ CCOL_FRACMAX2SUM ] = 1;
+            }
           break;
 
         case UI_KEY_FRACMAXAREA1:
@@ -2618,11 +2623,11 @@ columns_fill(struct mkcatalog_passparams *pp)
           break;
 
         case UI_KEY_FRACMAXSUM1:
-          ((int32_t *)colarr)[oind] = oi[OCOL_FRACMAX1SUM];
+          ((float *)colarr)[oind] = oi[OCOL_FRACMAX1SUM];
           break;
 
         case UI_KEY_FRACMAXSUM2:
-          ((int32_t *)colarr)[oind] = oi[OCOL_FRACMAX2SUM];
+          ((float *)colarr)[oind] = oi[OCOL_FRACMAX2SUM];
           break;
 
         case UI_KEY_FRACMAXAREA1:



reply via email to

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