ARITHMETIC(1)

πŸ“¦
version 0.24 Β· 5 versions
, in epel 10, epel 9, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

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 the GSL_RNG_SEED env. for the mknoise operator.
  • -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: COMMENT keyword).
  • -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: EXTNAME keyword).
  • --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: BUNIT keyword).
  • --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 Β© 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