gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master eaa96d7: MakeCatalog: relabeled clumps image w


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master eaa96d7: MakeCatalog: relabeled clumps image written in proper directory
Date: Sun, 9 Jun 2019 17:07:25 -0400 (EDT)

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

    MakeCatalog: relabeled clumps image written in proper directory
    
    Until now, even when an output file name was given, the relabeled clumps
    image would be kept in the top level directory. This didn't correspond to
    the current way Gnuastro programs work.
    
    With this commit, when an output file is given, the relabeled clumps image
    is stored in the same directory.
---
 bin/mkcatalog/ui.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index fb04aff..4a17435 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -536,6 +536,7 @@ static size_t
 ui_num_clumps(struct mkcatalogparams *p)
 {
   char *basename;
+  int keepinputdir;
   size_t i, counter, numclumps=0;
   gal_list_i32_t *tmp, **labsinobj;
   int32_t *o=p->objects->array, *of=o+p->objects->size, *c=p->clumps->array;
@@ -590,11 +591,13 @@ ui_num_clumps(struct mkcatalogparams *p)
   while(++o<of);
 
   /* Write the created file into a file for the user to inspect. */
+  keepinputdir=p->cp.keepinputdir;
+  p->cp.keepinputdir = p->cp.output ? 1 : 0;
   basename = p->cp.output ? p->cp.output : p->objectsfile;
   p->relabclumps=gal_checkset_automatic_output(&p->cp, basename,
                                                "-clumps-relab.fits");
   gal_fits_img_write(p->clumps, p->relabclumps, NULL, PROGRAM_STRING);
-
+  p->cp.keepinputdir=keepinputdir;
 
   /* Clean up. */
   for(i=0;i<p->numobjects;++i)



reply via email to

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