gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master c91d988 063/113: Recent work in master merged,


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master c91d988 063/113: Recent work in master merged, conflicts corrected
Date: Fri, 16 Apr 2021 10:33:47 -0400 (EDT)

branch: master
commit c91d9883ae9237b477b8e4e78f209a8c3747ade6
Merge: 1af4ea9 bdcc13d
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Recent work in master merged, conflicts corrected
    
    Some conflicts came up during the merge and have been fixed.
---
 bin/segment/astsegment-3d.conf |  2 +-
 bin/segment/astsegment.conf    |  2 +-
 bin/segment/clumps.c           | 44 +++++++++++++++++++++++-------------------
 3 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/bin/segment/astsegment-3d.conf b/bin/segment/astsegment-3d.conf
index 2dcaed3..4c94999 100644
--- a/bin/segment/astsegment-3d.conf
+++ b/bin/segment/astsegment-3d.conf
@@ -23,7 +23,7 @@
  dhdu         DETECTIONS
  skyhdu              SKY
  stdhdu          SKY_STD
- minskyfrac          0.7
+ minskyfrac          0.6
  minnumfalse         100
 
 # Tessellation
diff --git a/bin/segment/astsegment.conf b/bin/segment/astsegment.conf
index e5a3b7f..dbbc038 100644
--- a/bin/segment/astsegment.conf
+++ b/bin/segment/astsegment.conf
@@ -23,7 +23,7 @@
  dhdu         DETECTIONS
  skyhdu              SKY
  stdhdu          SKY_STD
- minskyfrac          0.7
+ minskyfrac          0.6
  minnumfalse         100
 
 # Tessellation
diff --git a/bin/segment/clumps.c b/bin/segment/clumps.c
index 05628d8..5877f88 100644
--- a/bin/segment/clumps.c
+++ b/bin/segment/clumps.c
@@ -250,7 +250,7 @@ clumps_get_raw_info(struct clumps_thread_params *cltprm)
   double *row, *info=cltprm->info->array;
   size_t nngb=gal_dimension_num_neighbors(ndim);
   struct gal_tile_two_layer_params *tl=&p->cp.tl;
-  float *arr=p->input->array, *std=p->std->array;
+  float *values=p->input->array, *std=p->std->array;
   size_t *dinc=gal_dimension_increment(ndim, dsize);
   int32_t lab, nlab, *ngblabs, *clabel=p->clabel->array;
 
@@ -260,22 +260,22 @@ clumps_get_raw_info(struct clumps_thread_params *cltprm)
   /* Go over all the pixels in this region. */
   af=(a=cltprm->indexs->array)+cltprm->indexs->size;
   do
-    if( !isnan(arr[ *a ]) )
+    if( !isnan(values[ *a ]) )
       {
         /* This pixel belongs to a clump. */
         if( clabel[ *a ]>0 )
           {
             lab=clabel[*a];
             ++info[ lab * INFO_NCOLS + INFO_INAREA ];
-            info[   lab * INFO_NCOLS + INFO_INFLUX ] += arr[*a];
-            if( arr[*a]>0.0f )
+            info[   lab * INFO_NCOLS + INFO_INFLUX ] += values[*a];
+            if( values[*a]>0.0f )
               {
                 gal_dimension_index_to_coord(*a, ndim, dsize, coord);
-                info[ lab * INFO_NCOLS + INFO_SFF ] += arr[*a];
-                info[ lab * INFO_NCOLS + INFO_X   ] += arr[*a] * coord[0];
-                info[ lab * INFO_NCOLS + INFO_Y   ] += arr[*a] * coord[1];
+                info[ lab * INFO_NCOLS + INFO_SFF ] += values[*a];
+                info[ lab * INFO_NCOLS + INFO_X   ] += values[*a] * coord[0];
+                info[ lab * INFO_NCOLS + INFO_Y   ] += values[*a] * coord[1];
                 if(ndim==3)
-                  info[ lab * INFO_NCOLS + INFO_Z ] += arr[*a] * coord[2];
+                  info[ lab * INFO_NCOLS + INFO_Z ] += values[*a] * coord[2];
               }
           }
 
@@ -312,8 +312,8 @@ clumps_get_raw_info(struct clumps_thread_params *cltprm)
                     if(i==ii)
                       {
                         ngblabs[ii++] = nlab;
-                        ++info[ nlab * INFO_NCOLS + INFO_RIVAREA ];
-                        info[   nlab * INFO_NCOLS + INFO_RIVFLUX ] += arr[*a];
+                        ++info[nlab * INFO_NCOLS + INFO_RIVAREA];
+                        info[  nlab * INFO_NCOLS + INFO_RIVFLUX]+=values[*a];
                       }
                   }
               } );
@@ -321,19 +321,24 @@ clumps_get_raw_info(struct clumps_thread_params *cltprm)
       }
   while(++a<af);
 
-
-  /* Do the final preparations. All the calculations are only necessary for
-     the clumps that satisfy the minimum area. So there is no need to waste
-     time on the smaller ones. */
+  /* Based on the position of each clump, find a representative standard
+     deviation. */
   for(lab=1; lab<=cltprm->numinitclumps; ++lab)
     {
+      /* To help in reading. */
       row = &info [ lab * INFO_NCOLS ];
+
+      /* The calculations are only necessary for the clumps that satisfy
+         the minimum area. There is no need to waste time on the smaller
+         ones. */
       if ( row[INFO_INAREA] > p->snminarea )
         {
-          /* Especially over the undetected regions, it might happen that
-             none of the pixels were positive. In that case, set the total
-             area of the clump to zero so it is no longer considered.*/
-          if( row[INFO_SFF]==0.0f ) row[INFO_INAREA]=0;
+          /* It might happen that none of the pixels were positive
+             (especially over the undetected regions). In that case, set
+             the total area of the clump to zero so it is no longer
+             considered.*/
+          if( row[INFO_SFF]==0.0f )
+            row[INFO_INAREA]=0;
           else
             {
               /* Find the coordinates of the clump's weighted center. */
@@ -363,7 +368,6 @@ clumps_get_raw_info(struct clumps_thread_params *cltprm)
         }
     }
 
-
   /* Clean up. */
   free(dinc);
   free(ngblabs);
@@ -426,7 +430,7 @@ clumps_make_sn_table(struct clumps_thread_params *cltprm)
   clumps_get_raw_info(cltprm);
 
 
-  /* Calculate the signal to noise ratio for successful clumps */
+  /* Calculate the signal to noise ratio for successful clumps. */
   snarr=cltprm->sn->array;
   if(cltprm->snind) indarr=cltprm->snind->array;
   for(i=1;i<tablen;++i)



reply via email to

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