gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master ab6a787: MakeCatalog's --checkupperlimit table


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master ab6a787: MakeCatalog's --checkupperlimit table saved in proper directory
Date: Mon, 25 Jun 2018 18:50:52 -0400 (EDT)

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

    MakeCatalog's --checkupperlimit table saved in proper directory
    
    When called with `--checkupperlimit', MakeCatalog will build a table of all
    the positions and values used in the upper-limit estimation. If no output
    file is specified this is fine (the table is stored in the running
    directory). When the user has asked for the output in a different
    directory, the table must also be built there. But until now, this wouldn't
    happen and it is built in the current directory.
    
    With this commit, when the user specifies an output name, we will
    temporarily set "p->cp.keepinputdir" to `1' and reset it afterwards.
    
    This fixes bug #54186.
---
 NEWS               | 15 ++++++++-------
 bin/mkcatalog/ui.c | 10 ++++++++++
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/NEWS b/NEWS
index e77364d..ef6d63d 100644
--- a/NEWS
+++ b/NEWS
@@ -16,10 +16,11 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
     - gal_txt_write: new `colinfoinstdout' argument.
     - gal_table_write: new `colinfoinstdout' argument.
 
-** Bug fixes
+** Bugs fixed
 
   bug #54057: Building failure due to not finding gsl_interp_steffen.
   bug #54063: Match tests in make check fail randomly.
+  bug #54186: MakeCatalog's --checkupperlimit not keeping output's name.
 
 
 
@@ -222,7 +223,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
     gal_statistics_number: the output dataset now has a `size_t' type. Until
         now it was `uint64_t'.
 
-** Bug fixes
+** Bugs fixed
 
   bug #50957: --version output not possible on Mac OS X
   bug #52979: Many unused result warnings for asprintf in some compilers.
@@ -405,7 +406,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   the input coordinates, thus their API has been greatly simplified and
   their functionality increased.
 
-** Bug fixes
+** Bugs fixed
 
   ConvertType crash when changing values (bug #52010).
 
@@ -542,7 +543,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   not their allocated blocks of memory). Until now, it was necessary for
   the two blocks to have the same size and this is no longer the case.
 
-** Bug fixes
+** Bugs fixed
 
   MakeProfiles long options on 32bit big endian systems (bug #51341).
 
@@ -862,7 +863,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
   this to set edge pixels that are not fully covered in the new grid to
   blank and have a flat warped image.
 
-** Bug fixes
+** Bugs fixed
 
   Using `%zu' to print `size_t' variables for clean build on 32-bit
   systems.
@@ -898,7 +899,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
 * Noteworthy changes in release 0.2 (library 0.0.0) (2016-10-03) [stable]
 
-** Bug fixes
+** Bugs fixed
 
   Linker errors on some operating systems have been fixed (bug #48076).
 
@@ -985,7 +986,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 
 * Noteworthy changes in release 0.1 (2016-05-30) [stable]
 
-** Bug fixes
+** Bugs fixed
 
   MakeCatalog's problem in checking the sizes of all input images is now
   fixed.
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index ca932f4..07dcd51 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -1164,6 +1164,7 @@ static void
 ui_preparations_outnames(struct mkcatalogparams *p)
 {
   char *suffix;
+  uint8_t keepinputdir=p->cp.keepinputdir;
 
   /* The process differs if an output filename has been given. */
   if(p->cp.output)
@@ -1205,13 +1206,22 @@ ui_preparations_outnames(struct mkcatalogparams *p)
   /* If an upperlimit check image is requsted, then set its filename. */
   if(p->checkupperlimit)
     {
+      /* See if the directory should be respected. */
+      p->cp.keepinputdir = p->cp.output ? 1 : p->cp.keepinputdir;
+
+      /* Set the suffix. */
       suffix = ( p->cp.tableformat==GAL_TABLE_FORMAT_TXT
                  ? "_upcheck.txt" : "_upcheck.fits" );
+
+      /* Set the file name. */
       p->upcheckout=gal_checkset_automatic_output(&p->cp,
                                                   ( p->cp.output
                                                     ? p->cp.output
                                                     : p->objectsfile),
                                                   suffix);
+
+      /* Set `keepinputdir' to what it was before. */
+      p->cp.keepinputdir=keepinputdir;
     }
 
   /* Just to avoid bugs (`p->cp.output' must no longer be used), we'll free



reply via email to

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