[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 28667d4 1/2: Better names for two options in M
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 28667d4 1/2: Better names for two options in MakeCatalog |
Date: |
Tue, 26 Jun 2018 11:15:57 -0400 (EDT) |
branch: master
commit 28667d470ffb7b892e0c2a9b77c860477ca451f8
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
Better names for two options in MakeCatalog
The `--checkupperlimit' option name was too long (was forcing the
description in `--help' to go onto the next line). So it was shortened to
`--checkuplim'.
The `--noriverbrightness' option was renamed to `--brightnessnoriver' to be
sorted along with the other brightness options in the output of `--help'.
---
NEWS | 4 ++++
bin/mkcatalog/args.h | 10 +++++-----
bin/mkcatalog/columns.c | 4 ++--
bin/mkcatalog/main.h | 2 +-
bin/mkcatalog/ui.c | 47 +++++++++++++++++++++++-----------------------
bin/mkcatalog/ui.h | 4 ++--
bin/mkcatalog/upperlimit.c | 24 +++++++++++------------
doc/gnuastro.texi | 4 ++--
8 files changed, 51 insertions(+), 48 deletions(-)
diff --git a/NEWS b/NEWS
index 28fbc74..5a359f9 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ GNU Astronomy Utilities NEWS -*-
outline -*-
** Changed features
+ MakeCatalog:
+ - `--checkuplim': new name for `--checkupperlimit'.
+ - `--brightnessnoriver': new name for `--noriverbrightness'.
+
Library:
- gal_txt_write: new `colinfoinstdout' argument.
- gal_table_write: new `colinfoinstdout' argument.
diff --git a/bin/mkcatalog/args.h b/bin/mkcatalog/args.h
index 6232f7e..58e7d77 100644
--- a/bin/mkcatalog/args.h
+++ b/bin/mkcatalog/args.h
@@ -334,13 +334,13 @@ struct argp_option program_options[] =
GAL_OPTIONS_NOT_SET
},
{
- "checkupperlimit",
- UI_KEY_CHECKUPPERLIMIT,
+ "checkuplim",
+ UI_KEY_CHECKUPLIM,
"INT[,INT]",
0,
"Check random distribution for one label.",
UI_GROUP_UPPERLIMIT,
- &p->checkupperlimit,
+ &p->checkuplim,
GAL_TYPE_STRING,
GAL_OPTIONS_RANGE_GT_0,
GAL_OPTIONS_NOT_MANDATORY,
@@ -743,8 +743,8 @@ struct argp_option program_options[] =
ui_column_codes_ll
},
{
- "noriverbrightness",
- UI_KEY_NORIVERBRIGHTNESS,
+ "brightnessnoriver",
+ UI_KEY_BRIGHTNESSNORIVER,
0,
0,
"Sky (not river) subtracted clump brightness.",
diff --git a/bin/mkcatalog/columns.c b/bin/mkcatalog/columns.c
index 3ee68df..00ebaed 100644
--- a/bin/mkcatalog/columns.c
+++ b/bin/mkcatalog/columns.c
@@ -701,7 +701,7 @@ columns_define_alloc(struct mkcatalogparams *p)
oiflag[ OCOL_C_SUM ] = 1;
break;
- case UI_KEY_NORIVERBRIGHTNESS:
+ case UI_KEY_BRIGHTNESSNORIVER:
name = "NO_RIVER_BRIGHTNESS";
unit = MKCATALOG_NO_UNIT;
ocomment = NULL;
@@ -1764,7 +1764,7 @@ columns_fill(struct mkcatalog_passparams *pp)
: NAN );
break;
- case UI_KEY_NORIVERBRIGHTNESS:
+ case UI_KEY_BRIGHTNESSNORIVER:
((float *)colarr)[cind] = ( ci[ CCOL_NUM ]>0.0f
? ci[ CCOL_SUM ] : NAN );
break;
diff --git a/bin/mkcatalog/main.h b/bin/mkcatalog/main.h
index b8fe4a7..81d4f03 100644
--- a/bin/mkcatalog/main.h
+++ b/bin/mkcatalog/main.h
@@ -175,7 +175,7 @@ struct mkcatalogparams
uint8_t envseed; /* Use the environment for random seed. */
double upsigmaclip[2]; /* Sigma clip to measure upper limit. */
float upnsigma; /* Multiple of sigma to define up-lim. */
- int32_t checkupperlimit[2]; /* Object & clump ID to check dist. */
+ int32_t checkuplim[2]; /* Object & clump ID to check dist. */
/* Internal. */
time_t rawtime; /* Starting time of the program. */
diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index 07dcd51..8acc535 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -121,15 +121,15 @@ ui_initialize_options(struct mkcatalogparams *p,
cp->coptions = gal_commonopts_options;
/* Specific to this program. */
- p->medstd = NAN;
- p->sfmagnsigma = NAN;
- p->sfmagarea = NAN;
- p->upnsigma = NAN;
- p->zeropoint = NAN;
- p->upsigmaclip[0] = NAN;
- p->upsigmaclip[1] = NAN;
- p->checkupperlimit[0] = GAL_BLANK_INT32;
- p->checkupperlimit[1] = GAL_BLANK_INT32;
+ p->medstd = NAN;
+ p->sfmagnsigma = NAN;
+ p->sfmagarea = NAN;
+ p->upnsigma = NAN;
+ p->zeropoint = NAN;
+ p->upsigmaclip[0] = NAN;
+ p->upsigmaclip[1] = NAN;
+ p->checkuplim[0] = GAL_BLANK_INT32;
+ p->checkuplim[1] = GAL_BLANK_INT32;
/* Modify common options. */
for(i=0; !gal_options_is_last(&cp->coptions[i]); ++i)
@@ -264,14 +264,13 @@ ui_check_upperlimit(struct argp_option *option, char *arg,
/* Write. */
if(lineno==-1)
{
- if(p->checkupperlimit[1]==GAL_BLANK_INT32)
+ if(p->checkuplim[1]==GAL_BLANK_INT32)
{
- if( asprintf(&str, "%d", p->checkupperlimit[0])<0 )
+ if( asprintf(&str, "%d", p->checkuplim[0])<0 )
error(EXIT_FAILURE, 0, "%s: asprintf allocation", __func__);
}
else
- if( asprintf(&str, "%d,%d", p->checkupperlimit[0],
- p->checkupperlimit[1])<0 )
+ if( asprintf(&str, "%d,%d", p->checkuplim[0], p->checkuplim[1])<0 )
error(EXIT_FAILURE, 0, "%s: asprintf allocation", __func__);
return str;
}
@@ -322,8 +321,8 @@ ui_check_upperlimit(struct argp_option *option, char *arg,
}
/* Write the values in. */
- p->checkupperlimit[0] = d[0];
- p->checkupperlimit[1] = raw->size==2 ? d[1] : GAL_BLANK_INT32;
+ p->checkuplim[0] = d[0];
+ p->checkuplim[1] = raw->size==2 ? d[1] : GAL_BLANK_INT32;
/* For no un-used variable warning. This function doesn't need the
pointer.*/
@@ -365,14 +364,14 @@ ui_read_check_only_options(struct mkcatalogparams *p)
/* If an upper-limit check table is requested with a specific clump, but
no clump catalog has been requested, then abort and inform the
user. */
- if( p->checkupperlimit[1]!=GAL_BLANK_INT32 && p->clumpscat==0 )
+ if( p->checkuplim[1]!=GAL_BLANK_INT32 && p->clumpscat==0 )
error(EXIT_FAILURE, 0, "no clumps catalog is requested, hence "
- "`--checkupperlimit' is only available for objects (one value "
+ "`--checkuplim' is only available for objects (one value "
"must be given to it).\n\n"
"To ask for a clumps catalog, please append `--clumpscat' to the "
"command calling MakeCatalog.\n\n"
"If you want the upperlimit check table for an object, only give "
- "one value (the object's label) to `--checkupperlimit'.");
+ "one value (the object's label) to `--checkuplim'.");
/* See if `--skyin' is a filename or a value. When the string is ONLY a
number (and nothing else), `tailptr' will point to the end of the
@@ -992,11 +991,11 @@ ui_preparations_read_inputs(struct mkcatalogparams *p)
{
/* If an upperlimit check was requested, make sure the object number
is not larger than the maximum number of labels. */
- if(p->checkupperlimit[0] != GAL_BLANK_INT32
- && p->checkupperlimit[0] > p->numobjects)
+ if(p->checkuplim[0] != GAL_BLANK_INT32
+ && p->checkuplim[0] > p->numobjects)
error(EXIT_FAILURE, 0, "%d (object identifier for the "
- "`--checkupperlimit' option) is larger than the number of "
- "objects in the input labels (%zu)", p->checkupperlimit[0],
+ "`--checkuplim' option) is larger than the number of "
+ "objects in the input labels (%zu)", p->checkuplim[0],
p->numobjects);
/* Read the mask file if it was given. */
@@ -1204,7 +1203,7 @@ ui_preparations_outnames(struct mkcatalogparams *p)
}
/* If an upperlimit check image is requsted, then set its filename. */
- if(p->checkupperlimit)
+ if(p->checkuplim)
{
/* See if the directory should be respected. */
p->cp.keepinputdir = p->cp.output ? 1 : p->cp.keepinputdir;
@@ -1634,7 +1633,7 @@ ui_free_report(struct mkcatalogparams *p, struct timeval
*t1)
"input is less than double their length. If the input is taken "
"from a larger dataset, this issue can be solved by using a "
"larger part of it. You can also run MakeCatalog with "
- "`--checkupperlimit' to see the distribution for a special "
+ "`--checkuplim' to see the distribution for a special "
"object or clump as a table and personally inspect its "
"reliability. \n\n");
diff --git a/bin/mkcatalog/ui.h b/bin/mkcatalog/ui.h
index c6562b8..0b7a255 100644
--- a/bin/mkcatalog/ui.h
+++ b/bin/mkcatalog/ui.h
@@ -96,7 +96,7 @@ enum option_keys_enum
UI_KEY_UPRANGE,
UI_KEY_UPSIGMACLIP,
UI_KEY_UPNSIGMA,
- UI_KEY_CHECKUPPERLIMIT,
+ UI_KEY_CHECKUPLIM,
UI_KEY_NOCLUMPSORT,
UI_KEY_OBJID, /* Catalog columns. */
@@ -120,7 +120,7 @@ enum option_keys_enum
UI_KEY_CLUMPSGEOW2,
UI_KEY_BRIGHTNESSERR,
UI_KEY_CLUMPSBRIGHTNESS,
- UI_KEY_NORIVERBRIGHTNESS,
+ UI_KEY_BRIGHTNESSNORIVER,
UI_KEY_MEAN,
UI_KEY_MEDIAN,
UI_KEY_CLUMPSMAGNITUDE,
diff --git a/bin/mkcatalog/upperlimit.c b/bin/mkcatalog/upperlimit.c
index 3645c2f..e9a0e8b 100644
--- a/bin/mkcatalog/upperlimit.c
+++ b/bin/mkcatalog/upperlimit.c
@@ -390,12 +390,12 @@ upperlimit_write_check(struct mkcatalogparams *p,
gal_list_sizet_t *check_x,
/* Write exactly what object/clump this table is for. */
- if( p->checkupperlimit[1]!=GAL_BLANK_INT32 )
- if( asprintf(&tmp2, ", Clump %d", p->checkupperlimit[1]) <0 )
+ if( p->checkuplim[1]!=GAL_BLANK_INT32 )
+ if( asprintf(&tmp2, ", Clump %d", p->checkuplim[1]) <0 )
error(EXIT_FAILURE, 0, "%s: asprintf allocation", __func__);
if( asprintf(&tmp, "Upperlimit distribution for Object %d%s",
- p->checkupperlimit[0],
- ( p->checkupperlimit[1]==GAL_BLANK_INT32
+ p->checkuplim[0],
+ ( p->checkuplim[1]==GAL_BLANK_INT32
? "" : tmp2) ) <0 )
error(EXIT_FAILURE, 0, "%s: asprintf allocation", __func__);
gal_list_str_add(&comments, tmp, 0);
@@ -557,16 +557,16 @@ upperlimit_one_tile(struct mkcatalog_passparams *pp,
gal_data_t *tile,
"rcoord");
/* See if a check table must be created for this distribution. */
- if( p->checkupperlimit[0]==pp->object )
+ if( p->checkuplim[0]==pp->object )
{
/* We are on a clump */
if( clumplab )
{
- if( p->checkupperlimit[1]==clumplab )
+ if( p->checkuplim[1]==clumplab )
writecheck=1;
}
else
- if( p->checkupperlimit[1]==GAL_BLANK_INT32 )
+ if( p->checkuplim[1]==GAL_BLANK_INT32 )
writecheck=1;
}
@@ -730,13 +730,13 @@ upperlimit_calculate(struct mkcatalog_passparams *pp)
/* If an upper-limit check image is requested, then make sure that
the clump label is not more than the number of clumps in this
object. */
- if( p->checkupperlimit[0] == pp->object
- && p->checkupperlimit[1] != GAL_BLANK_INT32
- && p->checkupperlimit[1] > pp->clumpsinobj )
+ if( p->checkuplim[0] == pp->object
+ && p->checkuplim[1] != GAL_BLANK_INT32
+ && p->checkuplim[1] > pp->clumpsinobj )
error(EXIT_FAILURE, 0, "object %d has %zu clumps, but an upperlimit "
- "check table (using the `--checkupperlimit' option) has been "
+ "check table (using the `--checkuplim' option) has been "
"requested for clump %d", pp->object, pp->clumpsinobj,
- p->checkupperlimit[1]);
+ p->checkuplim[1]);
/* Make tiles covering the clumps. */
clumptiles=upperlimit_make_clump_tiles(pp);
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index a28d000..d1ed27d 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -17575,7 +17575,7 @@ The multiple of the final (@mymath{\sigma}-clipped)
standard deviation (or
@mymath{\sigma}) used to measure the upper-limit brightness or
magnitude.
address@hidden --checkupperlimit=INT[,INT]
address@hidden --checkuplim=INT[,INT]
Print a table of positions and measured values for all the full random
distribution used for one particular object or clump. If only one integer
is given to this option, it is interpreted to be an object's label. If two
@@ -17751,7 +17751,7 @@ usable pixels (blank or below the threshold) are
present over the clump or
object, the stored value will be NaN, because zero (note that zero is
meaningful).
address@hidden --noriverbrightness
address@hidden --brightnessnoriver
[Clumps] The Sky (not river) subtracted clump brightness. By definition,
for the clumps, the average brightness of the rivers surrounding it are
subtracted from it for a first order accounting for contamination by