1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
/*********************************************************************
Arithmetic - Do arithmetic operations on images.
Arithmetic is part of GNU Astronomy Utilities (Gnuastro) package.
Original author:
Mohammad Akhlaghi <mohammad@akhlaghi.org>
Contributing author(s):
Copyright (C) 2015-2025 Free Software Foundation, Inc.
Gnuastro is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
Gnuastro is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gnuastro. If not, see <http://www.gnu.org/licenses/>.
**********************************************************************/
#ifndef ARGS_H
#define ARGS_H
/* Definition of program-specific options. */
struct argp_option program_options[] =
{
/* Input options. */
{
"globalhdu",
UI_KEY_GLOBALHDU,
"STR",
0,
"Use this HDU for all inputs, ignore '--hdu'.",
GAL_OPTIONS_GROUP_INPUT,
&p->globalhdu,
GAL_TYPE_STRING,
GAL_OPTIONS_RANGE_ANY,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"wcsfile",
UI_KEY_WCSFILE,
"FITS",
0,
"File to use for output's WCS.",
GAL_OPTIONS_GROUP_INPUT,
&p->wcsfile,
GAL_TYPE_STRING,
GAL_OPTIONS_RANGE_ANY,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"wcshdu",
UI_KEY_WCSHDU,
"STR",
0,
"HDU/extension to use for output's WCS.",
GAL_OPTIONS_GROUP_INPUT,
&p->wcshdu,
GAL_TYPE_STRING,
GAL_OPTIONS_RANGE_ANY,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"envseed",
UI_KEY_ENVSEED,
0,
0,
"Use GSL_RNG_SEED env. for mknoise operator.",
GAL_OPTIONS_GROUP_INPUT,
&p->envseed,
GAL_OPTIONS_NO_ARG_TYPE,
GAL_OPTIONS_RANGE_0_OR_1,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"arguments",
UI_KEY_ARGUMENTS,
"STR",
0,
"Plain-text file with command-line arguments.",
GAL_OPTIONS_GROUP_INPUT,
&p->arguments,
GAL_TYPE_STRING,
GAL_OPTIONS_RANGE_ANY,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
/* Output options. */
{
"onedasimage",
UI_KEY_ONEDASIMAGE,
0,
0,
"Write 1D outputs as an image, not a table.",
GAL_OPTIONS_GROUP_OUTPUT,
&p->onedasimage,
GAL_OPTIONS_NO_ARG_TYPE,
GAL_OPTIONS_RANGE_0_OR_1,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"onedonstdout",
UI_KEY_ONEDONSTDOUT,
0,
0,
"Write 1D output on stdout, not in a table.",
GAL_OPTIONS_GROUP_OUTPUT,
&p->onedonstdout,
GAL_OPTIONS_NO_ARG_TYPE,
GAL_OPTIONS_RANGE_0_OR_1,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"metaname",
UI_KEY_METANAME,
"STR",
0,
"Internal name (FITS images: EXTNAME keyword).",
GAL_OPTIONS_GROUP_OUTPUT,
&p->metaname,
GAL_TYPE_STRLL,
GAL_OPTIONS_RANGE_ANY,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"metaunit",
UI_KEY_METAUNIT,
"STR",
0,
"Internal units (FITS images: BUNIT keyword).",
GAL_OPTIONS_GROUP_OUTPUT,
&p->metaunit,
GAL_TYPE_STRLL,
GAL_OPTIONS_RANGE_ANY,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"metacomment",
UI_KEY_METACOMMENT,
"STR",
0,
"Internal comments (FITS images: COMMENT keyword).",
GAL_OPTIONS_GROUP_OUTPUT,
&p->metacomment,
GAL_TYPE_STRLL,
GAL_OPTIONS_RANGE_ANY,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"writeall",
UI_KEY_WRITEALL,
0,
0,
"Write all remaining data in the output.",
GAL_OPTIONS_GROUP_OUTPUT,
&p->writeall,
GAL_OPTIONS_NO_ARG_TYPE,
GAL_OPTIONS_RANGE_0_OR_1,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{
"append",
UI_KEY_APPEND,
0,
0,
"If output file exists, append to existing HDUs.",
GAL_OPTIONS_GROUP_OUTPUT,
&p->append,
GAL_OPTIONS_NO_ARG_TYPE,
GAL_OPTIONS_RANGE_0_OR_1,
GAL_OPTIONS_NOT_MANDATORY,
GAL_OPTIONS_NOT_SET
},
{0}
};
/* Define the child argp structure. */
struct argp
gal_options_common_child = {gal_commonopts_options,
gal_options_common_argp_parse,
NULL, NULL, NULL, NULL, NULL};
/* Use the child argp structure in list of children (only one for now). */
struct argp_child
children[]=
{
{&gal_options_common_child, 0, NULL, 0},
{0, 0, 0, 0}
};
/* Set all the necessary argp parameters. */
struct argp
thisargp = {program_options, parse_opt, args_doc, doc, children, NULL, NULL};
#endif
|