File: gridder.h

package info (click to toggle)
xrayutilities 1.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 12,452 kB
  • sloc: python: 29,264; ansic: 4,232; makefile: 23
file content (258 lines) | stat: -rw-r--r-- 9,159 bytes parent folder | download
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
/*
 * This file is part of xrayutilities.
 *
 * xrayutilities is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright (C) 2009 Eugen Wintersberger <eugen.wintersberger@desy.de>
 * Copyright (C) 2009-2010 Dominik Kriegner <dominik.kriegner@gmail.com>
*/

/***** xrayutilities/gridder
 * NAME
 *   gridder - module with gridder functions
 * PURPOSE
 *
 * AUTHOR
 *   Eugen Wintersberger
 ****/

#pragma once

#include <stdlib.h>
#include <stdio.h>
#include <Python.h>

/* define flags for the gridder functions */
#define NO_DATA_INIT 1
#define NO_NORMALIZATION 4
#define VERBOSE 16

/*!
\brief python interface function

Python interface function for fuzzygridder1d. This function is virtually doing
all the Python related stuff to run fuzzygridder1d function.
\param self reference to the module
\param args function arguments
\return return value of the function
*/
PyObject* pyfuzzygridder1d(PyObject *self, PyObject *args);

/*---------------------------------------------------------------------------*/
/*!
\brief 1D single threaded fuzzy gridder

\param x input x-values
\param data input data
\param n number of input points
\param nx number of steps in x-direction
\param xmin minimm along x-direction
\param xmax maximum along x-direction
\param odata output data
\param norm normalization data
\param fuzzywidth width of the data for the fuzzy assignment to bins
\param flags control falgs
*/
int fuzzygridder1d(double *x, double *data, unsigned int n,
              unsigned int nx, double xmin, double xmax,
              double *odata, double *norm, double fuzzywidth, int flags);

/*!
\brief python interface function

Python interface function for gridder1d. This function is virtually doing all
the Python related stuff to run gridder1d function.
\param self reference to the module
\param args function arguments
\return return value of the function
*/
PyObject* pygridder1d(PyObject *self, PyObject *args);

/*---------------------------------------------------------------------------*/
/*!
\brief 1D single threaded gridder

\param x input x-values
\param data input data
\param n number of input points
\param nx number of steps in x-direction
\param xmin minimm along x-direction
\param xmax maximum along x-direction
\param odata output data
\param norm normalization data
\param flags control falgs
*/
int gridder1d(double *x, double *data, unsigned int n,
              unsigned int nx, double xmin, double xmax,
              double *odata, double *norm, int flags);

/*!
\brief python interface function

Python interface function for gridder2d. This function is virtually doing all
the Python related stuff to run gridder2d function.
\param self reference to the module
\param args function arguments
\return return value of the function
*/
PyObject* pygridder2d(PyObject *self, PyObject *args);

/*---------------------------------------------------------------------------*/
/*!
\brief 2D single threaded gridder

\param x input x-values
\param y input y-values
\param data input data
\param n number of input points
\param nx number of steps in x-direction
\param ny number of steps in y-direction
\param xmin minimm along x-direction
\param xmax maximum along x-direction
\param ymin minimum along y-direction
\param ymax maximum along y-direction
\param odata output data
\param norm normalization data
\param flags control falgs
*/
int gridder2d(double *x, double *y, double *data, unsigned int n,
              unsigned int nx, unsigned int ny,
              double xmin, double xmax,
              double ymin, double ymax,
              double *odata, double *norm, int flags);

/*!
\brief python interface function

Python interface function for fuzzygridder2d. This function is virtually doing
all the Python related stuff to run the fuzzygridder2d function.
\param self reference to the module
\param args function arguments
\return return value of the function
*/
PyObject* pyfuzzygridder2d(PyObject *self, PyObject *args);

/*---------------------------------------------------------------------------*/
/*!
\brief 2D single threaded fuzzy gridder

\param x input x-values
\param y input y-values
\param data input data
\param n number of input points
\param nx number of steps in x-direction
\param ny number of steps in y-direction
\param xmin minimm along x-direction
\param xmax maximum along x-direction
\param ymin minimum along y-direction
\param ymax maximum along y-direction
\param odata output data
\param norm normalization data
\param wx fuzzy size of data along x-direction
\param wy fuzzy size of data along y-direction
\param flags control falgs
*/
int fuzzygridder2d(double *x, double *y, double *data, unsigned int n,
                   unsigned int nx, unsigned int ny,
                   double xmin, double xmax,
                   double ymin, double ymax,
                   double *odata, double *norm,
                   double wx, double wy, int flags);

/*---------------------------------------------------------------------------*/
/*!
\brief 3D gridder python interface function

Python interface function for gridder3d. This function is virtually doing all
the Python related stuff to run gridder3d function.
\param self reference to the module
\param args function arguments
\return return value of the function
*/
PyObject* pyfuzzygridder3d(PyObject *self, PyObject *args);

/*---------------------------------------------------------------------------*/
/*!
\brief single threaded 3d gridder

Gridder code rebinning scatterd data onto a regular grid in 3 dimensions.

\param x pointer to x-coordinates of input data
\param y pointer to y-coordinates of input data
\param z pointer to z-coordinates of input data
\param data pointer to input data
\param n number of input points
\param nx number of grid points along the x-direction
\param ny number of grid points along the y-direction
\param nz number of grid points along the z-direction
\param xmin minimum value of x-axis on the grid
\param xmax maximum value of x-axis on the grid
\param ymin minimum value of y-axis on the grid
\param ymax maximum value of y-axis on the grid
\param zmin minimum value of z-axis on the grid
\param zmax maximum value of z-axis on the grid
\param odata pointer to grid data (output data)
\param norm pointer to optional normalization from previous run
\param wx fuzzy width parameter in x-direction
\param wy fuzzy width parameter in y-direction
\param wz fuzzy width parameter in z-direction
\param flags gridder flags
*/
int fuzzygridder3d(double *x, double *y, double *z, double *data,
                   unsigned int n, unsigned int nx, unsigned int ny,
                   unsigned int nz, double xmin, double xmax, double ymin,
                   double ymax, double zmin, double zmax, double *odata,
                   double *norm, double wx, double wy, double wz, int flags);

/*---------------------------------------------------------------------------*/
/*!
\brief 3D gridder python interface function

Python interface function for gridder3d. This function is virtually doing all
the Python related stuff to run gridder3d function.
\param self reference to the module
\param args function arguments
\return return value of the function
*/
PyObject* pygridder3d(PyObject *self, PyObject *args);

/*---------------------------------------------------------------------------*/
/*!
\brief single threaded 3d gridder

Gridder code rebinning scatterd data onto a regular grid in 3 dimensions.

\param x pointer to x-coordinates of input data
\param y pointer to y-coordinates of input data
\param z pointer to z-coordinates of input data
\param data pointer to input data
\param n number of input points
\param nx number of grid points along the x-direction
\param ny number of grid points along the y-direction
\param nz number of grid points along the z-direction
\param xmin minimum value of x-axis on the grid
\param xmax maximum value of x-axis on the grid
\param ymin minimum value of y-axis on the grid
\param ymax maximum value of y-axis on the grid
\param zmin minimum value of z-axis on the grid
\param zmax maximum value of z-axis on the grid
\param odata pointer to grid data (output data)
\param norm pointer to optional normalization from previous run
\param flags gridder flags
*/
int gridder3d(double *x, double *y, double *z, double *data, unsigned int n,
              unsigned int nx, unsigned int ny, unsigned int nz,
              double xmin, double xmax, double ymin, double ymax,
              double zmin, double zmax,
              double *odata, double *norm, int flags);