funimagerowput(3)
πΈ NAME πΈ
funimagerowput β bestie, it puts row(s) of an image π
Okay so real quick before we get into it: this is from the SAORD Documentation set, it lives in manual section 3 as funimagerowput(3), and it's lowkey the row-writing counterpart to FunImageRowGet(). Let's go π«Ά
β¨ SYNOPSIS β¨
#include <funtools.h>
void *FunImageRowPut(Fun fun, void *buf, int rstart, int rstop,
int dim1, int dim2, int bitpix, char *plist)
π DESCRIPTION π
So the FunImageRowPut() routine writes one or more image rows to the FITS image file you specified. It's giving "here's a row, pls put it in the image" and honestly? Iconic.
- The first argument is the Funtools handle that
FunOpen()gave you back. That's yourfun. - The second argument,
buf, is a pointer to the row data buffer. That's where your pixels are chillin'. - The third and fourth arguments are
rstartandrstopβ the starting and ending rows to write. Valid row values range from1todim2, like, row is one-valued. Not zero-valued. One. Periodt π
Then the dim1 and dim2 arguments that follow specify the dimensions, where dim1 corresponds to naxis1 and dim2 corresponds to naxis2. (Yes bestie, naxis1 and naxis2, exactly those. Don't come for me, that's just how FITS is set up π)
The bitpix argument is the data type of the image, and it can have the following FITS-standard values:
8β unsigned char16β short32β int-32β float-64β double
π for example π
Not me giving you a whole example, but here you go, it's genuinely useful:
double *drow;
Fun fun, fun2;
... open files ...
/* get section dimensions */
FunInfoGet(fun, FUN_SECT_DIM1, &dim1, FUN_SECT_DIM2, &dim2, 0);
/* allocate one line's worth */
drow = malloc(dim1*sizeof(double));
/* retrieve and process each input row (starting at 1) */
for(i=1; i <= dim2; i++){
if( !FunImageRowGet(fun, drow, i, i, "bitpix=-64") )
gerror(stderr, "can't FunImageRowGet: %d %s\n", i, iname);
... process drow ...
if( !FunImageRowPut(fun2, drow, i, i, 64, NULL) )
gerror(stderr, "can't FunImageRowPut: %d %s\n", i, oname);
}
...
π« the whole endian situation π«
The data are assumed to be in the native machine format and will automatically be swapped to big-endian FITS format if necessary. The way that it just handles that for you?? Obsessed. π§
This behavior can be over-ridden with the convert=[trueβͺfalse] keyword in the plist param list string. That's your override lever, bestie, use it wisely.
π¨ when you're done, flush! π¨
When you are finished writing the image, you should call FunFlush() to write out the FITS image padding. Like, actually do it. π
However, this is not necessary if you subsequently callFunClose()without doing any other I/O to the FITS file. So ifFunClose()is your next move and nothing else touches that file, you're fine β no cap.
π¦ SEE ALSO π¦
See funtools(7) for a list of Funtools help pages. Go read it, it's the whole friend group π
And that's the page, bestie π This was version 1.4.5, dated April 14, 2011, from the SAORD Documentation crew β and yes, funimagerowput(3) is the manual page you just read. Slay, go write some rows β¨
π¦ where this page comes from
- debian bookworm: libfuntools-dev 1.4.8-1 Β· GPL
- debian trixie: libfuntools-dev 1.4.8-1.1+b2 Β· GPL
- ubuntu jammy: libfuntools-dev 1.4.8-1 Β· GPL
- ubuntu noble: libfuntools-dev 1.4.8-1.1build2 Β· GPL
- ubuntu questing: libfuntools-dev 1.4.8-2
- ubuntu resolute: libfuntools-dev 1.4.8-2build1 Β· GPL
- ubuntu stonking: libfuntools-dev 1.4.8-2build1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms