"Fossies" - the Fresh Open Source Software Archive

Member "gnuastro-0.9/bin/statistics/main.h" (17 Feb 2019, 5442 Bytes) of package /linux/privat/gnuastro-0.9.tar.lz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "main.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.8_vs_0.9.

    1 /*********************************************************************
    2 Statistics - Statistical analysis on input dataset.
    3 Statistics is part of GNU Astronomy Utilities (Gnuastro) package.
    4 
    5 Original author:
    6      Mohammad Akhlaghi <mohammad@akhlaghi.org>
    7 Contributing author(s):
    8 Copyright (C) 2015-2019, Free Software Foundation, Inc.
    9 
   10 Gnuastro is free software: you can redistribute it and/or modify it
   11 under the terms of the GNU General Public License as published by the
   12 Free Software Foundation, either version 3 of the License, or (at your
   13 option) any later version.
   14 
   15 Gnuastro is distributed in the hope that it will be useful, but
   16 WITHOUT ANY WARRANTY; without even the implied warranty of
   17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18 General Public License for more details.
   19 
   20 You should have received a copy of the GNU General Public License
   21 along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
   22 **********************************************************************/
   23 #ifndef MAIN_H
   24 #define MAIN_H
   25 
   26 /* Include necessary headers */
   27 #include <gnuastro/data.h>
   28 
   29 #include <gnuastro-internal/options.h>
   30 
   31 /* Progarm names.  */
   32 #define PROGRAM_NAME   "Statistics"    /* Program full name.       */
   33 #define PROGRAM_EXEC   "aststatistics" /* Program executable name. */
   34 #define PROGRAM_STRING PROGRAM_NAME" (" PACKAGE_NAME ") " PACKAGE_VERSION
   35 
   36 
   37 
   38 
   39 
   40 /* Input formats. */
   41 enum statistics_input_format
   42   {
   43     INPUT_FORMAT_INVALID,
   44 
   45     INPUT_FORMAT_TABLE,
   46     INPUT_FORMAT_IMAGE,
   47   };
   48 
   49 
   50 
   51 
   52 
   53 /* Main program parameters structure */
   54 struct statisticsparams
   55 {
   56   /* From command-line */
   57   struct gal_options_common_params cp; /* Common parameters.             */
   58   gal_list_i32_t         *singlevalue; /* Single value calculations.     */
   59   gal_list_f64_t  *tp_args;  /* Arguments for printing.                  */
   60   char          *inputname;  /* Input filename.                          */
   61   char             *column;  /* Column name or number if input is table. */
   62   char             *refcol;  /* Reference column name or number.         */
   63   float       greaterequal;  /* Only use values >= this value.           */
   64   float           lessthan;  /* Only use values <  this value.           */
   65   float           quantmin;  /* Quantile min or range: from Q to 1-Q.    */
   66   float           quantmax;  /* Quantile maximum.                        */
   67   uint8_t           ontile;  /* Do single value calculations on tiles.   */
   68   uint8_t      interpolate;  /* Use interpolation to fill blank tiles.   */
   69 
   70   uint8_t        asciihist;  /* Print an ASCII histogram.                */
   71   uint8_t         asciicfp;  /* Print an ASCII cumulative frequency plot.*/
   72   uint8_t        histogram;  /* Save histogram in output.                */
   73   uint8_t       cumulative;  /* Save cumulative distibution in output.   */
   74   double            mirror;  /* Mirror value for hist and CFP.           */
   75   uint8_t              sky;  /* Find the Sky value over the image.       */
   76   uint8_t        sigmaclip;  /* So sigma-clipping over all dataset.      */
   77 
   78   size_t           numbins;  /* Number of bins in histogram or CFP.      */
   79   size_t      numasciibins;  /* Number of bins in ASCII plots.           */
   80   size_t       asciiheight;  /* Height of ASCII histogram or CFP plots.  */
   81   uint8_t        normalize;  /* set the sum of all bins to 1.            */
   82   uint8_t   manualbinrange;  /* Set bin min/max manually, not from data. */
   83   float        onebinstart;  /* Shift bins to start at this value.       */
   84   uint8_t        maxbinone;  /* Set the maximum bin to 1.                */
   85   float         mirrordist;  /* Maximum distance after mirror for mode.  */
   86 
   87   char         *kernelname;  /* File name of kernel to convolve input.   */
   88   char               *khdu;  /* Kernel HDU.                              */
   89   float       meanmedqdiff;  /* Mode and median quantile difference.     */
   90   float       outliersigma;  /* Multiple of sigma to define outlier.     */
   91   double   outliersclip[2];  /* Outlier Sigma-clipping params.           */
   92   size_t       smoothwidth;  /* Width of flat kernel to smooth interpd.  */
   93   uint8_t         checksky;  /* Save the steps for deriving the Sky.     */
   94   double    sclipparams[2];  /* Muliple and parameter of sigma clipping. */
   95   uint8_t ignoreblankintiles;/* Ignore input's blank values.             */
   96 
   97 
   98   /* Internal */
   99   uint8_t      inputformat;  /* Format of input dataset.                 */
  100   int          numoutfiles;  /* Number of output files made in this run. */
  101   uint8_t        needssort;  /* If sorting is needed.                    */
  102   gal_data_t        *input;  /* Input data structure.                    */
  103   gal_data_t       *sorted;  /* Sorted input data structure.             */
  104   gal_data_t    *reference;  /* Reference data structure.                */
  105   int               isfits;  /* Input is a FITS file.                    */
  106   int             hdu_type;  /* Type of HDU (image or table).            */
  107   gal_data_t       *kernel;  /* Kernel for convolution of input for Sky. */
  108   gal_data_t    *convolved;  /* Convolved input.                         */
  109   gal_data_t        *sky_t;  /* Sky on each tile.                        */
  110   gal_data_t        *std_t;  /* Sky standard deviation on each tile.     */
  111   char       *checkskyname;  /* Name of file for Sky calculation steps.  */
  112   time_t           rawtime;  /* Starting time of the program.            */
  113 };
  114 
  115 #endif