Newer
Older
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_8, function);
}
}
__pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5);
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(PyObject_SetItem(__pyx_v_geos_data, __pyx_v_v, __pyx_t_4) < 0)) __PYX_ERR(0, 86, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
*
* for v in geos_data:
* if not geos_data[v].flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
* geos_data[v] = np.ascontiguousarray(geos_data[v])
/* "ancillary.pyx":84
* geos_data):
*
* for v in geos_data: # <<<<<<<<<<<<<<
* if not geos_data[v].flags['C_CONTIGUOUS']:
* geos_data[v] = np.ascontiguousarray(geos_data[v])
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "ancillary.pyx":88
* geos_data[v] = np.ascontiguousarray(geos_data[v])
* cdef float[::1] tpw_mv = geos_data['tpw'] # <<<<<<<<<<<<<<
* cdef float[::1] snowfr_mv = geos_data['snowfr']
* cdef float[::1] icefr_mv = geos_data['icefr']
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_tpw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 88, __pyx_L1_error)
__pyx_v_tpw_mv = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
* cdef float[::1] tpw_mv = geos_data['tpw']
* cdef float[::1] snowfr_mv = geos_data['snowfr'] # <<<<<<<<<<<<<<
* cdef float[::1] icefr_mv = geos_data['icefr']
* cdef float[::1] ocnfr_mv = geos_data['ocnfr']
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_snowfr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_snowfr_mv = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
* cdef float[::1] tpw_mv = geos_data['tpw']
* cdef float[::1] snowfr_mv = geos_data['snowfr']
* cdef float[::1] icefr_mv = geos_data['icefr'] # <<<<<<<<<<<<<<
* cdef float[::1] ocnfr_mv = geos_data['ocnfr']
* cdef float[::1] landicefr_mv = geos_data['landicefr']
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_icefr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_icefr_mv = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
* cdef float[::1] snowfr_mv = geos_data['snowfr']
* cdef float[::1] icefr_mv = geos_data['icefr']
* cdef float[::1] ocnfr_mv = geos_data['ocnfr'] # <<<<<<<<<<<<<<
* cdef float[::1] landicefr_mv = geos_data['landicefr']
* cdef float[::1] sfct_mv = geos_data['sfct']
*/
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_ocnfr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ocnfr_mv = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
* cdef float[::1] icefr_mv = geos_data['icefr']
* cdef float[::1] ocnfr_mv = geos_data['ocnfr']
* cdef float[::1] landicefr_mv = geos_data['landicefr'] # <<<<<<<<<<<<<<
* cdef float[::1] sfct_mv = geos_data['sfct']
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_landicefr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_landicefr_mv = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
* cdef float[::1] ocnfr_mv = geos_data['ocnfr']
* cdef float[::1] landicefr_mv = geos_data['landicefr']
* cdef float[::1] sfct_mv = geos_data['sfct'] # <<<<<<<<<<<<<<
* get_GEOS(&lat[0], &lon[0], res, startTime, anc_dir, geos1, geos2, geos_lnd, geos_ocn, geos_cnst,
__pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_sfct); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_sfct_mv = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
* cdef float[::1] sfct_mv = geos_data['sfct']
* get_GEOS(&lat[0], &lon[0], res, startTime, anc_dir, geos1, geos2, geos_lnd, geos_ocn, geos_cnst, # <<<<<<<<<<<<<<
* &tpw_mv[0], &snowfr_mv[0], &icefr_mv[0], &ocnfr_mv[0], &landicefr_mv[0], &sfct_mv[0])
*
*/
* get_GEOS(&lat[0], &lon[0], res, startTime, anc_dir, geos1, geos2, geos_lnd, geos_ocn, geos_cnst,
* &tpw_mv[0], &snowfr_mv[0], &icefr_mv[0], &ocnfr_mv[0], &landicefr_mv[0], &sfct_mv[0]) # <<<<<<<<<<<<<<
*
* geos_dict = {'tpw': geos_data['tpw'],
__pyx_t_16 = 0;
__pyx_t_17 = 0;
__pyx_t_18 = 0;
* cdef float[::1] sfct_mv = geos_data['sfct']
* get_GEOS(&lat[0], &lon[0], res, startTime, anc_dir, geos1, geos2, geos_lnd, geos_ocn, geos_cnst, # <<<<<<<<<<<<<<
* &tpw_mv[0], &snowfr_mv[0], &icefr_mv[0], &ocnfr_mv[0], &landicefr_mv[0], &sfct_mv[0])
*
*/
get_GEOS((&(*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_lat.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_lat.diminfo[0].strides))), (&(*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_lon.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_lon.diminfo[0].strides))), __pyx_v_res, __pyx_v_startTime, __pyx_v_anc_dir, __pyx_v_geos1, __pyx_v_geos2, __pyx_v_geos_lnd, __pyx_v_geos_ocn, __pyx_v_geos_cnst, (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_tpw_mv.data) + __pyx_t_13)) )))), (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_snowfr_mv.data) + __pyx_t_14)) )))), (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_icefr_mv.data) + __pyx_t_15)) )))), (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_ocnfr_mv.data) + __pyx_t_16)) )))), (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_landicefr_mv.data) + __pyx_t_17)) )))), (&(*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_sfct_mv.data) + __pyx_t_18)) )))));
* &tpw_mv[0], &snowfr_mv[0], &icefr_mv[0], &ocnfr_mv[0], &landicefr_mv[0], &sfct_mv[0])
*
* geos_dict = {'tpw': geos_data['tpw'], # <<<<<<<<<<<<<<
* 'snowfr': geos_data['snowfr'],
* 'icefr': geos_data['icefr'],
__pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_tpw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_tpw, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
*
* geos_dict = {'tpw': geos_data['tpw'],
* 'snowfr': geos_data['snowfr'], # <<<<<<<<<<<<<<
* 'icefr': geos_data['icefr'],
* 'ocnfr': geos_data['ocnfr'],
*/
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_snowfr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_snowfr, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
* geos_dict = {'tpw': geos_data['tpw'],
* 'snowfr': geos_data['snowfr'],
* 'icefr': geos_data['icefr'], # <<<<<<<<<<<<<<
* 'ocnfr': geos_data['ocnfr'],
* 'landicefr': geos_data['landicefr'],
*/
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_icefr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_icefr, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
* 'snowfr': geos_data['snowfr'],
* 'icefr': geos_data['icefr'],
* 'ocnfr': geos_data['ocnfr'], # <<<<<<<<<<<<<<
* 'landicefr': geos_data['landicefr'],
* 'sfct': geos_data['sfct']
*/
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_ocnfr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 101, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ocnfr, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
* 'icefr': geos_data['icefr'],
* 'ocnfr': geos_data['ocnfr'],
* 'landicefr': geos_data['landicefr'], # <<<<<<<<<<<<<<
* 'sfct': geos_data['sfct']
* }
*/
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_landicefr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_landicefr, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
* 'ocnfr': geos_data['ocnfr'],
* 'landicefr': geos_data['landicefr'],
* 'sfct': geos_data['sfct'] # <<<<<<<<<<<<<<
* }
__pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_geos_data, __pyx_n_u_sfct); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_sfct, __pyx_t_4) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_geos_dict = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
/* "ancillary.pyx":106
* }
*
* return geos_dict # <<<<<<<<<<<<<<
__Pyx_INCREF(__pyx_v_geos_dict);
__pyx_r = __pyx_v_geos_dict;
/* "ancillary.pyx":80
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def py_get_GEOS(np.ndarray[float, ndim=1] lat, np.ndarray[float, ndim=1] lon, int res, char *startTime, # <<<<<<<<<<<<<<
* char *anc_dir, char *geos1, char *geos2, char *geos_lnd, char *geos_ocn, char *geos_cnst,
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lat.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lon.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("ancillary_data.py_get_GEOS", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lat.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_lon.rcbuffer->pybuffer);
__pyx_L2:;
__PYX_XDEC_MEMVIEW(&__pyx_v_tpw_mv, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_snowfr_mv, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_icefr_mv, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_ocnfr_mv, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_landicefr_mv, 1);
__PYX_XDEC_MEMVIEW(&__pyx_v_sfct_mv, 1);
__Pyx_XDECREF(__pyx_v_geos_dict);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "ancillary.pyx":112
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def py_snow_mask(char *satname, unsigned char lsf): # <<<<<<<<<<<<<<
* # need to have for loop here to compute all the pixels since the function, as with everything else,
* # is run per pixel.
/* Python wrapper */
static PyObject *__pyx_pw_14ancillary_data_9py_snow_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_14ancillary_data_9py_snow_mask = {"py_snow_mask", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14ancillary_data_9py_snow_mask, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14ancillary_data_9py_snow_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
CYTHON_UNUSED char *__pyx_v_satname;
CYTHON_UNUSED unsigned char __pyx_v_lsf;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("py_snow_mask (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_satname,&__pyx_n_s_lsf,0};
PyObject* values[2] = {0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_satname)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lsf)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("py_snow_mask", 1, 2, 2, 1); __PYX_ERR(0, 112, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py_snow_mask") < 0)) __PYX_ERR(0, 112, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_satname = __Pyx_PyObject_AsWritableString(values[0]); if (unlikely((!__pyx_v_satname) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error)
__pyx_v_lsf = __Pyx_PyInt_As_unsigned_char(values[1]); if (unlikely((__pyx_v_lsf == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("py_snow_mask", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 112, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("ancillary_data.py_snow_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_14ancillary_data_8py_snow_mask(__pyx_self, __pyx_v_satname, __pyx_v_lsf);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_14ancillary_data_8py_snow_mask(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED char *__pyx_v_satname, CYTHON_UNUSED unsigned char __pyx_v_lsf) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("py_snow_mask", 0);
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "ancillary.pyx":121
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def py_cithr(int key, np.ndarray[float, ndim=1] sec_vza, np.ndarray[float, ndim=1] bt11): # <<<<<<<<<<<<<<
* cdef np.ndarray tci_thr = np.zeros((bt11.shape[0], ), order='C', dtype=np.float)
/* Python wrapper */
static PyObject *__pyx_pw_14ancillary_data_11py_cithr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_14ancillary_data_11py_cithr = {"py_cithr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14ancillary_data_11py_cithr, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14ancillary_data_11py_cithr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_key;
PyArrayObject *__pyx_v_sec_vza = 0;
PyArrayObject *__pyx_v_bt11 = 0;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("py_cithr (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_sec_vza,&__pyx_n_s_bt11,0};
PyObject* values[3] = {0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sec_vza)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("py_cithr", 1, 3, 3, 1); __PYX_ERR(0, 121, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bt11)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("py_cithr", 1, 3, 3, 2); __PYX_ERR(0, 121, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py_cithr") < 0)) __PYX_ERR(0, 121, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
__pyx_v_key = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_key == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error)
__pyx_v_sec_vza = ((PyArrayObject *)values[1]);
__pyx_v_bt11 = ((PyArrayObject *)values[2]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("py_cithr", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 121, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("ancillary_data.py_cithr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec_vza), __pyx_ptype_5numpy_ndarray, 1, "sec_vza", 0))) __PYX_ERR(0, 121, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bt11), __pyx_ptype_5numpy_ndarray, 1, "bt11", 0))) __PYX_ERR(0, 121, __pyx_L1_error)
__pyx_r = __pyx_pf_14ancillary_data_10py_cithr(__pyx_self, __pyx_v_key, __pyx_v_sec_vza, __pyx_v_bt11);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_14ancillary_data_10py_cithr(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_key, PyArrayObject *__pyx_v_sec_vza, PyArrayObject *__pyx_v_bt11) {
PyArrayObject *__pyx_v_tci_thr = 0;
npy_intp __pyx_v_i;
__Pyx_LocalBuf_ND __pyx_pybuffernd_bt11;
__Pyx_Buffer __pyx_pybuffer_bt11;
__Pyx_LocalBuf_ND __pyx_pybuffernd_sec_vza;
__Pyx_Buffer __pyx_pybuffer_sec_vza;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
npy_intp __pyx_t_6;
npy_intp __pyx_t_7;
npy_intp __pyx_t_8;
Py_ssize_t __pyx_t_9;
Py_ssize_t __pyx_t_10;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("py_cithr", 0);
__pyx_pybuffer_sec_vza.pybuffer.buf = NULL;
__pyx_pybuffer_sec_vza.refcount = 0;
__pyx_pybuffernd_sec_vza.data = NULL;
__pyx_pybuffernd_sec_vza.rcbuffer = &__pyx_pybuffer_sec_vza;
__pyx_pybuffer_bt11.pybuffer.buf = NULL;
__pyx_pybuffer_bt11.refcount = 0;
__pyx_pybuffernd_bt11.data = NULL;
__pyx_pybuffernd_bt11.rcbuffer = &__pyx_pybuffer_bt11;
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_sec_vza.rcbuffer->pybuffer, (PyObject*)__pyx_v_sec_vza, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 121, __pyx_L1_error)
}
__pyx_pybuffernd_sec_vza.diminfo[0].strides = __pyx_pybuffernd_sec_vza.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_sec_vza.diminfo[0].shape = __pyx_pybuffernd_sec_vza.rcbuffer->pybuffer.shape[0];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_bt11.rcbuffer->pybuffer, (PyObject*)__pyx_v_bt11, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 121, __pyx_L1_error)
}
__pyx_pybuffernd_bt11.diminfo[0].strides = __pyx_pybuffernd_bt11.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_bt11.diminfo[0].shape = __pyx_pybuffernd_bt11.rcbuffer->pybuffer.shape[0];
/* "ancillary.pyx":123
* def py_cithr(int key, np.ndarray[float, ndim=1] sec_vza, np.ndarray[float, ndim=1] bt11):
* cdef np.ndarray tci_thr = np.zeros((bt11.shape[0], ), order='C', dtype=np.float) # <<<<<<<<<<<<<<
* for i in range(bt11.shape[0]):
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_bt11->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
__pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 123, __pyx_L1_error)
__pyx_v_tci_thr = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "ancillary.pyx":125
* cdef np.ndarray tci_thr = np.zeros((bt11.shape[0], ), order='C', dtype=np.float)
* for i in range(bt11.shape[0]): # <<<<<<<<<<<<<<
* tci_thr[i] = cithr(key, sec_vza[i], bt11[i])
__pyx_t_6 = (__pyx_v_bt11->dimensions[0]);
__pyx_t_7 = __pyx_t_6;
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
* for i in range(bt11.shape[0]):
* tci_thr[i] = cithr(key, sec_vza[i], bt11[i]) # <<<<<<<<<<<<<<
__pyx_t_9 = __pyx_v_i;
__pyx_t_10 = __pyx_v_i;
__pyx_t_5 = PyFloat_FromDouble(cithr(__pyx_v_key, (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_sec_vza.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_sec_vza.diminfo[0].strides)), (*__Pyx_BufPtrStrided1d(float *, __pyx_pybuffernd_bt11.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_bt11.diminfo[0].strides)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_tci_thr), __pyx_v_i, __pyx_t_5, npy_intp, 1, __Pyx_PyInt_From_Py_intptr_t, 0, 0, 0) < 0)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
/* "ancillary.pyx":128
* tci_thr[i] = cithr(key, sec_vza[i], bt11[i])
*
* return tci_thr # <<<<<<<<<<<<<<
__Pyx_INCREF(((PyObject *)__pyx_v_tci_thr));
__pyx_r = ((PyObject *)__pyx_v_tci_thr);
/* "ancillary.pyx":121
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def py_cithr(int key, np.ndarray[float, ndim=1] sec_vza, np.ndarray[float, ndim=1] bt11): # <<<<<<<<<<<<<<
* cdef np.ndarray tci_thr = np.zeros((bt11.shape[0], ), order='C', dtype=np.float)
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
__Pyx_PyThreadState_declare
__Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bt11.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sec_vza.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
__Pyx_AddTraceback("ancillary_data.py_cithr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_bt11.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_sec_vza.rcbuffer->pybuffer);
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_tci_thr);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "ancillary.pyx":134
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def py_check_reg_uniformity(np.ndarray[unsigned char, ndim=2] eco_type, np.ndarray[unsigned char, ndim=2] eco, # <<<<<<<<<<<<<<
* np.ndarray[float, ndim=2] snowfr,
* np.ndarray[float, ndim=2] icefr, np.ndarray[unsigned char, ndim=2] lsf):
/* Python wrapper */
static PyObject *__pyx_pw_14ancillary_data_13py_check_reg_uniformity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_14ancillary_data_13py_check_reg_uniformity = {"py_check_reg_uniformity", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_14ancillary_data_13py_check_reg_uniformity, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_14ancillary_data_13py_check_reg_uniformity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_eco_type = 0;
PyArrayObject *__pyx_v_eco = 0;
PyArrayObject *__pyx_v_snowfr = 0;
PyArrayObject *__pyx_v_icefr = 0;
PyArrayObject *__pyx_v_lsf = 0;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("py_check_reg_uniformity (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_eco_type,&__pyx_n_s_eco,&__pyx_n_s_snowfr,&__pyx_n_s_icefr,&__pyx_n_s_lsf,0};
PyObject* values[5] = {0,0,0,0,0};
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
CYTHON_FALLTHROUGH;
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
CYTHON_FALLTHROUGH;
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
CYTHON_FALLTHROUGH;
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
CYTHON_FALLTHROUGH;
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
kw_args = PyDict_Size(__pyx_kwds);
switch (pos_args) {
case 0:
if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eco_type)) != 0)) kw_args--;
else goto __pyx_L5_argtuple_error;
CYTHON_FALLTHROUGH;
case 1:
if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eco)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("py_check_reg_uniformity", 1, 5, 5, 1); __PYX_ERR(0, 134, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 2:
if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_snowfr)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("py_check_reg_uniformity", 1, 5, 5, 2); __PYX_ERR(0, 134, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 3:
if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icefr)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("py_check_reg_uniformity", 1, 5, 5, 3); __PYX_ERR(0, 134, __pyx_L3_error)
}
CYTHON_FALLTHROUGH;
case 4:
if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lsf)) != 0)) kw_args--;
else {
__Pyx_RaiseArgtupleInvalid("py_check_reg_uniformity", 1, 5, 5, 4); __PYX_ERR(0, 134, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "py_check_reg_uniformity") < 0)) __PYX_ERR(0, 134, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
}
__pyx_v_eco_type = ((PyArrayObject *)values[0]);
__pyx_v_eco = ((PyArrayObject *)values[1]);
__pyx_v_snowfr = ((PyArrayObject *)values[2]);
__pyx_v_icefr = ((PyArrayObject *)values[3]);
__pyx_v_lsf = ((PyArrayObject *)values[4]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("py_check_reg_uniformity", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 134, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("ancillary_data.py_check_reg_uniformity", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_eco_type), __pyx_ptype_5numpy_ndarray, 1, "eco_type", 0))) __PYX_ERR(0, 134, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_eco), __pyx_ptype_5numpy_ndarray, 1, "eco", 0))) __PYX_ERR(0, 134, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_snowfr), __pyx_ptype_5numpy_ndarray, 1, "snowfr", 0))) __PYX_ERR(0, 135, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_icefr), __pyx_ptype_5numpy_ndarray, 1, "icefr", 0))) __PYX_ERR(0, 136, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lsf), __pyx_ptype_5numpy_ndarray, 1, "lsf", 0))) __PYX_ERR(0, 136, __pyx_L1_error)
__pyx_r = __pyx_pf_14ancillary_data_12py_check_reg_uniformity(__pyx_self, __pyx_v_eco_type, __pyx_v_eco, __pyx_v_snowfr, __pyx_v_icefr, __pyx_v_lsf);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
static PyObject *__pyx_pf_14ancillary_data_12py_check_reg_uniformity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_eco_type, PyArrayObject *__pyx_v_eco, PyArrayObject *__pyx_v_snowfr, PyArrayObject *__pyx_v_icefr, PyArrayObject *__pyx_v_lsf) {
int __pyx_v_coast;
int __pyx_v_land;
int __pyx_v_water;
int __pyx_v_loc_uniform;
int __pyx_v_i;
int __pyx_v_j;
PyArrayObject *__pyx_v_coast_r = 0;
PyArrayObject *__pyx_v_land_r = 0;
PyArrayObject *__pyx_v_water_r = 0;
PyArrayObject *__pyx_v_loc_uniform_r = 0;
__Pyx_memviewslice __pyx_v_coast_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_land_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_water_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_loc_uniform_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
npy_intp __pyx_v_lines;
npy_intp __pyx_v_eles;
long __pyx_v_line_edge;
long __pyx_v_elem_edge;
PyObject *__pyx_v_scene_uniformity = NULL;
__Pyx_LocalBuf_ND __pyx_pybuffernd_eco;
__Pyx_Buffer __pyx_pybuffer_eco;
__Pyx_LocalBuf_ND __pyx_pybuffernd_eco_type;
__Pyx_Buffer __pyx_pybuffer_eco_type;
__Pyx_LocalBuf_ND __pyx_pybuffernd_icefr;
__Pyx_Buffer __pyx_pybuffer_icefr;
__Pyx_LocalBuf_ND __pyx_pybuffernd_lsf;
__Pyx_Buffer __pyx_pybuffer_lsf;
__Pyx_LocalBuf_ND __pyx_pybuffernd_snowfr;
__Pyx_Buffer __pyx_pybuffer_snowfr;
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
__Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
npy_intp __pyx_t_7;
npy_intp __pyx_t_8;
int __pyx_t_9;
npy_intp __pyx_t_10;
npy_intp __pyx_t_11;
int __pyx_t_12;
int __pyx_t_13;
int __pyx_t_14;
unsigned char __pyx_t_15;
Py_ssize_t __pyx_t_16;
Py_ssize_t __pyx_t_17;
Py_ssize_t __pyx_t_18;
Py_ssize_t __pyx_t_19;
Py_ssize_t __pyx_t_20;
Py_ssize_t __pyx_t_21;
Py_ssize_t __pyx_t_22;
Py_ssize_t __pyx_t_23;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("py_check_reg_uniformity", 0);
__pyx_pybuffer_eco_type.pybuffer.buf = NULL;
__pyx_pybuffer_eco_type.refcount = 0;
__pyx_pybuffernd_eco_type.data = NULL;
__pyx_pybuffernd_eco_type.rcbuffer = &__pyx_pybuffer_eco_type;
__pyx_pybuffer_eco.pybuffer.buf = NULL;
__pyx_pybuffer_eco.refcount = 0;
__pyx_pybuffernd_eco.data = NULL;
__pyx_pybuffernd_eco.rcbuffer = &__pyx_pybuffer_eco;
__pyx_pybuffer_snowfr.pybuffer.buf = NULL;
__pyx_pybuffer_snowfr.refcount = 0;
__pyx_pybuffernd_snowfr.data = NULL;
__pyx_pybuffernd_snowfr.rcbuffer = &__pyx_pybuffer_snowfr;
__pyx_pybuffer_icefr.pybuffer.buf = NULL;
__pyx_pybuffer_icefr.refcount = 0;
__pyx_pybuffernd_icefr.data = NULL;
__pyx_pybuffernd_icefr.rcbuffer = &__pyx_pybuffer_icefr;
__pyx_pybuffer_lsf.pybuffer.buf = NULL;
__pyx_pybuffer_lsf.refcount = 0;
__pyx_pybuffernd_lsf.data = NULL;
__pyx_pybuffernd_lsf.rcbuffer = &__pyx_pybuffer_lsf;
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_eco_type.rcbuffer->pybuffer, (PyObject*)__pyx_v_eco_type, &__Pyx_TypeInfo_unsigned_char, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error)
}
__pyx_pybuffernd_eco_type.diminfo[0].strides = __pyx_pybuffernd_eco_type.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_eco_type.diminfo[0].shape = __pyx_pybuffernd_eco_type.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_eco_type.diminfo[1].strides = __pyx_pybuffernd_eco_type.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_eco_type.diminfo[1].shape = __pyx_pybuffernd_eco_type.rcbuffer->pybuffer.shape[1];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_eco.rcbuffer->pybuffer, (PyObject*)__pyx_v_eco, &__Pyx_TypeInfo_unsigned_char, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error)
}
__pyx_pybuffernd_eco.diminfo[0].strides = __pyx_pybuffernd_eco.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_eco.diminfo[0].shape = __pyx_pybuffernd_eco.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_eco.diminfo[1].strides = __pyx_pybuffernd_eco.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_eco.diminfo[1].shape = __pyx_pybuffernd_eco.rcbuffer->pybuffer.shape[1];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_snowfr.rcbuffer->pybuffer, (PyObject*)__pyx_v_snowfr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error)
}
__pyx_pybuffernd_snowfr.diminfo[0].strides = __pyx_pybuffernd_snowfr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_snowfr.diminfo[0].shape = __pyx_pybuffernd_snowfr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_snowfr.diminfo[1].strides = __pyx_pybuffernd_snowfr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_snowfr.diminfo[1].shape = __pyx_pybuffernd_snowfr.rcbuffer->pybuffer.shape[1];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_icefr.rcbuffer->pybuffer, (PyObject*)__pyx_v_icefr, &__Pyx_TypeInfo_float, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error)
}
__pyx_pybuffernd_icefr.diminfo[0].strides = __pyx_pybuffernd_icefr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_icefr.diminfo[0].shape = __pyx_pybuffernd_icefr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_icefr.diminfo[1].strides = __pyx_pybuffernd_icefr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_icefr.diminfo[1].shape = __pyx_pybuffernd_icefr.rcbuffer->pybuffer.shape[1];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_lsf.rcbuffer->pybuffer, (PyObject*)__pyx_v_lsf, &__Pyx_TypeInfo_unsigned_char, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 134, __pyx_L1_error)
}
__pyx_pybuffernd_lsf.diminfo[0].strides = __pyx_pybuffernd_lsf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_lsf.diminfo[0].shape = __pyx_pybuffernd_lsf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_lsf.diminfo[1].strides = __pyx_pybuffernd_lsf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_lsf.diminfo[1].shape = __pyx_pybuffernd_lsf.rcbuffer->pybuffer.shape[1];
/* "ancillary.pyx":141
* cdef int i, j
* cdef np.ndarray coast_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32) # <<<<<<<<<<<<<<
* cdef np.ndarray land_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef np.ndarray water_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_eco_type->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_eco_type->dimensions[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 141, __pyx_L1_error)
__pyx_v_coast_r = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "ancillary.pyx":142
*
* cdef np.ndarray coast_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef np.ndarray land_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32) # <<<<<<<<<<<<<<
* cdef np.ndarray water_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef np.ndarray loc_uniform_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_eco_type->dimensions[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_eco_type->dimensions[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
__pyx_t_5 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 142, __pyx_L1_error)
__pyx_v_land_r = ((PyArrayObject *)__pyx_t_1);
__pyx_t_1 = 0;
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
/* "ancillary.pyx":143
* cdef np.ndarray coast_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef np.ndarray land_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef np.ndarray water_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32) # <<<<<<<<<<<<<<
* cdef np.ndarray loc_uniform_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef int[:, ::1] coast_mv = coast_r
*/
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_eco_type->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_eco_type->dimensions[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_3 = 0;
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
__pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_order, __pyx_n_u_C) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 143, __pyx_L1_error)
__pyx_v_water_r = ((PyArrayObject *)__pyx_t_5);
__pyx_t_5 = 0;
/* "ancillary.pyx":144
* cdef np.ndarray land_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef np.ndarray water_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32)
* cdef np.ndarray loc_uniform_r = np.zeros((eco_type.shape[0], eco_type.shape[1]), order='C', dtype=np.int32) # <<<<<<<<<<<<<<
* cdef int[:, ::1] coast_mv = coast_r
* cdef int[:, ::1] land_mv = land_r
*/
__Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;