gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 175354f 095/113: All MakeCatalog spectrums set


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 175354f 095/113: All MakeCatalog spectrums set to NaN when no measurement was done
Date: Fri, 16 Apr 2021 10:33:58 -0400 (EDT)

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

    All MakeCatalog spectrums set to NaN when no measurement was done
    
    Because zero is meaningful, recently, in the projected measurements, we set
    the slices were there was no measurement to NaN. But the same argument also
    applies to the `SUM', `SUM_ERR', `SUM_OTHER', and `SUM_OTHER_ERROR'
    columns. So in this commit, when there are no labeled voxels in a slice, it
    is set to NaN in all its spectra.
---
 bin/mkcatalog/parse.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/mkcatalog/parse.c b/bin/mkcatalog/parse.c
index d9adaff..6a7ad46 100644
--- a/bin/mkcatalog/parse.c
+++ b/bin/mkcatalog/parse.c
@@ -404,7 +404,11 @@ parse_spectrum(struct mkcatalog_passparams *pp, gal_data_t 
*xybin)
          index `pind' if we have just finished parsing a slice. */
       if( (num_increment-1)%pp->tile->dsize[1]==0 )
         {
-          if(nproj==0) parr[sind]=pearr[sind]=NAN;
+          /* If there was no measurement, set NaN for the values and their
+             errors (zero is meaningful). */
+          if( nproj      ==0 ) parr[sind]  = pearr[sind]  = NAN;
+          if( narr[sind] ==0 ) sarr[sind]  = searr[sind]  = NAN;
+          if( oarr[sind] ==0 ) osarr[sind] = osearr[sind] = NAN;
 
           nproj=pind=0;
           ++sind;



reply via email to

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