summaryrefslogtreecommitdiffstats
path: root/funtools/doc/pod/funimagerowget.pod
blob: 91c776aeff27e208632b06a283f97c0e49cf0597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
=pod

=head1 NAME



B<FunImageRowGet - get row(s) of an image>



=head1 SYNOPSIS





  #include <funtools.h>

  void *FunImageRowGet(Fun fun, void *buf, int rstart, int rstop,
                       char *plist)





=head1 DESCRIPTION




The B<FunImageRowGet()> routine returns one or more image rows
from the specified section of a Funtools data file.  If the input data
are of type image, the array is generated by extracting the specified
image rows and then binning them according to the specified bin
factor.  If the input data are contained in a binary table or raw
event file, the rows are binned on the columns specified by the
B<bincols=> keyword (using appropriate default columns as needed),
after which the image section and bin factors are applied.


The first argument is the Funtools handle returned by 
FunOpen().  The second B<buf>
argument is a pointer to a data buffer to fill. If NULL is specified,
FunImageGet() will allocate a buffer of the appropriate size.


The third and fourth arguments specify the first and last row to
retrieve.  Rows are counted starting from 1, up to the value of
FUN_YMAX(fun).  The final B<plist> (i.e., parameter list) argument
is a string containing one or more comma-delimited
B<keyword=value> parameters.  It can be used to specify the return
data type using the B<bitpix=> keyword.  If no such keyword is
specified in the plist string, the data type of the image is the same
as the data type of the original input file, or is of type int for
FITS binary tables.


If the B<bitpix=>value is supplied in the plist string, the data
type of the returned image will be one of the supported FITS image
data types:


=over 4




=item *

8 unsigned char


=item *

16 short


=item *

32 int


=item *

-32 float


=item *

-64 double


=back




For example:

  double *drow;
  Fun fun;
  ... 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);
      /* reverse the line */
      for(j=1; j<=dim1; j++){
        ... process drow[j-1] ...
      }
  }
  ...



On success, a pointer to the image buffer is returned. (This will be
the same as the second argument, if NULL is not passed to the latter.)
On error, NULL is returned.  Note that the considerations described
above for specifying binning columns in 
FunImageGet() also apply to
B<FunImageRowGet()>.




=head1 SEE ALSO



See funtools(n) for a list of Funtools help pages


=cut