1funimagerowput(3) SAORD Documentation funimagerowput(3)
2
3
4
6 FunImageRowPut - put row(s) of an image
7
9 #include <funtools.h>
10
11 void *FunImageRowPut(Fun fun, void *buf, int rstart, int rstop,
12 int dim1, int dim2, int bitpix, char *plist)
13
15 The FunImageRowPut() routine writes one or more image rows to the spec‐
16 ified FITS image file. The first argument is the Funtools handle
17 returned by FunOpen(). The second buf argument is a pointer to the row
18 data buffer, while the third and fourth arguments specify the starting
19 and ending rows to write. Valid rows values range from 1 to dim2,
20 i.e., row is one-valued.
21
22 The dim1and dim2 arguments that follow specify the dimensions, where
23 dim1 corresponds to naxis1 and dim2 corresponds to naxis2. The bitpix
24 argument data type of the image and can have the following FITS-stan‐
25 dard values:
26
27 · 8 unsigned char
28
29 · 16 short
30
31 · 32 int
32
33 · -32 float
34
35 · -64 double
36
37 For example:
38
39 double *drow;
40 Fun fun, fun2;
41 ... open files ...
42 /* get section dimensions */
43 FunInfoGet(fun, FUN_SECT_DIM1, &dim1, FUN_SECT_DIM2, &dim2, 0);
44 /* allocate one line's worth */
45 drow = malloc(dim1*sizeof(double));
46 /* retrieve and process each input row (starting at 1) */
47 for(i=1; i <= dim2; i++){
48 if( !FunImageRowGet(fun, drow, i, i, "bitpix=-64") )
49 gerror(stderr, "can't FunImageRowGet: %d %s\n", i, iname);
50 ... process drow ...
51 if( !FunImageRowPut(fun2, drow, i, i, 64, NULL) )
52 gerror(stderr, "can't FunImageRowPut: %d %s\n", i, oname);
53 }
54 ...
55
56 The data are assumed to be in the native machine format and will auto‐
57 matically be swapped to big-endian FITS format if necessary. This
58 behavior can be over-ridden with the convert=[true⎪false] keyword in
59 the plist param list string.
60
61 When you are finished writing the image, you should call FunFlush() to
62 write out the FITS image padding. However, this is not necessary if you
63 subsequently call FunClose() without doing any other I/O to the FITS
64 file.
65
67 See funtools(n) for a list of Funtools help pages
68
69
70
71version 1.4.2 January 2, 2008 funimagerowput(3)