
gridloop1 in C; safety checks
if (a->nd != 2 || a->descr->type_num != PyArray_DOUBLE) {
PyErr_Format(PyExc_ValueError,
"a array is %d-dimensional or not of type float", a->nd);
return NULL;
}
nx = a->dimensions[0]; ny = a->dimensions[1];
if (xcoor->nd != 1 || xcoor->descr->type_num != PyArray_DOUBLE ||
xcoor->dimensions[0] != nx) {
PyErr_Format(PyExc_ValueError,
"xcoor array has wrong dimension (%d), type or length (%d)",
xcoor->nd,xcoor->dimensions[0]);
return NULL;
}
if (ycoor->nd != 1 || ycoor->descr->type_num != PyArray_DOUBLE ||
ycoor->dimensions[0] != ny) {
PyErr_Format(PyExc_ValueError,
"ycoor array has wrong dimension (%d), type or length (%d)",
ycoor->nd,ycoor->dimensions[0]);
return NULL;
}
if (!PyCallable_Check(func1)) {
PyErr_Format(PyExc_TypeError,
"func1 is not a callable function");
return NULL;
}


