CROP(1)

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

🌸 CROP(1) β€” User Commands 🌸

okay bestie, buckle up, this is Crop from the User Commands section of the manual, and she is iconic. she takes big astronomical datasets and just ✨ cuts little pieces out of them ✨ like a scrapbook queen. let's get into it πŸ’…


✨ NAME ✨

Crop β€” crop regions of a dataset. yes that's the whole job. she crops. she's very good at it. periodt πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

astcrop [OPTION...] [Crop-Identifier] ASTRdata ...

so it's astcrop, then your options, then maybe a Crop-Identifier, then one or more ASTRdata files. that's the whole summoning ritual 🫢


πŸ’– DESCRIPTION πŸ’–

okay so Crop is part of GNU Astronomy Utilities 0.24 β€” that's the whole squad she runs with. what she does is create cutouts, thumbnails, postage stamps, or just plain crops of region(s) from your input image(s), using either image coordinates or celestial coordinates. like, you point at a thing in the sky and she hands you a lil framed picture of it. obsessed. 🌈

if you want multiple crops at once, ngl you can't just wing it β€” a catalog must be provided. that's the rule, no cap.

and when you're in WCS mode, if the cut out covers more than one input image, then β€” and this is the slay part β€” all the overlapping input images will be stitched in the output. she literally sews the sky together for you πŸ‘‘


🧚 need more info? run these, bestie 🧚

for more information, please run any of the following commands. and listen, the second one is the real main character β€” it has a very comprehensive explanation of Crop's invocation: expected input(s), output(s), and a full description of all the options. iykyk.

All options and their values:

$ astcrop -P

Inputs/Outputs and options:

$ info astcrop

Full section in manual/book:

$ info Crop

Full Gnuastro manual/book:

$ info gnuastro

and if you couldn't find your answer in the manual 😭 you can get direct help from experienced Gnuastro users and developers. for more information, please run:

$ info help-gnuastro

πŸ‘‘ CROP OPTIONS πŸ‘‘

everything she can do, in one big beautiful list πŸ’œ

πŸ“ Input

  • --hendwcs=INT β€” header keyword number to stop reading WCS. that's where the WCS reading taps out.
  • --hstartwcs=INT β€” header keyword number to start reading WCS. and that's where it begins ✨
  • -h, --hdu=STR/INT β€” extension name or number of (all) input(s). yes, all of them.
  • -O, --mode=STR β€” coordinate mode, and your two choices are 'img' or 'wcs'. pick your vibe.
  • -z, --zeroisnotblank β€” 0.0 in float or double images are not blank. so those zeros are real data, bestie, don't let anyone tell you otherwise πŸ’…

πŸŽ€ Output

  • -a, --metaname=STR β€” name of output HDU (that's the EXTNAME keyword in FITS, for the FITS girlies).
  • -A, --append β€” if output exists, append crop to existing HDUs. no overwriting, just vibing.
  • -b, --noblank β€” remove parts of the crop box out of input image. bye bye blank bits πŸ‘‹
  • -D, --dontdelete β€” don't delete output if it exists. she respects your files.
  • -K, --keepinputdir β€” keep input directory for automatic output. keep it cute, keep it organized.
  • --outfitsnocommit β€” no Git commit in 0-th HDU of output FITS.
  • --outfitsnoconfig β€” no metadata in 0-th HDU of output FITS.
  • --outfitsnodate β€” no 'DATE' in 0-th HDU of output FITS.
  • --outfitsnoversions β€” no versions in 0-th HDU of output FITS.
  • -o, --output=STR β€” output file name. name her something pretty 🫢
  • --primaryimghdu β€” write crop in primary/zero-th HDU of output.
  • -p, --suffix=STR β€” suffix (postfix) of cropped images.
  • --tableformat=STR β€” table fmt, and the options are 'fits-ascii', 'fits-binary', 'txt'.
  • -t, --oneelemstdout β€” print one element's value on stdout.
  • -T, --type=STR β€” type of output: e.g., int16, float32, etc... the etc... is doing a lot of work but we move.
  • --wcslinearmatrix=STR β€” WCS linear matrix of output, either 'pc' or 'cd'.
  • -X, --widthinpix β€” --width is in pixels (even in WCS mode). yes, even then. she said what she said.

🌸 Crop by center

  • --checkcenter=FLT/INT β€” width (in pixels) of box at center to check.
  • -c, --center=FLT[,...] β€” central coordinates of a single crop.
  • -w, --width=FLT[,...] β€” width when crop is defined by its center.

πŸ¦‹ Crop by center (when a catalog is given)

  • --cathdu=STR/INT β€” HDU of catalog, if it is a FITS table.
  • -C, --catalog=FITS/TXT β€” input catalog filename. give her the list πŸ“‹
  • -I, --ignorecase β€” ignore case in matching/searching columns. Name? name? same thing, bestie.
  • -n, --namecol=STR/INT β€” column no./info of crop filename (no suffix).
  • --searchin=STR β€” select column(s), from 'name', 'unit', 'comment'.
  • -x, --coordcol=STR/INT β€” column no./info containing coordinates.

πŸ’… Crop by region

  • -l, --polygon=FLT,FLT[:...] β€” polygon vertices, also a DS9 region file. yes she does both, she's versatile ✨
  • --polygonout β€” keep the polygon's outside, mask the inside. yes really, the inverse. iconic.
  • --polygonsort β€” sort polygon vertices as counter-clockwise.
  • -s, --section=STR β€” image section string specifying crop range.

⭐ Operating modes

  • -?, --help β€” give this help list.
  • --checkconfig β€” list all config files and variables read.
  • --cite β€” BibTeX citation for this program. cite her, she deserves it πŸŽ€
  • --config=STR β€” read configuration file STR immediately.
  • --config-prefix=STR β€” custom prefix of option names config files.
  • --lastconfig β€” do not parse any more configuration files. that's it, we're done here.
  • --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. go fast, bestie πŸ”₯
  • --onlyversion=STR β€” only run if the program version is STR.
  • -P, --printparams β€” print parameter values to be used and abort.
  • --quietmmap β€” don't print mmap'd file's name and size.
  • -q, --quiet β€” only report errors, remain quiet about steps. the introvert mode πŸ’€
  • -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, if the long one needs a value, the short one needs it too. no shortcuts around the rules, bestie.

GNU Astronomy Utilities home page: http://www.gnu.org/software/gnuastro/


😭 REPORTING BUGS

found a bug? it happens to the best of us. report bugs to bug-gnuastro@gnu.org. she wants to 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. (read that again, bestie β€” no cap, no warranty 🚨)

Written/developed by Mohammad Akhlaghi β€” thank you for your service king πŸ‘‘


🌈 SEE ALSO

The full documentation for Crop is maintained as a Texinfo manual. If the info and Crop programs are properly installed at your site, the command

info Crop

should give you access to the complete manual. go read it, it's giving encyclopedia but make it astronomy πŸ¦‹


okay and one last thing β€” this whole page is brought to you by GNU Astronomy Utilities 0.24, dated November 2025. yes we're literally in the future. slay. go crop something gorgeous πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from