"Fossies" - the Fresh Open Source Software Archive

Member "gnuastro-0.9/bin/arithmetic/main.h" (19 Feb 2019, 3542 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 Arithmetic - Do arithmetic operations on images.
    3 Arithmetic 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 <gnuastro/fits.h>
   27 #include <gnuastro/list.h>
   28 
   29 #include <gnuastro-internal/options.h>
   30 
   31 
   32 /* Progarm name macros: */
   33 #define PROGRAM_NAME   "Arithmetic"     /* Program full name.       */
   34 #define PROGRAM_EXEC   "astarithmetic"  /* Program executable name. */
   35 #define PROGRAM_STRING PROGRAM_NAME" (" PACKAGE_NAME ") " PACKAGE_VERSION
   36 
   37 
   38 
   39 
   40 
   41 /* Constants: */
   42 #define NEG_DASH_REPLACE 11 /* Vertical tab (ASCII=11) for negative dash */
   43 #define OPERATOR_PREFIX_SET               "set-"
   44 #define OPERATOR_PREFIX_TOFILE            "tofile-"
   45 #define OPERATOR_PREFIX_TOFILEFREE        "tofilefree-"
   46 #define OPERATOR_PREFIX_LENGTH_SET        strlen(OPERATOR_PREFIX_SET)
   47 #define OPERATOR_PREFIX_LENGTH_TOFILE     strlen(OPERATOR_PREFIX_TOFILE)
   48 #define OPERATOR_PREFIX_LENGTH_TOFILEFREE strlen(OPERATOR_PREFIX_TOFILEFREE)
   49 
   50 
   51 
   52 
   53 
   54 /* In every node of the operand linked list, only one of the `filename' or
   55    `data' should be non-NULL. Otherwise it will be a bug and will cause
   56    problems. All the operands operate on this premise. */
   57 struct operand
   58 {
   59   char       *filename;    /* !=NULL if the operand is a filename. */
   60   char            *hdu;    /* !=NULL if the operand is a filename. */
   61   gal_data_t     *data;    /* !=NULL if the operand is a dataset.  */
   62   struct operand *next;    /* Pointer to next operand.             */
   63 };
   64 
   65 
   66 
   67 
   68 
   69 
   70 struct arithmeticparams
   71 {
   72   /* Other structures: */
   73   struct gal_options_common_params cp;  /* Common parameters.           */
   74 
   75   /* Input: */
   76   gal_list_str_t     *hdus;  /* List of all given HDU strings.          */
   77   gal_list_str_t   *tokens;  /* List of all arithmetic tokens.          */
   78   char            *wcsfile;  /* File to use for output's WCS.           */
   79   char             *wcshdu;  /* Extension to use for output's WCS.      */
   80   size_t        popcounter;  /* The number of FITS images popped.       */
   81   gal_data_t       refdata;  /* Container for information of the data.  */
   82   char          *globalhdu;  /* Single HDU for all inputs.              */
   83   uint8_t      onedasimage;  /* Write 1D outputs as an image not table. */
   84   gal_data_t        *named;  /* List containing variables.              */
   85   size_t      tokencounter;  /* Counter for finding place in tokens.    */
   86 
   87   /* Operating mode: */
   88   int        wcs_collapsed;  /* If the internal WCS is already collapsed.*/
   89 
   90   /* Internal: */
   91   struct operand *operands;  /* The operands linked list.               */
   92   time_t           rawtime;  /* Starting time of the program.           */
   93 };
   94 
   95 
   96 
   97 
   98 
   99 #endif