CROP(1)
πΈ 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.0in 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 theEXTNAMEkeyword 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 onstdout.-T,--type=STRβ type of output: e.g.,int16,float32, etc... theetc...is doing a lot of work but we move.--wcslinearmatrix=STRβ WCS linear matrix of output, either'pc'or'cd'.-X,--widthinpixβ--widthis 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 fileSTRimmediately.--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 isSTR.-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
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
- 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