imcopy(1)

πŸ’– imcopy(1) β€” the copy-paste but make it FITS πŸ’–

a User Commands girly, living in section 1 of the manual, serving absolute cromulence


✨ NAME ✨

imcopy β€” bestie, it copies FITS images. that's the whole job. and it does it flawlessly.


🌸 SYNOPSIS 🌸

imcopy inputImage outputImage[compress]

like. two files. in goes one, out comes the other. optionally with the little [compress] sprinkle on the end. iykyk πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea, pookie. imcopy takes an input image and copies it to an output image, and along the way it can optionally compress or uncompress that image. slay.

if you append the [compress] qualifier onto the end of the output file name, then the input image gets compressed using the tile-compressed format. and what does that mean? it means the image gets chopped up into rectangular tiles, and every single tile of pixels gets compressed and stashed away in a variable-length row of a binary table. it's giving ✨ efficient ✨.

and if you don't put the [compress] qualifier on there, but your input image is already in tile-compressed format? then the output image comes out uncompressed. automatic glow-down, but make it lossless-ish.


if you tack an extension name or number onto the input file name, wrapped up all cozy in square brackets, then only that single extension gets copied to the output file. just the one. no extras. main character only πŸ‘‘

otherwise? every single extension in the input file gets processed one at a time, in turn, and copied over to the output file. the whole friend group is coming 🫢


the full syntax of the compression qualifier is, and i need you to read this slowly because it's the moment:

[compress ALGORITHM TDIM1,TDIM2,...; NOISE_BITS]

where the allowed ALGORITHM values are Rice, GZIP, and PLIO, and TDIMn is the size of the compression tile in each dimension. and NOISE_BITS is 1, 2, 3, or 4, and it controls how much noise suppression happens when you're compressing floating point images. no cap.

πŸ’€ heads up bestie: it may be necessary to enclose the file names in single quote characters on the Unix command line. the shell does NOT play about square brackets. protect your filenames.

πŸŽ€ EXAMPLES πŸŽ€

1. πŸ’… the default diva

imcopy image.fit 'cimage.fit[compress]'

this compresses the input image using the default parameters. and the defaults are: the Rice compression algorithm, and row by row tiles. no thoughts, just vibes, and it ate.

2. 🌈 the uncompress arc

imcopy cimage.fit image2.fit

this uncompresses the image created in the first example. and image2.fit should be identical to image.fit if the image has an integer datatype. but β€” and listen β€” there will be small differences in the pixel values if it is a floating point image. floating point is a little chaotic like that. it's not a bug it's a personality πŸ™ˆ

3. πŸ”₯ the custom parameter serve

imcopy image.fit 'cimage.fit[compress GZIP 100,100;4]'

this compresses the input image using the following parameters:

  • GZIP compression algorithm
  • 100 X 100 pixel compression tiles
  • noise_bits = 4 (only used with floating point images)

obsessed. genuinely obsessed. ✨


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie!! πŸŽ€ this was CFITSIO version 3.370, dated April 2014, and it's still out here compressing tiles like the icon it is. periodt. πŸ’–βœ¨πŸ¦‹