[Top][All Lists]

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

[gnuastro-commits] master 382fc89: MakeCatalog: cpscorr is properly set

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 382fc89: MakeCatalog: cpscorr is properly set when --instd is a number
Date: Wed, 6 Nov 2019 08:15:39 -0500 (EST)

branch: master
commit 382fc89cbabde2eb2dea5a585d37a75bfe42dac5
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    MakeCatalog: cpscorr is properly set when --instd is a number
    Until now the `p->cpscorr' (to correct for counts-per-second datasets), was
    only set when an input image was given to `--instd'. As a result, when a
    single number was given, it would be zero and `1/p->cpscorr' would become
    infinity and the `--sn' column would be `inf'. With this commit, we also
    set `p->cpscorr' when the input is a single number.
    This bug was reported by Joseph Putko.
    This fixes bug #57180.
 NEWS                         | 1 +
 THANKS                       | 1 +
 bin/mkcatalog/ui.c           | 7 ++++++-
 doc/announce-acknowledge.txt | 1 +
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 781fee0..e529cb9 100644
--- a/NEWS
+++ b/NEWS
@@ -130,6 +130,7 @@ See the end of the file for license conditions.
   bug #57057: BuildProgram not using environment LDFLAGS or CPPFLAGS.
   bug #57101: Crop segmentation fault when no overlap exists in image-mode.
   bug #57164: MakeCatalog crashes when a label isn't in the dataset.
+  bug #57180: MakeCatalog reporting infinity S/N when --instd isn't an image.
diff --git a/THANKS b/THANKS
index 0de4197..04aa0f9 100644
--- a/THANKS
+++ b/THANKS
@@ -63,6 +63,7 @@ support in Gnuastro. The list is ordered alphabetically (by 
family name).
     William Pence                        address@hidden
     Mamta Pommier                        address@hidden
     Bob Proulx                           address@hidden
+    Joseph Putko                         address@hidden
     Teymoor Saifollahi                   address@hidden
     Elham Saremi                         address@hidden
     Yahya Sefidbakht                     address@hidden
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index ebd1743..084d78e 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -1308,8 +1308,8 @@ ui_preparations_read_inputs(struct mkcatalogparams *p)
 static void
 ui_preparations_read_keywords(struct mkcatalogparams *p)
-  float minstd;
   gal_data_t *tmp;
+  float std, minstd;
   gal_data_t *keys=NULL;
   /* When a Sky standard deviation dataset (not number) is given. */
@@ -1344,6 +1344,11 @@ ui_preparations_read_keywords(struct mkcatalogparams *p)
       gal_data_array_free(keys, 2, 1);
+  else
+    {
+      std=((float *)(p->std->array))[0];
+      p->cpscorr=std>1 ? 1.0f : std;
+    }
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index 1edfc78..9097144 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -4,6 +4,7 @@ Hamed Altafi
 Alexey Dokuchaev
 Raúl Infante Sainz
 Sebastián Luna Valero
+Joseph Putko

reply via email to

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