[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 053eb4d 3/3: Corrected NoiseChisel's NUMLABS i
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 053eb4d 3/3: Corrected NoiseChisel's NUMLABS in onlydetection mode |
Date: |
Mon, 5 Jun 2017 09:53:27 -0400 (EDT) |
branch: master
commit 053eb4d027c5c84af11827343bf3c572bca4b899
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
Corrected NoiseChisel's NUMLABS in onlydetection mode
The value of the `NUMLABS' keyword in NoiseChisel's detected object image
was based on `p->numobjects'. However, this variable was given a value only
after segmentation. So when NoiseChisel was run in `--onlydetection' mode,
the value of this keyword would be `0'! This is now corrected.
Also, to facilitate access to the library, a `libgnuastro' title was also
added to the Info contents. So by running `info libgnuastro' you will be
directly taken to the `gnuastro library' section of the manual.
---
bin/mkcatalog/ui.c | 7 ++++---
bin/noisechisel/noisechisel.c | 2 ++
doc/gnuastro.texi | 1 +
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index 09e02a4..7096feb 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -513,6 +513,7 @@ ui_preparations_read_keywords(struct mkcatalogparams *p)
keys[0].array=&p->minstd; keys[1].array=&p->medstd;
gal_fits_key_read(stdfile, p->stdhdu, keys, 0, 0);
+
/* If the two keywords couldn't be read, calculate them. */
if(keys[0].status)
{
@@ -548,11 +549,11 @@ ui_preparations_read_keywords(struct mkcatalogparams *p)
keys[0].type=GAL_TYPE_FLOAT32; keys[1].type=GAL_TYPE_SIZE_T;
keys[0].array=&p->detsn; keys[1].array=&p->numobjects;
gal_fits_key_read(objectsfile, p->objectshdu, keys, 0, 0);
- if(keys[0].status) p->detsn=NAN;
- if(keys[1].status)
+ if(keys[0].status) p->detsn=NAN; /* When `status!=0', then */
+ if(keys[1].status) /* the key couldn't be read. */
{
tmp=gal_statistics_maximum(p->objects);
- p->numobjects=*((int32_t *)(tmp->array)); /* objects is in int32_t. */
+ p->numobjects=*((int32_t *)(tmp->array)); /*numobjects is in int32_t.*/
gal_data_free(tmp);
}
diff --git a/bin/noisechisel/noisechisel.c b/bin/noisechisel/noisechisel.c
index 51e0f8d..4a71130 100644
--- a/bin/noisechisel/noisechisel.c
+++ b/bin/noisechisel/noisechisel.c
@@ -298,6 +298,8 @@ noisechisel(struct noisechiselparams *p)
/* Do the segmentation. */
segmentation(p);
}
+ else
+ p->numobjects=p->numdetections;
/* Write the output. */
noisechisel_output(p);
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 1225e3f..51f0506 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -45,6 +45,7 @@ License''.
@dircategory Astronomy
@direntry
* Gnuastro: (gnuastro). GNU Astronomy Utilities.
+* libgnuastro: (gnuastro)Gnuastro library. Full Gnuastro library doc.
* help-gnuastro: (gnuastro)help-gnuastro mailing list. Getting help.