ARITHMETIC(1)
ARITHMETIC π (that's the arithmetic(1) manual page, bestie, living in the User Commands section)
okay so. pull up a chair. π«Ά
β¨ NAME β¨
Arithmetic β arithmetic operations on images and numbers π
πΈ SYNOPSIS πΈ
astarithmetic [OPTION...] ASTRdata or number [ASTRdata] OPERATOR ...
π¦ DESCRIPTION π¦
So Arithmetic is part of GNU Astronomy Utilities 0.24, and what it does is literally the title: it does arithmetic operations on one or multiple images and numbers. π The way it works is you just hand it the name of the image, plus the arithmetic operators, plus any numbers you need, all as arguments. And the extensions of each input? Those get specified with (possibly multiple) calls to the --hdu option. one option call per input, iykyk.
Okay and here's the thing you HAVE to know: right now Arithmetic only supports postfix notation, aka reverse polish notation. So if you want the result of 5+6, you write it as 5 6 +. And if you want the average of two images, you write a.fits b.fits + 2 / β or, way simpler, you just use the average operator like a.fits b.fits average. The manual has more deets if you want them. β¨
Arithmetic recognizes a large collection of standard operators, and I mean large:
- basic arithmetic (e.g.,
+,-,x,/) - mathematical (e.g.,
abs,pow,sqrt,log) - statistical (
minvalue,min,max,average) - comparison (e.g.,
lt,le,gt) - logical (e.g.,
and,or,not) - the full set of bitwise operators
- numeric type conversion operators to all known types
and to get the complete list with descriptions of every single operator, run this (then hit the SPACE key or the arrow keys to scroll down, and q to get back to your command-line, no cap):
$ info gnuastro "Arithmetic operators"
For more info, run any of the following commands. and like, especially the second one β it has a very comprehensive explanation of how Arithmetic gets invoked: the expected input(s), the output(s), and a full description of every option. π
All options and their values:
$ astarithmetic -P
Inputs/Outputs and options:
$ info astarithmetic
Full section in manual/book:
$ info Arithmetic
Full Gnuastro manual/book:
$ info gnuastro
And if the manual just isn't giving you the answer you need, you can get direct help from experienced Gnuastro users and developers. for more info, run:
$ info help-gnuastro
π OPTIONS π
Arithmetic options, babes. here we go, all of them, no skipping:
π Input:
--arguments=STRβ plain-text file with command-line arguments.--envseedβ use theGSL_RNG_SEEDenv. for themknoiseoperator.-g,--globalhdu=STRβ use this HDU for all inputs, and ignore--hdu.-h,--hdu=STR/INTβ Nth call, used for the HDU of the Nth input FITS.-I,--ignorecaseβ ignore case when matching/searching columns.--searchin=STRβ select column(s):'name','unit','comment'.-w,--wcsfile=FITSβ file to use for the output's WCS.-W,--wcshdu=STRβ HDU/extension to use for the output's WCS.
π§ Tessellation (tile grid):
--interpmetric=STRβ interpolation metric (radial,manhattan).
π Output:
--appendβ if the output file exists, append to the existing HDUs.-a,--writeallβ write all remaining data in the output.-c,--metacomment=STRβ internal comments (FITS images:COMMENTkeyword).-D,--dontdeleteβ don't delete the output if it exists.-K,--keepinputdirβ keep the input directory for automatic output.-n,--metaname=STRβ internal name (FITS images:EXTNAMEkeyword).--outfitsnocommitβ no Git commit in the 0-th HDU of the output FITS.--outfitsnoconfigβ no metadata in the 0-th HDU of the output FITS.--outfitsnodateβ no'DATE'in the 0-th HDU of the output FITS.--outfitsnoversionsβ no versions in the 0-th HDU of the output FITS.-o,--output=STRβ output file name.-O,--onedasimageβ write 1D outputs as an image, not a table.-s,--onedonstdoutβ write 1D output on stdout, not in a table.--tableformat=STRβ table fmt:'fits-ascii','fits-binary','txt'.-u,--metaunit=STRβ internal units (FITS images:BUNITkeyword).--wcslinearmatrix=STRβ WCS linear matrix of the output ('pc'or'cd').
π Operating modes:
-?,--helpβ give this help list.--checkconfigβ list all config files and variables read.--citeβ BibTeX citation for this program.--config=STRβ read configuration file STR immediately.--config-prefix=STRβ custom prefix of option names in config files.--lastconfigβ do not parse any more configuration files.--logβ information about output(s) in a log file.--minmapsize=INTβ min. bytes to avoid RAM automatically.-N,--numthreads=INTβ number of CPU threads to use.--onlyversion=STRβ only run if the program version is STR.-P,--printparamsβ print parameter values to be used and abort.--quietmmapβ don't print an mmap'd file's name and size.-q,--quietβ only report errors, remain quiet about steps.-S,--setdirconfβ set default values for this directory and abort.--usageβ give a short usage message.-U,--setusrconfβ set default values for this user and abort.-V,--versionβ print program version.
Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. (so like, don't get cute with them, the rule applies both ways π)
GNU Astronomy Utilities home page: http://www.gnu.org/software/gnuastro/
π REPORTING BUGS π
Report bugs to bug-gnuastro@gnu.org. please do it, they wanna know π
π COPYRIGHT π
Copyright Β© 2015-2025 Free Software Foundation, Inc. License GPLv3+: GNU General public license version 3 or later.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written/developed by Mohammad Akhlaghi π«Ά
π SEE ALSO π
The full documentation for Arithmetic is maintained as a Texinfo manual. If the info and Arithmetic programs are properly installed at your site, the command
info Arithmetic
should give you access to the complete manual. periodt. π
okay bye bestie, this page came to you straight from GNU Astronomy Utilities 0.24, dated November 2025 β go do some math on your images, you absolute icon πβ¨π
π¦ where this page comes from
- epel 10: gnuastro 0.24-1.el10_3 Β· GPL-3.0-or-later AND FSFAP AND GFDL-1.3-or-later
- epel 9: gnuastro 0.24-1.el9 Β· GPL-3.0-or-later AND FSFAP AND GFDL-1.3-or-later
- nixos 26.05: gnuastro 0.24
- nixpkgs unstable: gnuastro 0.24
- ubuntu resolute: gnuastro 0.24-1 Β· GPL-3.0-or-later
- ubuntu stonking: gnuastro 0.24-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms