gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 931ce2a 3/4: Skewness of upperlimit random dis


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 931ce2a 3/4: Skewness of upperlimit random distribution can be reported
Date: Wed, 21 Mar 2018 15:11:49 -0400 (EDT)

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

    Skewness of upperlimit random distribution can be reported
    
    MakeCatalog currently only reports the basic statistics of the upper limit
    distribution. There is no easy way to estimate the various properties of
    the distribution. As the most simplest parameter, there is a column now
    that will allow the user to ask the skewness of the distribution.
---
 NEWS                       |  1 +
 bin/mkcatalog/args.h       | 14 ++++++++++++++
 bin/mkcatalog/columns.c    | 21 +++++++++++++++++++++
 bin/mkcatalog/main.h       |  2 ++
 bin/mkcatalog/ui.h         |  1 +
 bin/mkcatalog/upperlimit.c |  8 ++++++--
 doc/gnuastro.texi          | 19 +++++++++++++++++--
 7 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index e72b424..4e4509b 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
     --upperlimitsigma: position in random distribution (in units of sigma).
     --upperlimitquantile: position in random distribution (quantile).
     --upperlimitonesigma: 1sigma value of the random distribution.
+    --upperlimitskew: (mean-median)/sigma or skewness of random distribution.
 
   Statistics:
     --manualbinrange: histogram or CFP range can be outside of distribution.
diff --git a/bin/mkcatalog/args.h b/bin/mkcatalog/args.h
index 562b08c..b589c91 100644
--- a/bin/mkcatalog/args.h
+++ b/bin/mkcatalog/args.h
@@ -870,6 +870,20 @@ struct argp_option program_options[] =
       ui_column_codes_ll
     },
     {
+      "upperlimitskew",
+      UI_KEY_UPPERLIMITSKEW,
+      0,
+      0,
+      "(Mean-Median)/STD of random distribution.",
+      UI_GROUP_COLUMNS_BRIGHTNESS,
+      0,
+      GAL_TYPE_INVALID,
+      GAL_OPTIONS_RANGE_ANY,
+      GAL_OPTIONS_NOT_MANDATORY,
+      GAL_OPTIONS_NOT_SET,
+      ui_column_codes_ll
+    },
+    {
       "riverave",
       UI_KEY_RIVERAVE,
       0,
diff --git a/bin/mkcatalog/columns.c b/bin/mkcatalog/columns.c
index b6ef963..f5e075f 100644
--- a/bin/mkcatalog/columns.c
+++ b/bin/mkcatalog/columns.c
@@ -824,6 +824,19 @@ columns_define_alloc(struct mkcatalogparams *p)
           p->upperlimit  = 1;
           break;
 
+        case UI_KEY_UPPERLIMITSKEW:
+          name           = "UPPERLIMIT_SKEW";
+          unit           = "frac";
+          ocomment       = "(Mean-Median)/STD of random distribution.";
+          ccomment       = ocomment;
+          otype          = GAL_TYPE_FLOAT32;
+          ctype          = GAL_TYPE_FLOAT32;
+          disp_fmt       = GAL_TABLE_DISPLAY_FMT_GENERAL;
+          disp_width     = 8;
+          disp_precision = 3;
+          p->upperlimit  = 1;
+          break;
+
         case UI_KEY_RIVERAVE:
           name           = "RIVER_AVE";
           unit           = p->input->unit ? p->input->unit : "pixelunit";
@@ -1519,6 +1532,10 @@ columns_fill(struct mkcatalog_passparams *pp)
           ((float *)colarr)[oind] = oi[ OCOL_UPPERLIMIT_Q ];
           break;
 
+        case UI_KEY_UPPERLIMITSKEW:
+          ((float *)colarr)[oind] = oi[ OCOL_UPPERLIMIT_SKEW ];
+          break;
+
         case UI_KEY_SN:
           ((float *)colarr)[oind] = columns_sn(p, oi, 0);
           break;
@@ -1695,6 +1712,10 @@ columns_fill(struct mkcatalog_passparams *pp)
             ((float *)colarr)[cind] = ci[ CCOL_UPPERLIMIT_Q ];
             break;
 
+          case UI_KEY_UPPERLIMITSKEW:
+            ((float *)colarr)[cind] = ci[ CCOL_UPPERLIMIT_SKEW ];
+            break;
+
           case UI_KEY_RIVERAVE:
             ((float *)colarr)[cind] = ( ci[ CCOL_RIV_NUM]
                                         ? ci[ CCOL_RIV_SUM ]/ci[ CCOL_RIV_NUM]
diff --git a/bin/mkcatalog/main.h b/bin/mkcatalog/main.h
index 32857ad..7e63936 100644
--- a/bin/mkcatalog/main.h
+++ b/bin/mkcatalog/main.h
@@ -90,6 +90,7 @@ enum objectcols
     OCOL_UPPERLIMIT_B,   /* Upper limit brightness.                   */
     OCOL_UPPERLIMIT_S,   /* Upper limit one-sigma value.              */
     OCOL_UPPERLIMIT_Q,   /* Quantile of object in random distribution.*/
+    OCOL_UPPERLIMIT_SKEW,/* (Mean-Median)/STD of random distribution. */
     OCOL_C_NUMALL,       /* Value independent no. of pixels in clumps.*/
     OCOL_C_NUM,          /* Area of clumps in this object.            */
     OCOL_C_SUM,          /* Brightness in object clumps.              */
@@ -130,6 +131,7 @@ enum clumpcols
     CCOL_UPPERLIMIT_B,   /* Upper limit brightness.                   */
     CCOL_UPPERLIMIT_S,   /* Upper limit one-sigma value.              */
     CCOL_UPPERLIMIT_Q,   /* Quantile of object in random distribution.*/
+    CCOL_UPPERLIMIT_SKEW,/* (Mean-Median)/STD of random distribution. */
 
     CCOL_NUMCOLS,        /* SHOULD BE LAST: total number of columns.  */
   };
diff --git a/bin/mkcatalog/ui.h b/bin/mkcatalog/ui.h
index 1f3b480..77fca48 100644
--- a/bin/mkcatalog/ui.h
+++ b/bin/mkcatalog/ui.h
@@ -124,6 +124,7 @@ enum option_keys_enum
   UI_KEY_UPPERLIMITONESIGMA,
   UI_KEY_UPPERLIMITSIGMA,
   UI_KEY_UPPERLIMITQUANTILE,
+  UI_KEY_UPPERLIMITSKEW,
   UI_KEY_RIVERAVE,
   UI_KEY_RIVERNUM,
   UI_KEY_SKY,
diff --git a/bin/mkcatalog/upperlimit.c b/bin/mkcatalog/upperlimit.c
index 20619f5..11790d3 100644
--- a/bin/mkcatalog/upperlimit.c
+++ b/bin/mkcatalog/upperlimit.c
@@ -309,14 +309,18 @@ upperlimit_measure(struct mkcatalog_passparams *pp, 
int32_t clumplab,
                   pp->up_vals->size=pp->up_vals->dsize[0]=init_size;
                   scarr=sigclip->array;
 
-                  /* Write the raw sigma. */
+                  /* 1-sigma. */
                   col = clumplab ? CCOL_UPPERLIMIT_S : OCOL_UPPERLIMIT_S;
                   o[col] = scarr[3];
 
-                  /* Write the multiple of `upnsigma'. */
+                  /* sigma multiplied by `upnsigma'. */
                   col = clumplab ? CCOL_UPPERLIMIT_B : OCOL_UPPERLIMIT_B;
                   o[col] = scarr[3] * p->upnsigma;
 
+                  /* Nonparametric skewness [ (Mean-Median)/STD ]. */
+                  col = clumplab?CCOL_UPPERLIMIT_SKEW:OCOL_UPPERLIMIT_SKEW;
+                  o[col] = ( scarr[2] - scarr[1] ) / scarr[3];
+
                   /* Clean up. */
                   gal_data_free(sigclip);
                 }
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 2df7174..6ad7f7e 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -557,7 +557,7 @@ Gnuastro library
 * Array input output::          Reading and writing images or cubes.
 * Table input output::          Reading and writing table columns.
 * FITS files::                  Working with FITS data.
-* File input output::
+* File input output::           Reading and writing to various file formats.
 * World Coordinate System::     Dealing with the world coordinate system.
 * Arithmetic on datasets::      Arithmetic operations on a dataset.
 * Tessellation library::        Functions for working on tiles.
@@ -15770,6 +15770,21 @@ settings} for a complete explanation. If the object is 
brighter than the
 brightest randomly placed profile, a value of @code{inf} is returned. If it
 is less than the minimum, a value of @code{-inf} is reported.
 
address@hidden --upperlimitskew
address@hidden Skewness
+This column contains the nonparametric skew of the sigma-clipped random
+distribution that was used to estimate the upper-limit magnitude. Taking
address@hidden as the mean, @mymath{\nu} as the median and @mymath{\sigma} as
+the standard deviation, the traditional definition of skewness is defined
+as: @mymath{(\mu-\nu)/\sigma}.
+
+This can be a good measure to see how much you can trust the random
+measurements, or in other words, how accurately the regions with signal
+have been masked/detected. If the skewness is strong (and to the positive),
+then you can tell that you have a lot of un-detected signal in the dataset,
+and therefore that the upper-limit measurement (and other measurements) are
+not reliable.
+
 @item --riverave
 [Clumps] The average brightness of the river pixels around this
 clump. River pixels were defined in Akhlaghi and Ichikawa 2015. In
@@ -19134,7 +19149,7 @@ documentation will correspond to your installed version.
 * Array input output::          Reading and writing images or cubes.
 * Table input output::          Reading and writing table columns.
 * FITS files::                  Working with FITS data.
-* File input output::
+* File input output::           Reading and writing to various file formats.
 * World Coordinate System::     Dealing with the world coordinate system.
 * Arithmetic on datasets::      Arithmetic operations on a dataset.
 * Tessellation library::        Functions for working on tiles.



reply via email to

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