29 #include <grass/gis.h>
30 #include <grass/glocale.h>
31 #include <grass/bitmap.h>
33 #include <grass/interpf.h>
36 #define CEULER .57721566
41 double zmin,
double zmax,
42 double *zminac,
double *zmaxac,
43 double *gmin,
double *gmax,
44 double *c1min,
double *c1max,
double *c2min,
double *c2max,
63 double x_or = data->
x_orig;
64 double y_or = data->
y_orig;
69 static double *w2 =
NULL;
70 static double *
w =
NULL;
73 double stepix, stepiy, xx, xg, yg, xx2;
74 double rfsta2, wm, dx, dy, dxx, dyy, dxy,
h, bmgd1,
78 int ngstc, nszc, ngstr, nszr;
81 static int first_time_z = 1;
83 double fstar2 = params->
fi * params->
fi / 4.;
84 double tfsta2, tfstad;
85 double ns_res, ew_res;
86 double rsin = 0, rcos = 0, teta, scale = 0;
90 teta = params->
theta / 57.295779;
103 tfsta2 = (fstar2 * 2.) / dnorm;
104 tfstad = tfsta2 / dnorm;
110 stepix = ew_res / dnorm;
111 stepiy = ns_res / dnorm;
115 cond1 = ((params->
adx !=
NULL) || (params->
ady !=
NULL) || cond2);
118 if (!(w = (
double *)G_malloc(
sizeof(
double) * (params->
KMAX2 + 9)))) {
124 if (!(w2 = (
double *)G_malloc(
sizeof(
double) * (params->
KMAX2 + 9)))) {
133 ngstc = (
int)(x_or / ew_res + 0.5) + 1;
134 nszc = ngstc + n_cols - 1;
135 ngstr = (
int)(y_or / ns_res + 0.5) + 1;
136 nszr = ngstr + n_rows - 1;
139 for (k = ngstr; k <= nszr; k++) {
140 offset = offset1 * (k - 1);
141 yg = (k - ngstr) * stepiy + stepiy / 2.;
143 wm = yg - points[m - 1].
y;
147 for (l = ngstc; l <= nszc; l++) {
150 bmask =
BM_get(bitmask, l - 1, k - 1);
152 xg = (l - ngstc) * stepix + stepix / 2.;
163 xx = xg - points[m - 1].
x;
166 xxr = xx * rcos + w[m] * rsin;
167 yyr = w[m] * rcos - xx * rsin;
170 r2 = scale * xx2 + w2[m];
172 rfsta2 = scale * xx2 + w2[m];
178 rfsta2 = xx2 + w2[m];
181 h = h + b[m] * params->
interp(r, params->
fi);
186 dx = dx + bmgd1 * xx;
187 dy = dy + bmgd1 * w[m];
190 dxx = dxx + bmgd2 * xx2 + bmgd1;
191 dyy = dyy + bmgd2 * w2[m] + bmgd1;
192 dxy = dxy + bmgd2 * xx * w[m];
202 *zmaxac = *zminac = zz;
204 *zmaxac =
amax1(zz, *zmaxac);
205 *zminac =
amin1(zz, *zminac);
206 if ((zz > zmax + 0.1 * (zmax - zmin))
207 || (zz < zmin - 0.1 * (zmax - zmin))) {
212 G_warning(_(
"Overshoot - increase in tension suggested. "
213 "Overshoot occures at (%d,%d) cell. "
214 "Z-value %f, zmin %f, zmax %f."),
215 l, k, zz, zmin, zmax);
219 params->
az[
l] = (FCELL) zz;
222 params->
adx[
l] = (FCELL) (-dx * tfsta2);
223 params->
ady[
l] = (FCELL) (-dy * tfsta2);
225 params->
adxx[
l] = (FCELL) (-dxx * tfstad);
226 params->
adyy[
l] = (FCELL) (-dyy * tfstad);
227 params->
adxy[
l] = (FCELL) (-dxy * tfstad);
248 if (cond1 && (params->
deriv != 1)) {
249 if (params->
secpar(params, ngstc, nszc, k, bitmask,
250 gmin, gmax, c1min, c1max, c2min, c2max, cond1,
255 offset2 = (offset + ngstc - 1) *
sizeof(FCELL);
256 if (params->
wr_temp(params, ngstc, nszc, offset2) < 0)
int BM_get(struct BM *map, int x, int y)
Gets 'val' from the bitmap.
void G_set_d_null_value(DCELL *dcellVals, int numVals)
double amax1(double, double)
double amin1(double, double)
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
int IL_grid_calc_2d(struct interp_params *params, struct quaddata *data, struct BM *bitmask, double zmin, double zmax, double *zminac, double *zmaxac, double *gmin, double *gmax, double *c1min, double *c1max, double *c2min, double *c2max, double *ertot, double *b, int offset1, double dnorm)
tuple h
panel.defaultSize = wx.CheckBox(panel, id = wx.ID_ANY, label = _("Use default size")) panel...