From ecd9b68f9b43190d2584e4cc4645606ce8b8b224 Mon Sep 17 00:00:00 2001 From: Loic Jegou Date: Mon, 13 Jan 2025 15:30:39 +0100 Subject: [PATCH 1/4] test --- ImageD11/sinograms/tensor_map.py | 24 +- _cImageD11-f2pywrappers.f | 0 _cImageD11-f2pywrappers2.f90 | 0 _cImageD11module.c | 9595 ++++++++++++++++++++++++++++++ test.txt | 0 5 files changed, 9607 insertions(+), 12 deletions(-) create mode 100644 _cImageD11-f2pywrappers.f create mode 100644 _cImageD11-f2pywrappers2.f90 create mode 100644 _cImageD11module.c create mode 100644 test.txt diff --git a/ImageD11/sinograms/tensor_map.py b/ImageD11/sinograms/tensor_map.py index 7d3710c4..34ccf422 100644 --- a/ImageD11/sinograms/tensor_map.py +++ b/ImageD11/sinograms/tensor_map.py @@ -20,7 +20,7 @@ # e.g these can be called and broadcasted for a UBI map of (1,200,500,3,3) # take in a nxn float64 array, return a nxn float64 array -@numba.guvectorize([(numba.float64[:, :], numba.float64[:, :])], '(n,n)->(n,n)', nopython=True) +@numba.guvectorize([(numba.float64[:, :], numba.float64[:, :])], '(n,n)->(n,n)', nopython=True, cache = True) def fast_invert(mat, res): """ Fast matrix invert. @@ -42,7 +42,7 @@ def fast_invert(mat, res): # take in a nxn float64 array, return a nxn float64 array -@numba.guvectorize([(numba.float64[:, :], numba.float64[:, :])], '(n,n)->(n,n)', nopython=True) +@numba.guvectorize([(numba.float64[:, :], numba.float64[:, :])], '(n,n)->(n,n)', nopython=True, cache = True) def ubi_to_mt(ubi, res): """ Compute metric tensor from UBI matrix, the same way as in ``ImageD11.grain``. @@ -64,7 +64,7 @@ def ubi_to_mt(ubi, res): # take in a nxn float64 array and a dummy variable p-length float64 vector (required by numba), return a p-length float64 vector -@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:])], '(n,n),(p)->(p)', nopython=True) +@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:])], '(n,n),(p)->(p)', nopython=True, cache = True) def mt_to_unitcell(mt, dum, res): """ Get unitcell parameters array ``[a, b, c, alpha, beta, gamma]`` from the metric tensor. @@ -103,7 +103,7 @@ def mt_to_unitcell(mt, dum, res): # take in a p-length float64 vector and a dummy variable nxn float64 array (required by numba), return a nxn float64 array -@numba.guvectorize([(numba.float64[:], numba.float64[:, :], numba.float64[:, :])], '(p),(n,n)->(n,n)', nopython=True) +@numba.guvectorize([(numba.float64[:], numba.float64[:, :], numba.float64[:, :])], '(p),(n,n)->(n,n)', nopython=True, cache = True) def unitcell_to_b(unitcell, dum, res): """ Get B matrix from unitcell, the same way as in ``ImageD11.grain`` (via ``ImageD11.unitcell``). @@ -160,7 +160,7 @@ def unitcell_to_b(unitcell, dum, res): # take in a nxn float64 array, return a nxn float64 array @numba.guvectorize([(numba.float64[:, :], numba.float64[:, :], numba.float64[:, :])], '(n,n),(n,n)->(n,n)', - nopython=True) + nopython=True, cache = True) def ubi_and_b_to_u(ubi, b, res): """ Get U matrix from UBI and B matrices, the same way as in ``ImageD11.grain``. @@ -187,7 +187,7 @@ def ubi_and_b_to_u(ubi, b, res): res[...] = np.dot(b, ubi).T -@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:, :])], '(n,n),(p)->(n,n)', nopython=True) +@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:, :])], '(n,n),(p)->(n,n)', nopython=True, cache = True) def ubi_and_unitcell_to_eps_sample(ubi, dzero_cell, res): """ Get Biot strain tensor (3x3) in sample reference frame from UBI array and unitcell array. @@ -250,7 +250,7 @@ def ubi_and_unitcell_to_eps_sample(ubi, dzero_cell, res): res[...] = em -@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:, :])], '(n,n),(p)->(n,n)', nopython=True) +@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:, :])], '(n,n),(p)->(n,n)', nopython=True, cache = True) def ubi_and_unitcell_to_eps_crystal(ubi, dzero_cell, res): """ Get Biot strain tensor (3x3) in crystal reference frame from UBI and unitcell. @@ -314,7 +314,7 @@ def ubi_and_unitcell_to_eps_crystal(ubi, dzero_cell, res): @numba.guvectorize([(numba.float64[:, :], numba.float64[:, :], numba.float64[:, :])], - '(n,n),(n,n)->(n,n)', nopython=True) + '(n,n),(n,n)->(n,n)', nopython=True, cache = True) def tensor_crystal_to_sample(tensor_crystal, U, res): """ Rotate tensor from crystal to sample reference frame. @@ -340,7 +340,7 @@ def tensor_crystal_to_sample(tensor_crystal, U, res): @numba.guvectorize([(numba.float64[:, :], numba.float64[:, :], numba.float64[:, :])], - '(n,n),(n,n)->(n,n)', nopython=True) + '(n,n),(n,n)->(n,n)', nopython=True, cache = True) def tensor_sample_to_crystal(tensor_sample, U, res): """ Rotate tensor from sample to crystal reference frame. @@ -366,7 +366,7 @@ def tensor_sample_to_crystal(tensor_sample, U, res): @numba.guvectorize([(numba.float64[:, :], numba.float64[:, :], numba.float64[:, :], numba.float64[:], numba.float64[:, :])], - '(n,n),(k,k),(n,n),()->(n,n)', nopython=True) + '(n,n),(k,k),(n,n),()->(n,n)', nopython=True, cache = True) def strain_crystal_to_stress_crystal(strain_crystal, stiffness_tensor, B0, phase_mask, res): """ Convert Biot strain tensor (ImageD11 coordinate system) to Biot stress tensor (ImageD11 coordinate system). @@ -453,7 +453,7 @@ def strain_crystal_to_stress_crystal(strain_crystal, stiffness_tensor, B0, phase res[...] = stress_crystal -@numba.guvectorize([(numba.float64[:, :], numba.float64[:])], '(n,n)->()', nopython=True) +@numba.guvectorize([(numba.float64[:, :], numba.float64[:])], '(n,n)->()', nopython=True, cache = True) def sig_to_vm(sig, res): """Get von-Mises stress scalar from stress tensor""" sig11 = sig[0, 0] @@ -489,7 +489,7 @@ def _arctan2(y, x): # take in a nxn float64 array and a dummy variable p-length float64 vector (required by numba), return a p-length float64 vector -@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:])], '(n,n),(p)->(p)', nopython=True) +@numba.guvectorize([(numba.float64[:, :], numba.float64[:], numba.float64[:])], '(n,n),(p)->(p)', nopython=True, cache = True) def u_to_euler(u, dum, res): """Get Euler angles (radians) from U matrix, the same way as in xfab.tools To use (no need to pre-populate res): diff --git a/_cImageD11-f2pywrappers.f b/_cImageD11-f2pywrappers.f new file mode 100644 index 00000000..e69de29b diff --git a/_cImageD11-f2pywrappers2.f90 b/_cImageD11-f2pywrappers2.f90 new file mode 100644 index 00000000..e69de29b diff --git a/_cImageD11module.c b/_cImageD11module.c new file mode 100644 index 00000000..95e95c44 --- /dev/null +++ b/_cImageD11module.c @@ -0,0 +1,9595 @@ +/* File: _cImageD11module.c + * This file is auto-generated with f2py (version:1.24.4). + * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, + * written by Pearu Peterson . + * Generation date: Thu Jan 9 17:38:03 2025 + * Do not edit this file directly unless you know what you are doing!!! + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN +#endif /* PY_SSIZE_T_CLEAN */ + +/* Unconditionally included */ +#include +#include + +/*********************** See f2py2e/cfuncs.py: includes ***********************/ +#include "fortranobject.h" +#include + +/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ +static PyObject *_cImageD11_error; +static PyObject *_cImageD11_module; + +/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ +typedef unsigned short unsigned_short; +typedef unsigned char unsigned_char; +typedef signed char signed_char; +#if defined(NPY_OS_WIN32) +typedef __int64 long_long; +#else +typedef long long long_long; +typedef unsigned long long unsigned_long_long; +#endif + + +/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ +/*need_typedefs_generated*/ + +/********************** See f2py2e/cfuncs.py: cppmacros **********************/ +/* See fortranobject.h for definitions. The macros here are provided for BC. */ +#define rank f2py_rank +#define shape f2py_shape +#define fshape f2py_shape +#define len f2py_len +#define flen f2py_flen +#define slen f2py_slen +#define size f2py_size + +#define CHECKSCALAR(check,tcheck,name,show,var)\ + if (!(check)) {\ + char errstring[256];\ + sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ + PyErr_SetString(_cImageD11_error,errstring);\ + /*goto capi_fail;*/\ + } else +#ifdef DEBUGCFUNCS +#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); +#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ + PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ + fprintf(stderr,"\n"); +#else +#define CFUNCSMESS(mess) +#define CFUNCSMESSPY(mess,obj) +#endif + +#ifndef max +#define max(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) ((a < b) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a,b) ((a > b) ? (a) : (b)) +#endif +#ifndef MIN +#define MIN(a,b) ((a < b) ? (a) : (b)) +#endif + +#if defined(PREPEND_FORTRAN) +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F +#else +#define F_FUNC(f,F) _##f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) _##F##_ +#else +#define F_FUNC(f,F) _##f##_ +#endif +#endif +#else +#if defined(NO_APPEND_FORTRAN) +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F +#else +#define F_FUNC(f,F) f +#endif +#else +#if defined(UPPERCASE_FORTRAN) +#define F_FUNC(f,F) F##_ +#else +#define F_FUNC(f,F) f##_ +#endif +#endif +#endif +#if defined(UNDERSCORE_G77) +#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) +#else +#define F_FUNC_US(f,F) F_FUNC(f,F) +#endif + +#define CHECKARRAY(check,tcheck,name) \ + if (!(check)) {\ + PyErr_SetString(_cImageD11_error,"("tcheck") failed for "name);\ + /*goto capi_fail;*/\ + } else + +/************************ See f2py2e/cfuncs.py: cfuncs ************************/ +static int +double_from_pyobj(double* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + if (PyFloat_Check(obj)) { + *v = PyFloat_AsDouble(obj); + return !(*v == -1.0 && PyErr_Occurred()); + } + + tmp = PyNumber_Float(obj); + if (tmp) { + *v = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return !(*v == -1.0 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} + Py_DECREF(tmp); + } + { + PyObject* err = PyErr_Occurred(); + if (err==NULL) err = _cImageD11_error; + PyErr_SetString(err,errmess); + } + return 0; +} + +static int +int_from_pyobj(int* v, PyObject *obj, const char *errmess) +{ + PyObject* tmp = NULL; + + if (PyLong_Check(obj)) { + *v = Npy__PyLong_AsInt(obj); + return !(*v == -1 && PyErr_Occurred()); + } + + tmp = PyNumber_Long(obj); + if (tmp) { + *v = Npy__PyLong_AsInt(tmp); + Py_DECREF(tmp); + return !(*v == -1 && PyErr_Occurred()); + } + + if (PyComplex_Check(obj)) { + PyErr_Clear(); + tmp = PyObject_GetAttrString(obj,"real"); + } + else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { + /*pass*/; + } + else if (PySequence_Check(obj)) { + PyErr_Clear(); + tmp = PySequence_GetItem(obj, 0); + } + + if (tmp) { + if (int_from_pyobj(v, tmp, errmess)) { + Py_DECREF(tmp); + return 1; + } + Py_DECREF(tmp); + } + + { + PyObject* err = PyErr_Occurred(); + if (err == NULL) { + err = _cImageD11_error; + } + PyErr_SetString(err, errmess); + } + return 0; +} + +static int +float_from_pyobj(float* v, PyObject *obj, const char *errmess) +{ + double d=0.0; + if (double_from_pyobj(&d,obj,errmess)) { + *v = (float)d; + return 1; + } + return 0; +} + + +/********************* See f2py2e/cfuncs.py: userincludes *********************/ +/*need_userincludes*/ + +/********************* See f2py2e/capi_rules.py: usercode *********************/ + /* start usercode multiline (0) */ + +#include "blobs.h" + + /* end multiline (0)*/ + +/* See f2py2e/rules.py */ +extern void compute_geometry(double*,double*,double,double,double,double,double*,double*,int); +extern void compute_gv(double*,double*,double,double,double,double,double*,double*,int); +extern void compute_xlylzl(double*,double*,double*,double*,double*,double*,int); +extern void quickorient(double*,double*); +extern void cimaged11_omp_set_num_threads(int); +extern int cimaged11_omp_get_max_threads(void); +extern void uint16_to_float_darksub(float*,float*,unsigned_short*,int); +extern void uint16_to_float_darkflm(float*,float*,float*,unsigned_short*,int); +extern void frelon_lines(float*,int,int,float); +extern void frelon_lines_sub(float*,float*,int,int,float); +extern void array_mean_var_cut(float*,int,float*,float*,int,float,int); +extern void array_mean_var_msk(float*,unsigned_char*,int,float*,float*,int,float,int); +extern void array_stats(float*,int,float*,float*,float*,float*); +extern void array_histogram(float*,int,float,float,int*,int); +extern void reorder_u16_a32(unsigned_short*,int*,unsigned_short*,int); +extern void reorder_f32_a32(float*,int*,float*,int); +extern void reorderlut_u16_a32(unsigned_short*,int*,unsigned_short*,int); +extern void reorderlut_f32_a32(float*,int*,float*,int); +extern void reorder_u16_a32_a16(unsigned_short*,int*,short*,unsigned_short*,int,int); +extern void bgcalc(float*,float*,signed_char*,int,int,float,float,float); +extern int verify_rounding(int); +extern void closest_vec(double*,int,int,int*); +extern void closest(double*,double*,int*,double*,int,int); +extern int score(double*,double*,double,int); +extern void score_and_refine(double*,double*,double,int*,double*,int); +extern int score_and_assign(double*,double*,double,double*,int*,int,int); +extern void refine_assigned(double*,double*,int*,int,int*,double*,int); +extern void put_incr64(float*,long_long*,float*,int,int,int); +extern void put_incr32(float*,int*,float*,int,int,int); +extern void cluster1d(double*,int,int*,double,int*,int*,double*); +extern void score_gvec_z(double*,double*,double*,double*,double*,double*,double*,int,int); +extern double misori_cubic(double*,double*); +extern double misori_orthorhombic(double*,double*); +extern double misori_tetragonal(double*,double*); +extern double misori_monoclinic(double*,double*); +extern void misori_cubic_pairs(double*,double*,int); +extern int count_shared(int*,int,int*,int); +extern int connectedpixels(float*,int*,float,int,int,int,int); +extern void blobproperties(float*,int*,int,float,int,int,int,double*); +extern int bloboverlaps(int*,int,double*,int*,int,double*,int,int,int); +extern void blob_moments(double*,int); +extern int clean_mask(signed_char*,signed_char*,int,int); +extern int make_clean_mask(float*,float,signed_char*,signed_char*,int,int); +extern int localmaxlabel(float*,int*,signed_char*,int,int); +extern int mask_to_coo(signed_char*,int,int,unsigned_short*,unsigned_short*,int,int*); +extern int sparse_is_sorted(unsigned_short*,unsigned_short*,int); +extern int sparse_connectedpixels(float*,unsigned_short*,unsigned_short*,int,float,int*); +extern int sparse_connectedpixels_splat(float*,unsigned_short*,unsigned_short*,int,float,int*,int*,int,int); +extern void sparse_blob2Dproperties(float*,unsigned_short*,unsigned_short*,int,int*,double*,int); +extern void sparse_smooth(float*,unsigned_short*,unsigned_short*,int,float*); +extern int sparse_localmaxlabel(float*,unsigned_short*,unsigned_short*,int,float*,int*,int*); +extern int sparse_overlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int); +extern int compress_duplicates(int*,int*,int*,int*,int*,int,int); +extern int coverlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int,int*,int,int,int*); +extern int tosparse_u16(unsigned_short*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned_short*,int,int,int); +extern int tosparse_u32(unsigned*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned*,float,int,int); +extern int tosparse_f32(float*,unsigned_char*,unsigned_short*,unsigned_short*,float*,float,int,int); +extern void splat(unsigned_char*,int,int,double*,int,double*,int); +/*eof externroutines*/ + +/******************** See f2py2e/capi_rules.py: usercode1 ********************/ + + +/******************* See f2py2e/cb_rules.py: buildcallback *******************/ +/*need_callbacks*/ + +/*********************** See f2py2e/rules.py: buildapi ***********************/ + +/****************************** compute_geometry ******************************/ +static char doc_f2py_rout__cImageD11_compute_geometry[] = "\ +compute_geometry(xlylzl,omega,omegasign,wvln,wedge,chi,t,out)\n\nWrapper for ``compute_geometry``.\ +\n\nParameters\n----------\n" +"xlylzl : input rank-2 array('d') with bounds (ng,3)\n" +"omega : input rank-1 array('d') with bounds (ng)\n" +"omegasign : input float\n" +"wvln : input float\n" +"wedge : input float\n" +"chi : input float\n" +"t : input rank-1 array('d') with bounds (3)\n" +"out : in/output rank-2 array('d') with bounds (ng,6)"; +/* extern void compute_geometry(double*,double*,double,double,double,double,double*,double*,int); */ +static PyObject *f2py_rout__cImageD11_compute_geometry(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double,double,double,double,double*,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *xlylzl = NULL; + npy_intp xlylzl_Dims[2] = {-1, -1}; + const int xlylzl_Rank = 2; + PyArrayObject *capi_xlylzl_as_array = NULL; + int capi_xlylzl_intent = 0; + PyObject *xlylzl_capi = Py_None; + double *omega = NULL; + npy_intp omega_Dims[1] = {-1}; + const int omega_Rank = 1; + PyArrayObject *capi_omega_as_array = NULL; + int capi_omega_intent = 0; + PyObject *omega_capi = Py_None; + double omegasign = 0; + PyObject *omegasign_capi = Py_None; + double wvln = 0; + PyObject *wvln_capi = Py_None; + double wedge = 0; + PyObject *wedge_capi = Py_None; + double chi = 0; + PyObject *chi_capi = Py_None; + double *t = NULL; + npy_intp t_Dims[1] = {-1}; + const int t_Rank = 1; + PyArrayObject *capi_t_as_array = NULL; + int capi_t_intent = 0; + PyObject *t_capi = Py_None; + double *out = NULL; + npy_intp out_Dims[2] = {-1, -1}; + const int out_Rank = 2; + PyArrayObject *capi_out_as_array = NULL; + int capi_out_intent = 0; + PyObject *out_capi = Py_None; + int ng = 0; + static char *capi_kwlist[] = {"xlylzl","omega","omegasign","wvln","wedge","chi","t","out",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|:_cImageD11.compute_geometry",\ + capi_kwlist,&xlylzl_capi,&omega_capi,&omegasign_capi,&wvln_capi,&wedge_capi,&chi_capi,&t_capi,&out_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable xlylzl */ + xlylzl_Dims[1]=3; + capi_xlylzl_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 1st argument `xlylzl`"; + capi_xlylzl_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xlylzl_Dims,xlylzl_Rank, capi_xlylzl_intent,xlylzl_capi,capi_errmess); + if (capi_xlylzl_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xlylzl = (double *)(PyArray_DATA(capi_xlylzl_as_array)); + + /* Processing variable omegasign */ + f2py_success = double_from_pyobj(&omegasign,omegasign_capi,"_cImageD11.compute_geometry() 3rd argument (omegasign) can't be converted to double"); + if (f2py_success) { + /* Processing variable wvln */ + f2py_success = double_from_pyobj(&wvln,wvln_capi,"_cImageD11.compute_geometry() 4th argument (wvln) can't be converted to double"); + if (f2py_success) { + /* Processing variable wedge */ + f2py_success = double_from_pyobj(&wedge,wedge_capi,"_cImageD11.compute_geometry() 5th argument (wedge) can't be converted to double"); + if (f2py_success) { + /* Processing variable chi */ + f2py_success = double_from_pyobj(&chi,chi_capi,"_cImageD11.compute_geometry() 6th argument (chi) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + t_Dims[0]=3; + capi_t_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 7th argument `t`"; + capi_t_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,t_Dims,t_Rank, capi_t_intent,t_capi,capi_errmess); + if (capi_t_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + t = (double *)(PyArray_DATA(capi_t_as_array)); + + /* Processing variable ng */ + ng = shape(xlylzl, 0); + CHECKSCALAR(shape(xlylzl, 0) == ng,"shape(xlylzl, 0) == ng","hidden ng","compute_geometry:ng=%d",ng) { + /* Processing variable omega */ + omega_Dims[0]=ng; + capi_omega_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 2nd argument `omega`"; + capi_omega_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,omega_Dims,omega_Rank, capi_omega_intent,omega_capi,capi_errmess); + if (capi_omega_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + omega = (double *)(PyArray_DATA(capi_omega_as_array)); + + /* Processing variable out */ + out_Dims[0]=ng,out_Dims[1]=6; + capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 8th argument `out`"; + capi_out_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); + if (capi_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + out = (double *)(PyArray_DATA(capi_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(xlylzl,omega,omegasign,wvln,wedge,chi,t,out,ng); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_out_as_array!=out_capi) { + Py_XDECREF(capi_out_as_array); } + } /* if (capi_out_as_array == NULL) ... else of out */ + /* End of cleaning variable out */ + if((PyObject *)capi_omega_as_array!=omega_capi) { + Py_XDECREF(capi_omega_as_array); } + } /* if (capi_omega_as_array == NULL) ... else of omega */ + /* End of cleaning variable omega */ + } /*CHECKSCALAR(shape(xlylzl, 0) == ng)*/ + /* End of cleaning variable ng */ + if((PyObject *)capi_t_as_array!=t_capi) { + Py_XDECREF(capi_t_as_array); } + } /* if (capi_t_as_array == NULL) ... else of t */ + /* End of cleaning variable t */ + } /*if (f2py_success) of chi*/ + /* End of cleaning variable chi */ + } /*if (f2py_success) of wedge*/ + /* End of cleaning variable wedge */ + } /*if (f2py_success) of wvln*/ + /* End of cleaning variable wvln */ + } /*if (f2py_success) of omegasign*/ + /* End of cleaning variable omegasign */ + if((PyObject *)capi_xlylzl_as_array!=xlylzl_capi) { + Py_XDECREF(capi_xlylzl_as_array); } + } /* if (capi_xlylzl_as_array == NULL) ... else of xlylzl */ + /* End of cleaning variable xlylzl */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of compute_geometry **************************/ + +/********************************* compute_gv *********************************/ +static char doc_f2py_rout__cImageD11_compute_gv[] = "\ +compute_gv(xlylzl,omega,omegasign,wvln,wedge,chi,t,gv)\n\nWrapper for ``compute_gv``.\ +\n\nParameters\n----------\n" +"xlylzl : input rank-2 array('d') with bounds (ng,3)\n" +"omega : input rank-1 array('d') with bounds (ng)\n" +"omegasign : input float\n" +"wvln : input float\n" +"wedge : input float\n" +"chi : input float\n" +"t : input rank-1 array('d') with bounds (3)\n" +"gv : in/output rank-2 array('d') with bounds (ng,3)"; +/* extern void compute_gv(double*,double*,double,double,double,double,double*,double*,int); */ +static PyObject *f2py_rout__cImageD11_compute_gv(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double,double,double,double,double*,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *xlylzl = NULL; + npy_intp xlylzl_Dims[2] = {-1, -1}; + const int xlylzl_Rank = 2; + PyArrayObject *capi_xlylzl_as_array = NULL; + int capi_xlylzl_intent = 0; + PyObject *xlylzl_capi = Py_None; + double *omega = NULL; + npy_intp omega_Dims[1] = {-1}; + const int omega_Rank = 1; + PyArrayObject *capi_omega_as_array = NULL; + int capi_omega_intent = 0; + PyObject *omega_capi = Py_None; + double omegasign = 0; + PyObject *omegasign_capi = Py_None; + double wvln = 0; + PyObject *wvln_capi = Py_None; + double wedge = 0; + PyObject *wedge_capi = Py_None; + double chi = 0; + PyObject *chi_capi = Py_None; + double *t = NULL; + npy_intp t_Dims[1] = {-1}; + const int t_Rank = 1; + PyArrayObject *capi_t_as_array = NULL; + int capi_t_intent = 0; + PyObject *t_capi = Py_None; + double *gv = NULL; + npy_intp gv_Dims[2] = {-1, -1}; + const int gv_Rank = 2; + PyArrayObject *capi_gv_as_array = NULL; + int capi_gv_intent = 0; + PyObject *gv_capi = Py_None; + int ng = 0; + static char *capi_kwlist[] = {"xlylzl","omega","omegasign","wvln","wedge","chi","t","gv",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|:_cImageD11.compute_gv",\ + capi_kwlist,&xlylzl_capi,&omega_capi,&omegasign_capi,&wvln_capi,&wedge_capi,&chi_capi,&t_capi,&gv_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable xlylzl */ + xlylzl_Dims[1]=3; + capi_xlylzl_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 1st argument `xlylzl`"; + capi_xlylzl_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xlylzl_Dims,xlylzl_Rank, capi_xlylzl_intent,xlylzl_capi,capi_errmess); + if (capi_xlylzl_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xlylzl = (double *)(PyArray_DATA(capi_xlylzl_as_array)); + + /* Processing variable omegasign */ + f2py_success = double_from_pyobj(&omegasign,omegasign_capi,"_cImageD11.compute_gv() 3rd argument (omegasign) can't be converted to double"); + if (f2py_success) { + /* Processing variable wvln */ + f2py_success = double_from_pyobj(&wvln,wvln_capi,"_cImageD11.compute_gv() 4th argument (wvln) can't be converted to double"); + if (f2py_success) { + /* Processing variable wedge */ + f2py_success = double_from_pyobj(&wedge,wedge_capi,"_cImageD11.compute_gv() 5th argument (wedge) can't be converted to double"); + if (f2py_success) { + /* Processing variable chi */ + f2py_success = double_from_pyobj(&chi,chi_capi,"_cImageD11.compute_gv() 6th argument (chi) can't be converted to double"); + if (f2py_success) { + /* Processing variable t */ + t_Dims[0]=3; + capi_t_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 7th argument `t`"; + capi_t_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,t_Dims,t_Rank, capi_t_intent,t_capi,capi_errmess); + if (capi_t_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + t = (double *)(PyArray_DATA(capi_t_as_array)); + + /* Processing variable ng */ + ng = shape(xlylzl, 0); + CHECKSCALAR(shape(xlylzl, 0) == ng,"shape(xlylzl, 0) == ng","hidden ng","compute_gv:ng=%d",ng) { + /* Processing variable omega */ + omega_Dims[0]=ng; + capi_omega_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 2nd argument `omega`"; + capi_omega_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,omega_Dims,omega_Rank, capi_omega_intent,omega_capi,capi_errmess); + if (capi_omega_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + omega = (double *)(PyArray_DATA(capi_omega_as_array)); + + /* Processing variable gv */ + gv_Dims[0]=ng,gv_Dims[1]=3; + capi_gv_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 8th argument `gv`"; + capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); + if (capi_gv_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gv = (double *)(PyArray_DATA(capi_gv_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(xlylzl,omega,omegasign,wvln,wedge,chi,t,gv,ng); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_gv_as_array!=gv_capi) { + Py_XDECREF(capi_gv_as_array); } + } /* if (capi_gv_as_array == NULL) ... else of gv */ + /* End of cleaning variable gv */ + if((PyObject *)capi_omega_as_array!=omega_capi) { + Py_XDECREF(capi_omega_as_array); } + } /* if (capi_omega_as_array == NULL) ... else of omega */ + /* End of cleaning variable omega */ + } /*CHECKSCALAR(shape(xlylzl, 0) == ng)*/ + /* End of cleaning variable ng */ + if((PyObject *)capi_t_as_array!=t_capi) { + Py_XDECREF(capi_t_as_array); } + } /* if (capi_t_as_array == NULL) ... else of t */ + /* End of cleaning variable t */ + } /*if (f2py_success) of chi*/ + /* End of cleaning variable chi */ + } /*if (f2py_success) of wedge*/ + /* End of cleaning variable wedge */ + } /*if (f2py_success) of wvln*/ + /* End of cleaning variable wvln */ + } /*if (f2py_success) of omegasign*/ + /* End of cleaning variable omegasign */ + if((PyObject *)capi_xlylzl_as_array!=xlylzl_capi) { + Py_XDECREF(capi_xlylzl_as_array); } + } /* if (capi_xlylzl_as_array == NULL) ... else of xlylzl */ + /* End of cleaning variable xlylzl */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of compute_gv *****************************/ + +/******************************* compute_xlylzl *******************************/ +static char doc_f2py_rout__cImageD11_compute_xlylzl[] = "\ +compute_xlylzl(s,f,p,r,dist,xlylzl)\n\nWrapper for ``compute_xlylzl``.\ +\n\nParameters\n----------\n" +"s : input rank-1 array('d') with bounds (n)\n" +"f : input rank-1 array('d') with bounds (n)\n" +"p : input rank-1 array('d') with bounds (4)\n" +"r : input rank-1 array('d') with bounds (9)\n" +"dist : input rank-1 array('d') with bounds (3)\n" +"xlylzl : in/output rank-2 array('d') with bounds (n,3)"; +/* extern void compute_xlylzl(double*,double*,double*,double*,double*,double*,int); */ +static PyObject *f2py_rout__cImageD11_compute_xlylzl(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *s = NULL; + npy_intp s_Dims[1] = {-1}; + const int s_Rank = 1; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + double *f = NULL; + npy_intp f_Dims[1] = {-1}; + const int f_Rank = 1; + PyArrayObject *capi_f_as_array = NULL; + int capi_f_intent = 0; + PyObject *f_capi = Py_None; + double *p = NULL; + npy_intp p_Dims[1] = {-1}; + const int p_Rank = 1; + PyArrayObject *capi_p_as_array = NULL; + int capi_p_intent = 0; + PyObject *p_capi = Py_None; + double *r = NULL; + npy_intp r_Dims[1] = {-1}; + const int r_Rank = 1; + PyArrayObject *capi_r_as_array = NULL; + int capi_r_intent = 0; + PyObject *r_capi = Py_None; + double *dist = NULL; + npy_intp dist_Dims[1] = {-1}; + const int dist_Rank = 1; + PyArrayObject *capi_dist_as_array = NULL; + int capi_dist_intent = 0; + PyObject *dist_capi = Py_None; + double *xlylzl = NULL; + npy_intp xlylzl_Dims[2] = {-1, -1}; + const int xlylzl_Rank = 2; + PyArrayObject *capi_xlylzl_as_array = NULL; + int capi_xlylzl_intent = 0; + PyObject *xlylzl_capi = Py_None; + int n = 0; + static char *capi_kwlist[] = {"s","f","p","r","dist","xlylzl",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.compute_xlylzl",\ + capi_kwlist,&s_capi,&f_capi,&p_capi,&r_capi,&dist_capi,&xlylzl_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable s */ + ; + capi_s_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 1st argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (double *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable p */ + p_Dims[0]=4; + capi_p_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 3rd argument `p`"; + capi_p_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,p_Dims,p_Rank, capi_p_intent,p_capi,capi_errmess); + if (capi_p_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + p = (double *)(PyArray_DATA(capi_p_as_array)); + + /* Processing variable r */ + r_Dims[0]=9; + capi_r_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 4th argument `r`"; + capi_r_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_Dims,r_Rank, capi_r_intent,r_capi,capi_errmess); + if (capi_r_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + r = (double *)(PyArray_DATA(capi_r_as_array)); + + /* Processing variable dist */ + dist_Dims[0]=3; + capi_dist_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 5th argument `dist`"; + capi_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dist_Dims,dist_Rank, capi_dist_intent,dist_capi,capi_errmess); + if (capi_dist_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dist = (double *)(PyArray_DATA(capi_dist_as_array)); + + /* Processing variable n */ + n = shape(s, 0); + CHECKSCALAR(shape(s, 0) == n,"shape(s, 0) == n","hidden n","compute_xlylzl:n=%d",n) { + /* Processing variable f */ + f_Dims[0]=n; + capi_f_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 2nd argument `f`"; + capi_f_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_Dims,f_Rank, capi_f_intent,f_capi,capi_errmess); + if (capi_f_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + f = (double *)(PyArray_DATA(capi_f_as_array)); + + /* Processing variable xlylzl */ + xlylzl_Dims[0]=n,xlylzl_Dims[1]=3; + capi_xlylzl_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 6th argument `xlylzl`"; + capi_xlylzl_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xlylzl_Dims,xlylzl_Rank, capi_xlylzl_intent,xlylzl_capi,capi_errmess); + if (capi_xlylzl_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + xlylzl = (double *)(PyArray_DATA(capi_xlylzl_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(s,f,p,r,dist,xlylzl,n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_xlylzl_as_array!=xlylzl_capi) { + Py_XDECREF(capi_xlylzl_as_array); } + } /* if (capi_xlylzl_as_array == NULL) ... else of xlylzl */ + /* End of cleaning variable xlylzl */ + if((PyObject *)capi_f_as_array!=f_capi) { + Py_XDECREF(capi_f_as_array); } + } /* if (capi_f_as_array == NULL) ... else of f */ + /* End of cleaning variable f */ + } /*CHECKSCALAR(shape(s, 0) == n)*/ + /* End of cleaning variable n */ + if((PyObject *)capi_dist_as_array!=dist_capi) { + Py_XDECREF(capi_dist_as_array); } + } /* if (capi_dist_as_array == NULL) ... else of dist */ + /* End of cleaning variable dist */ + if((PyObject *)capi_r_as_array!=r_capi) { + Py_XDECREF(capi_r_as_array); } + } /* if (capi_r_as_array == NULL) ... else of r */ + /* End of cleaning variable r */ + if((PyObject *)capi_p_as_array!=p_capi) { + Py_XDECREF(capi_p_as_array); } + } /* if (capi_p_as_array == NULL) ... else of p */ + /* End of cleaning variable p */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of compute_xlylzl ***************************/ + +/******************************** quickorient ********************************/ +static char doc_f2py_rout__cImageD11_quickorient[] = "\ +quickorient(ubi,bt)\n\nWrapper for ``quickorient``.\ +\n\nParameters\n----------\n" +"ubi : in/output rank-2 array('d') with bounds (3,3)\n" +"bt : input rank-2 array('d') with bounds (3,3)"; +/* extern void quickorient(double*,double*); */ +static PyObject *f2py_rout__cImageD11_quickorient(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ubi = NULL; + npy_intp ubi_Dims[2] = {-1, -1}; + const int ubi_Rank = 2; + PyArrayObject *capi_ubi_as_array = NULL; + int capi_ubi_intent = 0; + PyObject *ubi_capi = Py_None; + double *bt = NULL; + npy_intp bt_Dims[2] = {-1, -1}; + const int bt_Rank = 2; + PyArrayObject *capi_bt_as_array = NULL; + int capi_bt_intent = 0; + PyObject *bt_capi = Py_None; + static char *capi_kwlist[] = {"ubi","bt",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.quickorient",\ + capi_kwlist,&ubi_capi,&bt_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ubi */ + ubi_Dims[0]=3,ubi_Dims[1]=3; + capi_ubi_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.quickorient: failed to create array from the 1st argument `ubi`"; + capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); + if (capi_ubi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); + + /* Processing variable bt */ + bt_Dims[0]=3,bt_Dims[1]=3; + capi_bt_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.quickorient: failed to create array from the 2nd argument `bt`"; + capi_bt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bt_Dims,bt_Rank, capi_bt_intent,bt_capi,capi_errmess); + if (capi_bt_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bt = (double *)(PyArray_DATA(capi_bt_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ubi,bt); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_bt_as_array!=bt_capi) { + Py_XDECREF(capi_bt_as_array); } + } /* if (capi_bt_as_array == NULL) ... else of bt */ + /* End of cleaning variable bt */ + if((PyObject *)capi_ubi_as_array!=ubi_capi) { + Py_XDECREF(capi_ubi_as_array); } + } /* if (capi_ubi_as_array == NULL) ... else of ubi */ + /* End of cleaning variable ubi */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of quickorient *****************************/ + +/*********************** cimaged11_omp_set_num_threads ***********************/ +static char doc_f2py_rout__cImageD11_cimaged11_omp_set_num_threads[] = "\ +cimaged11_omp_set_num_threads(n)\n\nWrapper for ``cimaged11_omp_set_num_threads``.\ +\n\nParameters\n----------\n" +"n : input int"; +/* extern void cimaged11_omp_set_num_threads(int); */ +static PyObject *f2py_rout__cImageD11_cimaged11_omp_set_num_threads(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int n = 0; + PyObject *n_capi = Py_None; + static char *capi_kwlist[] = {"n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:_cImageD11.cimaged11_omp_set_num_threads",\ + capi_kwlist,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable n */ + f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.cimaged11_omp_set_num_threads() 1st argument (n) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************** end of cimaged11_omp_set_num_threads ********************/ + +/*********************** cimaged11_omp_get_max_threads ***********************/ +static char doc_f2py_rout__cImageD11_cimaged11_omp_get_max_threads[] = "\ +cimaged11_omp_get_max_threads = cimaged11_omp_get_max_threads()\n\nWrapper for ``cimaged11_omp_get_max_threads``.\ +\n\nReturns\n-------\n" +"cimaged11_omp_get_max_threads : int"; +/* extern int cimaged11_omp_get_max_threads(void); */ +static PyObject *f2py_rout__cImageD11_cimaged11_omp_get_max_threads(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(void)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int cimaged11_omp_get_max_threads_return_value=0; + static char *capi_kwlist[] = {NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "|:_cImageD11.cimaged11_omp_get_max_threads",\ + capi_kwlist)) + return NULL; +/*frompyobj*/ +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + cimaged11_omp_get_max_threads_return_value = (*f2py_func)(); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",cimaged11_omp_get_max_threads_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************** end of cimaged11_omp_get_max_threads ********************/ + +/************************** uint16_to_float_darksub **************************/ +static char doc_f2py_rout__cImageD11_uint16_to_float_darksub[] = "\ +uint16_to_float_darksub(img,drk,data)\n\nWrapper for ``uint16_to_float_darksub``.\ +\n\nParameters\n----------\n" +"img : in/output rank-1 array('f') with bounds (npx)\n" +"drk : input rank-1 array('f') with bounds (npx)\n" +"data : input rank-1 array('H') with bounds (npx)"; +/* extern void uint16_to_float_darksub(float*,float*,unsigned_short*,int); */ +static PyObject *f2py_rout__cImageD11_uint16_to_float_darksub(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,float*,unsigned_short*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[1] = {-1}; + const int img_Rank = 1; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + float *drk = NULL; + npy_intp drk_Dims[1] = {-1}; + const int drk_Rank = 1; + PyArrayObject *capi_drk_as_array = NULL; + int capi_drk_intent = 0; + PyObject *drk_capi = Py_None; + unsigned_short *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int npx = 0; + static char *capi_kwlist[] = {"img","drk","data",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.uint16_to_float_darksub",\ + capi_kwlist,&img_capi,&drk_capi,&data_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darksub: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable npx */ + npx = shape(img, 0); + CHECKSCALAR(shape(img, 0) == npx,"shape(img, 0) == npx","hidden npx","uint16_to_float_darksub:npx=%d",npx) { + /* Processing variable drk */ + drk_Dims[0]=npx; + capi_drk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darksub: failed to create array from the 2nd argument `drk`"; + capi_drk_as_array = ndarray_from_pyobj( NPY_FLOAT,1,drk_Dims,drk_Rank, capi_drk_intent,drk_capi,capi_errmess); + if (capi_drk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + drk = (float *)(PyArray_DATA(capi_drk_as_array)); + + /* Processing variable data */ + data_Dims[0]=npx; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darksub: failed to create array from the 3rd argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(img,drk,data,npx); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ + if((PyObject *)capi_drk_as_array!=drk_capi) { + Py_XDECREF(capi_drk_as_array); } + } /* if (capi_drk_as_array == NULL) ... else of drk */ + /* End of cleaning variable drk */ + } /*CHECKSCALAR(shape(img, 0) == npx)*/ + /* End of cleaning variable npx */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of uint16_to_float_darksub ***********************/ + +/************************** uint16_to_float_darkflm **************************/ +static char doc_f2py_rout__cImageD11_uint16_to_float_darkflm[] = "\ +uint16_to_float_darkflm(img,drk,flm,data)\n\nWrapper for ``uint16_to_float_darkflm``.\ +\n\nParameters\n----------\n" +"img : in/output rank-1 array('f') with bounds (npx)\n" +"drk : input rank-1 array('f') with bounds (npx)\n" +"flm : input rank-1 array('f') with bounds (npx)\n" +"data : input rank-1 array('H') with bounds (npx)"; +/* extern void uint16_to_float_darkflm(float*,float*,float*,unsigned_short*,int); */ +static PyObject *f2py_rout__cImageD11_uint16_to_float_darkflm(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,float*,float*,unsigned_short*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[1] = {-1}; + const int img_Rank = 1; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + float *drk = NULL; + npy_intp drk_Dims[1] = {-1}; + const int drk_Rank = 1; + PyArrayObject *capi_drk_as_array = NULL; + int capi_drk_intent = 0; + PyObject *drk_capi = Py_None; + float *flm = NULL; + npy_intp flm_Dims[1] = {-1}; + const int flm_Rank = 1; + PyArrayObject *capi_flm_as_array = NULL; + int capi_flm_intent = 0; + PyObject *flm_capi = Py_None; + unsigned_short *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int npx = 0; + static char *capi_kwlist[] = {"img","drk","flm","data",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.uint16_to_float_darkflm",\ + capi_kwlist,&img_capi,&drk_capi,&flm_capi,&data_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable npx */ + npx = shape(img, 0); + CHECKSCALAR(shape(img, 0) == npx,"shape(img, 0) == npx","hidden npx","uint16_to_float_darkflm:npx=%d",npx) { + /* Processing variable drk */ + drk_Dims[0]=npx; + capi_drk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 2nd argument `drk`"; + capi_drk_as_array = ndarray_from_pyobj( NPY_FLOAT,1,drk_Dims,drk_Rank, capi_drk_intent,drk_capi,capi_errmess); + if (capi_drk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + drk = (float *)(PyArray_DATA(capi_drk_as_array)); + + /* Processing variable flm */ + flm_Dims[0]=npx; + capi_flm_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 3rd argument `flm`"; + capi_flm_as_array = ndarray_from_pyobj( NPY_FLOAT,1,flm_Dims,flm_Rank, capi_flm_intent,flm_capi,capi_errmess); + if (capi_flm_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + flm = (float *)(PyArray_DATA(capi_flm_as_array)); + + /* Processing variable data */ + data_Dims[0]=npx; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 4th argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(img,drk,flm,data,npx); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ + if((PyObject *)capi_flm_as_array!=flm_capi) { + Py_XDECREF(capi_flm_as_array); } + } /* if (capi_flm_as_array == NULL) ... else of flm */ + /* End of cleaning variable flm */ + if((PyObject *)capi_drk_as_array!=drk_capi) { + Py_XDECREF(capi_drk_as_array); } + } /* if (capi_drk_as_array == NULL) ... else of drk */ + /* End of cleaning variable drk */ + } /*CHECKSCALAR(shape(img, 0) == npx)*/ + /* End of cleaning variable npx */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of uint16_to_float_darkflm ***********************/ + +/******************************** frelon_lines ********************************/ +static char doc_f2py_rout__cImageD11_frelon_lines[] = "\ +frelon_lines(img,cut)\n\nWrapper for ``frelon_lines``.\ +\n\nParameters\n----------\n" +"img : in/output rank-2 array('f') with bounds (ns,nf)\n" +"cut : input float"; +/* extern void frelon_lines(float*,int,int,float); */ +static PyObject *f2py_rout__cImageD11_frelon_lines(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int,int,float)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[2] = {-1, -1}; + const int img_Rank = 2; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + int ns = 0; + int nf = 0; + float cut = 0; + PyObject *cut_capi = Py_None; + static char *capi_kwlist[] = {"img","cut",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.frelon_lines",\ + capi_kwlist,&img_capi,&cut_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.frelon_lines: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable cut */ + f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.frelon_lines() 2nd argument (cut) can't be converted to float"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(img,0); + /* Processing variable nf */ + nf = shape(img,1); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(img,ns,nf,cut); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of frelon_lines ****************************/ + +/****************************** frelon_lines_sub ******************************/ +static char doc_f2py_rout__cImageD11_frelon_lines_sub[] = "\ +frelon_lines_sub(img,drk,cut)\n\nWrapper for ``frelon_lines_sub``.\ +\n\nParameters\n----------\n" +"img : in/output rank-2 array('f') with bounds (ns,nf)\n" +"drk : in/output rank-2 array('f') with bounds (ns,nf)\n" +"cut : input float"; +/* extern void frelon_lines_sub(float*,float*,int,int,float); */ +static PyObject *f2py_rout__cImageD11_frelon_lines_sub(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,float*,int,int,float)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[2] = {-1, -1}; + const int img_Rank = 2; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + float *drk = NULL; + npy_intp drk_Dims[2] = {-1, -1}; + const int drk_Rank = 2; + PyArrayObject *capi_drk_as_array = NULL; + int capi_drk_intent = 0; + PyObject *drk_capi = Py_None; + int ns = 0; + int nf = 0; + float cut = 0; + PyObject *cut_capi = Py_None; + static char *capi_kwlist[] = {"img","drk","cut",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.frelon_lines_sub",\ + capi_kwlist,&img_capi,&drk_capi,&cut_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.frelon_lines_sub: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable cut */ + f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.frelon_lines_sub() 3rd argument (cut) can't be converted to float"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(img,0); + /* Processing variable nf */ + nf = shape(img,1); + /* Processing variable drk */ + drk_Dims[0]=ns,drk_Dims[1]=nf; + capi_drk_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.frelon_lines_sub: failed to create array from the 2nd argument `drk`"; + capi_drk_as_array = ndarray_from_pyobj( NPY_FLOAT,1,drk_Dims,drk_Rank, capi_drk_intent,drk_capi,capi_errmess); + if (capi_drk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + drk = (float *)(PyArray_DATA(capi_drk_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(img,drk,ns,nf,cut); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_drk_as_array!=drk_capi) { + Py_XDECREF(capi_drk_as_array); } + } /* if (capi_drk_as_array == NULL) ... else of drk */ + /* End of cleaning variable drk */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of frelon_lines_sub **************************/ + +/***************************** array_mean_var_cut *****************************/ +static char doc_f2py_rout__cImageD11_array_mean_var_cut[] = "\ +mean,var = array_mean_var_cut(img,[n,cut,verbose])\n\nWrapper for ``array_mean_var_cut``.\ +\n\nParameters\n----------\n" +"img : input rank-1 array('f') with bounds (npx)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: 3\n" +"cut : input float, optional\n Default: 3.0\n" +"verbose : input int, optional\n Default: 0\n" +"\nReturns\n-------\n" +"mean : float\n" +"var : float"; +/* extern void array_mean_var_cut(float*,int,float*,float*,int,float,int); */ +static PyObject *f2py_rout__cImageD11_array_mean_var_cut(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int,float*,float*,int,float,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[1] = {-1}; + const int img_Rank = 1; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + int npx = 0; + float mean = 0; + float var = 0; + int n = 0; + PyObject *n_capi = Py_None; + float cut = 0; + PyObject *cut_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + static char *capi_kwlist[] = {"img","n","cut","verbose",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|OOO:_cImageD11.array_mean_var_cut",\ + capi_kwlist,&img_capi,&n_capi,&cut_capi,&verbose_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.array_mean_var_cut: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable mean */ + /* Processing variable var */ + /* Processing variable n */ + if (n_capi == Py_None) n = 3; else + f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.array_mean_var_cut() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + /* Processing variable verbose */ + if (verbose_capi == Py_None) verbose = 0; else + f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.array_mean_var_cut() 3rd keyword (verbose) can't be converted to int"); + if (f2py_success) { + /* Processing variable cut */ + if (cut_capi == Py_None) cut = 3.0; else + f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.array_mean_var_cut() 2nd keyword (cut) can't be converted to float"); + if (f2py_success) { + /* Processing variable npx */ + npx = shape(img,0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(img,npx,&mean,&var,n,cut,verbose); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("ff",mean,var); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable npx */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + /* End of cleaning variable var */ + /* End of cleaning variable mean */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of array_mean_var_cut *************************/ + +/***************************** array_mean_var_msk *****************************/ +static char doc_f2py_rout__cImageD11_array_mean_var_msk[] = "\ +mean,var = array_mean_var_msk(img,msk,[n,cut,verbose])\n\nWrapper for ``array_mean_var_msk``.\ +\n\nParameters\n----------\n" +"img : input rank-1 array('f') with bounds (npx)\n" +"msk : input rank-1 array('B') with bounds (npx)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: 3\n" +"cut : input float, optional\n Default: 3.0\n" +"verbose : input int, optional\n Default: 0\n" +"\nReturns\n-------\n" +"mean : float\n" +"var : float"; +/* extern void array_mean_var_msk(float*,unsigned_char*,int,float*,float*,int,float,int); */ +static PyObject *f2py_rout__cImageD11_array_mean_var_msk(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,unsigned_char*,int,float*,float*,int,float,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[1] = {-1}; + const int img_Rank = 1; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + unsigned_char *msk = NULL; + npy_intp msk_Dims[1] = {-1}; + const int msk_Rank = 1; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + int npx = 0; + float mean = 0; + float var = 0; + int n = 0; + PyObject *n_capi = Py_None; + float cut = 0; + PyObject *cut_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + static char *capi_kwlist[] = {"img","msk","n","cut","verbose",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|OOO:_cImageD11.array_mean_var_msk",\ + capi_kwlist,&img_capi,&msk_capi,&n_capi,&cut_capi,&verbose_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.array_mean_var_msk: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable mean */ + /* Processing variable var */ + /* Processing variable n */ + if (n_capi == Py_None) n = 3; else + f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.array_mean_var_msk() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + /* Processing variable verbose */ + if (verbose_capi == Py_None) verbose = 0; else + f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.array_mean_var_msk() 3rd keyword (verbose) can't be converted to int"); + if (f2py_success) { + /* Processing variable cut */ + if (cut_capi == Py_None) cut = 3.0; else + f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.array_mean_var_msk() 2nd keyword (cut) can't be converted to float"); + if (f2py_success) { + /* Processing variable npx */ + npx = shape(img,0); + /* Processing variable msk */ + msk_Dims[0]=npx; + capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.array_mean_var_msk: failed to create array from the 2nd argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(img,msk,npx,&mean,&var,n,cut,verbose); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("ff",mean,var); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ + /* End of cleaning variable npx */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + /* End of cleaning variable var */ + /* End of cleaning variable mean */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of array_mean_var_msk *************************/ + +/******************************** array_stats ********************************/ +static char doc_f2py_rout__cImageD11_array_stats[] = "\ +minval,maxval,mean,var = array_stats(img)\n\nWrapper for ``array_stats``.\ +\n\nParameters\n----------\n" +"img : input rank-1 array('f') with bounds (npx)\n" +"\nReturns\n-------\n" +"minval : float\n" +"maxval : float\n" +"mean : float\n" +"var : float"; +/* extern void array_stats(float*,int,float*,float*,float*,float*); */ +static PyObject *f2py_rout__cImageD11_array_stats(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int,float*,float*,float*,float*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[1] = {-1}; + const int img_Rank = 1; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + int npx = 0; + float minval = 0; + float maxval = 0; + float mean = 0; + float var = 0; + static char *capi_kwlist[] = {"img",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:_cImageD11.array_stats",\ + capi_kwlist,&img_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.array_stats: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable minval */ + /* Processing variable maxval */ + /* Processing variable mean */ + /* Processing variable var */ + /* Processing variable npx */ + npx = shape(img,0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(img,npx,&minval,&maxval,&mean,&var); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("ffff",minval,maxval,mean,var); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable npx */ + /* End of cleaning variable var */ + /* End of cleaning variable mean */ + /* End of cleaning variable maxval */ + /* End of cleaning variable minval */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of array_stats *****************************/ + +/****************************** array_histogram ******************************/ +static char doc_f2py_rout__cImageD11_array_histogram[] = "\ +array_histogram(img,low,high,hist)\n\nWrapper for ``array_histogram``.\ +\n\nParameters\n----------\n" +"img : input rank-1 array('f') with bounds (npx)\n" +"low : input float\n" +"high : input float\n" +"hist : in/output rank-1 array('i') with bounds (nhist)"; +/* extern void array_histogram(float*,int,float,float,int*,int); */ +static PyObject *f2py_rout__cImageD11_array_histogram(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int,float,float,int*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[1] = {-1}; + const int img_Rank = 1; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + int npx = 0; + float low = 0; + PyObject *low_capi = Py_None; + float high = 0; + PyObject *high_capi = Py_None; + int *hist = NULL; + npy_intp hist_Dims[1] = {-1}; + const int hist_Rank = 1; + PyArrayObject *capi_hist_as_array = NULL; + int capi_hist_intent = 0; + PyObject *hist_capi = Py_None; + int nhist = 0; + static char *capi_kwlist[] = {"img","low","high","hist",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.array_histogram",\ + capi_kwlist,&img_capi,&low_capi,&high_capi,&hist_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.array_histogram: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable low */ + f2py_success = float_from_pyobj(&low,low_capi,"_cImageD11.array_histogram() 2nd argument (low) can't be converted to float"); + if (f2py_success) { + /* Processing variable high */ + f2py_success = float_from_pyobj(&high,high_capi,"_cImageD11.array_histogram() 3rd argument (high) can't be converted to float"); + if (f2py_success) { + /* Processing variable hist */ + ; + capi_hist_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.array_histogram: failed to create array from the 4th argument `hist`"; + capi_hist_as_array = ndarray_from_pyobj( NPY_INT,1,hist_Dims,hist_Rank, capi_hist_intent,hist_capi,capi_errmess); + if (capi_hist_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + hist = (int *)(PyArray_DATA(capi_hist_as_array)); + + /* Processing variable npx */ + npx = shape(img,0); + /* Processing variable nhist */ + nhist = shape(hist, 0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(img,npx,low,high,hist,nhist); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable nhist */ + /* End of cleaning variable npx */ + if((PyObject *)capi_hist_as_array!=hist_capi) { + Py_XDECREF(capi_hist_as_array); } + } /* if (capi_hist_as_array == NULL) ... else of hist */ + /* End of cleaning variable hist */ + } /*if (f2py_success) of high*/ + /* End of cleaning variable high */ + } /*if (f2py_success) of low*/ + /* End of cleaning variable low */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of array_histogram ***************************/ + +/****************************** reorder_u16_a32 ******************************/ +static char doc_f2py_rout__cImageD11_reorder_u16_a32[] = "\ +reorder_u16_a32(data,adr,out)\n\nWrapper for ``reorder_u16_a32``.\ +\n\nParameters\n----------\n" +"data : input rank-1 array('H') with bounds (N)\n" +"adr : input rank-1 array('i') with bounds (N)\n" +"out : in/output rank-1 array('H') with bounds (N)"; +/* extern void reorder_u16_a32(unsigned_short*,int*,unsigned_short*,int); */ +static PyObject *f2py_rout__cImageD11_reorder_u16_a32(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(unsigned_short*,int*,unsigned_short*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + unsigned_short *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *adr = NULL; + npy_intp adr_Dims[1] = {-1}; + const int adr_Rank = 1; + PyArrayObject *capi_adr_as_array = NULL; + int capi_adr_intent = 0; + PyObject *adr_capi = Py_None; + unsigned_short *out = NULL; + npy_intp out_Dims[1] = {-1}; + const int out_Rank = 1; + PyArrayObject *capi_out_as_array = NULL; + int capi_out_intent = 0; + PyObject *out_capi = Py_None; + int N = 0; + static char *capi_kwlist[] = {"data","adr","out",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.reorder_u16_a32",\ + capi_kwlist,&data_capi,&adr_capi,&out_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable N */ + N = shape(data, 0); + CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorder_u16_a32:N=%d",N) { + /* Processing variable adr */ + adr_Dims[0]=N; + capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32: failed to create array from the 2nd argument `adr`"; + capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); + if (capi_adr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + adr = (int *)(PyArray_DATA(capi_adr_as_array)); + + /* Processing variable out */ + out_Dims[0]=N; + capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32: failed to create array from the 3rd argument `out`"; + capi_out_as_array = ndarray_from_pyobj( NPY_USHORT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); + if (capi_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + out = (unsigned_short *)(PyArray_DATA(capi_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(data,adr,out,N); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_out_as_array!=out_capi) { + Py_XDECREF(capi_out_as_array); } + } /* if (capi_out_as_array == NULL) ... else of out */ + /* End of cleaning variable out */ + if((PyObject *)capi_adr_as_array!=adr_capi) { + Py_XDECREF(capi_adr_as_array); } + } /* if (capi_adr_as_array == NULL) ... else of adr */ + /* End of cleaning variable adr */ + } /*CHECKSCALAR(shape(data, 0) == N)*/ + /* End of cleaning variable N */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of reorder_u16_a32 ***************************/ + +/****************************** reorder_f32_a32 ******************************/ +static char doc_f2py_rout__cImageD11_reorder_f32_a32[] = "\ +reorder_f32_a32(data,adr,out)\n\nWrapper for ``reorder_f32_a32``.\ +\n\nParameters\n----------\n" +"data : input rank-1 array('f') with bounds (N)\n" +"adr : input rank-1 array('i') with bounds (N)\n" +"out : in/output rank-1 array('f') with bounds (N)"; +/* extern void reorder_f32_a32(float*,int*,float*,int); */ +static PyObject *f2py_rout__cImageD11_reorder_f32_a32(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int*,float*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *adr = NULL; + npy_intp adr_Dims[1] = {-1}; + const int adr_Rank = 1; + PyArrayObject *capi_adr_as_array = NULL; + int capi_adr_intent = 0; + PyObject *adr_capi = Py_None; + float *out = NULL; + npy_intp out_Dims[1] = {-1}; + const int out_Rank = 1; + PyArrayObject *capi_out_as_array = NULL; + int capi_out_intent = 0; + PyObject *out_capi = Py_None; + int N = 0; + static char *capi_kwlist[] = {"data","adr","out",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.reorder_f32_a32",\ + capi_kwlist,&data_capi,&adr_capi,&out_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_f32_a32: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (float *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable N */ + N = shape(data, 0); + CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorder_f32_a32:N=%d",N) { + /* Processing variable adr */ + adr_Dims[0]=N; + capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_f32_a32: failed to create array from the 2nd argument `adr`"; + capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); + if (capi_adr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + adr = (int *)(PyArray_DATA(capi_adr_as_array)); + + /* Processing variable out */ + out_Dims[0]=N; + capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_f32_a32: failed to create array from the 3rd argument `out`"; + capi_out_as_array = ndarray_from_pyobj( NPY_FLOAT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); + if (capi_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + out = (float *)(PyArray_DATA(capi_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(data,adr,out,N); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_out_as_array!=out_capi) { + Py_XDECREF(capi_out_as_array); } + } /* if (capi_out_as_array == NULL) ... else of out */ + /* End of cleaning variable out */ + if((PyObject *)capi_adr_as_array!=adr_capi) { + Py_XDECREF(capi_adr_as_array); } + } /* if (capi_adr_as_array == NULL) ... else of adr */ + /* End of cleaning variable adr */ + } /*CHECKSCALAR(shape(data, 0) == N)*/ + /* End of cleaning variable N */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of reorder_f32_a32 ***************************/ + +/***************************** reorderlut_u16_a32 *****************************/ +static char doc_f2py_rout__cImageD11_reorderlut_u16_a32[] = "\ +reorderlut_u16_a32(data,adr,out)\n\nWrapper for ``reorderlut_u16_a32``.\ +\n\nParameters\n----------\n" +"data : input rank-1 array('H') with bounds (N)\n" +"adr : input rank-1 array('i') with bounds (N)\n" +"out : in/output rank-1 array('H') with bounds (N)"; +/* extern void reorderlut_u16_a32(unsigned_short*,int*,unsigned_short*,int); */ +static PyObject *f2py_rout__cImageD11_reorderlut_u16_a32(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(unsigned_short*,int*,unsigned_short*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + unsigned_short *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *adr = NULL; + npy_intp adr_Dims[1] = {-1}; + const int adr_Rank = 1; + PyArrayObject *capi_adr_as_array = NULL; + int capi_adr_intent = 0; + PyObject *adr_capi = Py_None; + unsigned_short *out = NULL; + npy_intp out_Dims[1] = {-1}; + const int out_Rank = 1; + PyArrayObject *capi_out_as_array = NULL; + int capi_out_intent = 0; + PyObject *out_capi = Py_None; + int N = 0; + static char *capi_kwlist[] = {"data","adr","out",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.reorderlut_u16_a32",\ + capi_kwlist,&data_capi,&adr_capi,&out_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_u16_a32: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable N */ + N = shape(data, 0); + CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorderlut_u16_a32:N=%d",N) { + /* Processing variable adr */ + adr_Dims[0]=N; + capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_u16_a32: failed to create array from the 2nd argument `adr`"; + capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); + if (capi_adr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + adr = (int *)(PyArray_DATA(capi_adr_as_array)); + + /* Processing variable out */ + out_Dims[0]=N; + capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_u16_a32: failed to create array from the 3rd argument `out`"; + capi_out_as_array = ndarray_from_pyobj( NPY_USHORT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); + if (capi_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + out = (unsigned_short *)(PyArray_DATA(capi_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(data,adr,out,N); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_out_as_array!=out_capi) { + Py_XDECREF(capi_out_as_array); } + } /* if (capi_out_as_array == NULL) ... else of out */ + /* End of cleaning variable out */ + if((PyObject *)capi_adr_as_array!=adr_capi) { + Py_XDECREF(capi_adr_as_array); } + } /* if (capi_adr_as_array == NULL) ... else of adr */ + /* End of cleaning variable adr */ + } /*CHECKSCALAR(shape(data, 0) == N)*/ + /* End of cleaning variable N */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of reorderlut_u16_a32 *************************/ + +/***************************** reorderlut_f32_a32 *****************************/ +static char doc_f2py_rout__cImageD11_reorderlut_f32_a32[] = "\ +reorderlut_f32_a32(data,adr,out)\n\nWrapper for ``reorderlut_f32_a32``.\ +\n\nParameters\n----------\n" +"data : input rank-1 array('f') with bounds (N)\n" +"adr : input rank-1 array('i') with bounds (N)\n" +"out : in/output rank-1 array('f') with bounds (N)"; +/* extern void reorderlut_f32_a32(float*,int*,float*,int); */ +static PyObject *f2py_rout__cImageD11_reorderlut_f32_a32(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int*,float*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *adr = NULL; + npy_intp adr_Dims[1] = {-1}; + const int adr_Rank = 1; + PyArrayObject *capi_adr_as_array = NULL; + int capi_adr_intent = 0; + PyObject *adr_capi = Py_None; + float *out = NULL; + npy_intp out_Dims[1] = {-1}; + const int out_Rank = 1; + PyArrayObject *capi_out_as_array = NULL; + int capi_out_intent = 0; + PyObject *out_capi = Py_None; + int N = 0; + static char *capi_kwlist[] = {"data","adr","out",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.reorderlut_f32_a32",\ + capi_kwlist,&data_capi,&adr_capi,&out_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_f32_a32: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (float *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable N */ + N = shape(data, 0); + CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorderlut_f32_a32:N=%d",N) { + /* Processing variable adr */ + adr_Dims[0]=N; + capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_f32_a32: failed to create array from the 2nd argument `adr`"; + capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); + if (capi_adr_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + adr = (int *)(PyArray_DATA(capi_adr_as_array)); + + /* Processing variable out */ + out_Dims[0]=N; + capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_f32_a32: failed to create array from the 3rd argument `out`"; + capi_out_as_array = ndarray_from_pyobj( NPY_FLOAT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); + if (capi_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + out = (float *)(PyArray_DATA(capi_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(data,adr,out,N); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_out_as_array!=out_capi) { + Py_XDECREF(capi_out_as_array); } + } /* if (capi_out_as_array == NULL) ... else of out */ + /* End of cleaning variable out */ + if((PyObject *)capi_adr_as_array!=adr_capi) { + Py_XDECREF(capi_adr_as_array); } + } /* if (capi_adr_as_array == NULL) ... else of adr */ + /* End of cleaning variable adr */ + } /*CHECKSCALAR(shape(data, 0) == N)*/ + /* End of cleaning variable N */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of reorderlut_f32_a32 *************************/ + +/**************************** reorder_u16_a32_a16 ****************************/ +static char doc_f2py_rout__cImageD11_reorder_u16_a32_a16[] = "\ +reorder_u16_a32_a16(data,adr0,adr1,out)\n\nWrapper for ``reorder_u16_a32_a16``.\ +\n\nParameters\n----------\n" +"data : input rank-2 array('H') with bounds (ns,nf)\n" +"adr0 : input rank-1 array('i') with bounds (ns)\n" +"adr1 : input rank-2 array('h') with bounds (ns,nf)\n" +"out : in/output rank-2 array('H') with bounds (ns,nf)"; +/* extern void reorder_u16_a32_a16(unsigned_short*,int*,short*,unsigned_short*,int,int); */ +static PyObject *f2py_rout__cImageD11_reorder_u16_a32_a16(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(unsigned_short*,int*,short*,unsigned_short*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + unsigned_short *data = NULL; + npy_intp data_Dims[2] = {-1, -1}; + const int data_Rank = 2; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *adr0 = NULL; + npy_intp adr0_Dims[1] = {-1}; + const int adr0_Rank = 1; + PyArrayObject *capi_adr0_as_array = NULL; + int capi_adr0_intent = 0; + PyObject *adr0_capi = Py_None; + short *adr1 = NULL; + npy_intp adr1_Dims[2] = {-1, -1}; + const int adr1_Rank = 2; + PyArrayObject *capi_adr1_as_array = NULL; + int capi_adr1_intent = 0; + PyObject *adr1_capi = Py_None; + unsigned_short *out = NULL; + npy_intp out_Dims[2] = {-1, -1}; + const int out_Rank = 2; + PyArrayObject *capi_out_as_array = NULL; + int capi_out_intent = 0; + PyObject *out_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"data","adr0","adr1","out",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.reorder_u16_a32_a16",\ + capi_kwlist,&data_capi,&adr0_capi,&adr1_capi,&out_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable adr1 */ + ; + capi_adr1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 3rd argument `adr1`"; + capi_adr1_as_array = ndarray_from_pyobj( NPY_SHORT,1,adr1_Dims,adr1_Rank, capi_adr1_intent,adr1_capi,capi_errmess); + if (capi_adr1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + adr1 = (short *)(PyArray_DATA(capi_adr1_as_array)); + + /* Processing variable ns */ + ns = shape(adr1,0); + /* Processing variable nf */ + nf = shape(adr1,1); + /* Processing variable data */ + data_Dims[0]=ns,data_Dims[1]=nf; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable adr0 */ + adr0_Dims[0]=ns; + capi_adr0_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 2nd argument `adr0`"; + capi_adr0_as_array = ndarray_from_pyobj( NPY_INT,1,adr0_Dims,adr0_Rank, capi_adr0_intent,adr0_capi,capi_errmess); + if (capi_adr0_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + adr0 = (int *)(PyArray_DATA(capi_adr0_as_array)); + + /* Processing variable out */ + out_Dims[0]=ns,out_Dims[1]=nf; + capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 4th argument `out`"; + capi_out_as_array = ndarray_from_pyobj( NPY_USHORT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); + if (capi_out_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + out = (unsigned_short *)(PyArray_DATA(capi_out_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(data,adr0,adr1,out,ns,nf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_out_as_array!=out_capi) { + Py_XDECREF(capi_out_as_array); } + } /* if (capi_out_as_array == NULL) ... else of out */ + /* End of cleaning variable out */ + if((PyObject *)capi_adr0_as_array!=adr0_capi) { + Py_XDECREF(capi_adr0_as_array); } + } /* if (capi_adr0_as_array == NULL) ... else of adr0 */ + /* End of cleaning variable adr0 */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + if((PyObject *)capi_adr1_as_array!=adr1_capi) { + Py_XDECREF(capi_adr1_as_array); } + } /* if (capi_adr1_as_array == NULL) ... else of adr1 */ + /* End of cleaning variable adr1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of reorder_u16_a32_a16 *************************/ + +/*********************************** bgcalc ***********************************/ +static char doc_f2py_rout__cImageD11_bgcalc[] = "\ +bgcalc(img,bg,msk,gain,sp,st)\n\nWrapper for ``bgcalc``.\ +\n\nParameters\n----------\n" +"img : input rank-2 array('f') with bounds (ns,nf)\n" +"bg : in/output rank-2 array('f') with bounds (ns,nf)\n" +"msk : in/output rank-2 array('b') with bounds (ns,nf)\n" +"gain : input float\n" +"sp : input float\n" +"st : input float"; +/* extern void bgcalc(float*,float*,signed_char*,int,int,float,float,float); */ +static PyObject *f2py_rout__cImageD11_bgcalc(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,float*,signed_char*,int,int,float,float,float)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *img = NULL; + npy_intp img_Dims[2] = {-1, -1}; + const int img_Rank = 2; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + float *bg = NULL; + npy_intp bg_Dims[2] = {-1, -1}; + const int bg_Rank = 2; + PyArrayObject *capi_bg_as_array = NULL; + int capi_bg_intent = 0; + PyObject *bg_capi = Py_None; + signed_char *msk = NULL; + npy_intp msk_Dims[2] = {-1, -1}; + const int msk_Rank = 2; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + int ns = 0; + int nf = 0; + float gain = 0; + PyObject *gain_capi = Py_None; + float sp = 0; + PyObject *sp_capi = Py_None; + float st = 0; + PyObject *st_capi = Py_None; + static char *capi_kwlist[] = {"img","bg","msk","gain","sp","st",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.bgcalc",\ + capi_kwlist,&img_capi,&bg_capi,&msk_capi,&gain_capi,&sp_capi,&st_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.bgcalc: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable gain */ + f2py_success = float_from_pyobj(&gain,gain_capi,"_cImageD11.bgcalc() 4th argument (gain) can't be converted to float"); + if (f2py_success) { + /* Processing variable sp */ + f2py_success = float_from_pyobj(&sp,sp_capi,"_cImageD11.bgcalc() 5th argument (sp) can't be converted to float"); + if (f2py_success) { + /* Processing variable st */ + f2py_success = float_from_pyobj(&st,st_capi,"_cImageD11.bgcalc() 6th argument (st) can't be converted to float"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(img,0); + /* Processing variable nf */ + nf = shape(img,1); + /* Processing variable bg */ + bg_Dims[0]=ns,bg_Dims[1]=nf; + capi_bg_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.bgcalc: failed to create array from the 2nd argument `bg`"; + capi_bg_as_array = ndarray_from_pyobj( NPY_FLOAT,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); + if (capi_bg_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + bg = (float *)(PyArray_DATA(capi_bg_as_array)); + + /* Processing variable msk */ + msk_Dims[0]=ns,msk_Dims[1]=nf; + capi_msk_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.bgcalc: failed to create array from the 3rd argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(img,bg,msk,ns,nf,gain,sp,st); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ + if((PyObject *)capi_bg_as_array!=bg_capi) { + Py_XDECREF(capi_bg_as_array); } + } /* if (capi_bg_as_array == NULL) ... else of bg */ + /* End of cleaning variable bg */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of st*/ + /* End of cleaning variable st */ + } /*if (f2py_success) of sp*/ + /* End of cleaning variable sp */ + } /*if (f2py_success) of gain*/ + /* End of cleaning variable gain */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of bgcalc *******************************/ + +/****************************** verify_rounding ******************************/ +static char doc_f2py_rout__cImageD11_verify_rounding[] = "\ +verify_rounding = verify_rounding(n)\n\nWrapper for ``verify_rounding``.\ +\n\nParameters\n----------\n" +"n : input int\n" +"\nReturns\n-------\n" +"verify_rounding : int"; +/* extern int verify_rounding(int); */ +static PyObject *f2py_rout__cImageD11_verify_rounding(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int verify_rounding_return_value=0; + int n = 0; + PyObject *n_capi = Py_None; + static char *capi_kwlist[] = {"n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:_cImageD11.verify_rounding",\ + capi_kwlist,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable n */ + f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.verify_rounding() 1st argument (n) can't be converted to int"); + if (f2py_success) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + verify_rounding_return_value = (*f2py_func)(n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",verify_rounding_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of verify_rounding ***************************/ + +/******************************** closest_vec ********************************/ +static char doc_f2py_rout__cImageD11_closest_vec[] = "\ +closest_vec(x,ic)\n\nWrapper for ``closest_vec``.\ +\n\nParameters\n----------\n" +"x : input rank-2 array('d') with bounds (nv,dim)\n" +"ic : in/output rank-1 array('i') with bounds (nv)"; +/* extern void closest_vec(double*,int,int,int*); */ +static PyObject *f2py_rout__cImageD11_closest_vec(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int,int,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *x = NULL; + npy_intp x_Dims[2] = {-1, -1}; + const int x_Rank = 2; + PyArrayObject *capi_x_as_array = NULL; + int capi_x_intent = 0; + PyObject *x_capi = Py_None; + int dim = 0; + int nv = 0; + int *ic = NULL; + npy_intp ic_Dims[1] = {-1}; + const int ic_Rank = 1; + PyArrayObject *capi_ic_as_array = NULL; + int capi_ic_intent = 0; + PyObject *ic_capi = Py_None; + static char *capi_kwlist[] = {"x","ic",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.closest_vec",\ + capi_kwlist,&x_capi,&ic_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable x */ + ; + capi_x_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.closest_vec: failed to create array from the 1st argument `x`"; + capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); + if (capi_x_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x = (double *)(PyArray_DATA(capi_x_as_array)); + + /* Processing variable dim */ + dim = shape(x,1); + /* Processing variable nv */ + nv = shape(x,0); + /* Processing variable ic */ + ic_Dims[0]=nv; + capi_ic_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.closest_vec: failed to create array from the 2nd argument `ic`"; + capi_ic_as_array = ndarray_from_pyobj( NPY_INT,1,ic_Dims,ic_Rank, capi_ic_intent,ic_capi,capi_errmess); + if (capi_ic_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ic = (int *)(PyArray_DATA(capi_ic_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(x,dim,nv,ic); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_ic_as_array!=ic_capi) { + Py_XDECREF(capi_ic_as_array); } + } /* if (capi_ic_as_array == NULL) ... else of ic */ + /* End of cleaning variable ic */ + /* End of cleaning variable nv */ + /* End of cleaning variable dim */ + if((PyObject *)capi_x_as_array!=x_capi) { + Py_XDECREF(capi_x_as_array); } + } /* if (capi_x_as_array == NULL) ... else of x */ + /* End of cleaning variable x */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of closest_vec *****************************/ + +/********************************** closest **********************************/ +static char doc_f2py_rout__cImageD11_closest[] = "\ +ibest,best = closest(x,v)\n\nWrapper for ``closest``.\ +\n\nParameters\n----------\n" +"x : input rank-1 array('d') with bounds (nx)\n" +"v : input rank-1 array('d') with bounds (nv)\n" +"\nReturns\n-------\n" +"ibest : int\n" +"best : float"; +/* extern void closest(double*,double*,int*,double*,int,int); */ +static PyObject *f2py_rout__cImageD11_closest(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,double*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *x = NULL; + npy_intp x_Dims[1] = {-1}; + const int x_Rank = 1; + PyArrayObject *capi_x_as_array = NULL; + int capi_x_intent = 0; + PyObject *x_capi = Py_None; + double *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + int ibest = 0; + double best = 0; + int nx = 0; + int nv = 0; + static char *capi_kwlist[] = {"x","v",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.closest",\ + capi_kwlist,&x_capi,&v_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable x */ + ; + capi_x_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "_cImageD11._cImageD11.closest: failed to create array from the 1st argument `x`"; + capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); + if (capi_x_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + x = (double *)(PyArray_DATA(capi_x_as_array)); + + /* Processing variable v */ + ; + capi_v_intent |= F2PY_INTENT_IN; + const char * capi_errmess = "_cImageD11._cImageD11.closest: failed to create array from the 2nd argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (double *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable ibest */ + /* Processing variable best */ + /* Processing variable nx */ + nx = shape(x,0); + /* Processing variable nv */ + nv = shape(v,0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(x,v,&ibest,&best,nx,nv); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("id",ibest,best); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable nv */ + /* End of cleaning variable nx */ + /* End of cleaning variable best */ + /* End of cleaning variable ibest */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ + if((PyObject *)capi_x_as_array!=x_capi) { + Py_XDECREF(capi_x_as_array); } + } /* if (capi_x_as_array == NULL) ... else of x */ + /* End of cleaning variable x */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************* end of closest *******************************/ + +/*********************************** score ***********************************/ +static char doc_f2py_rout__cImageD11_score[] = "\ +score = score(ubi,gv,tol)\n\nWrapper for ``score``.\ +\n\nParameters\n----------\n" +"ubi : input rank-2 array('d') with bounds (3,3)\n" +"gv : input rank-2 array('d') with bounds (ng,3)\n" +"tol : input float\n" +"\nReturns\n-------\n" +"score : int"; +/* extern int score(double*,double*,double,int); */ +static PyObject *f2py_rout__cImageD11_score(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(double*,double*,double,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int score_return_value=0; + double *ubi = NULL; + npy_intp ubi_Dims[2] = {-1, -1}; + const int ubi_Rank = 2; + PyArrayObject *capi_ubi_as_array = NULL; + int capi_ubi_intent = 0; + PyObject *ubi_capi = Py_None; + double *gv = NULL; + npy_intp gv_Dims[2] = {-1, -1}; + const int gv_Rank = 2; + PyArrayObject *capi_gv_as_array = NULL; + int capi_gv_intent = 0; + PyObject *gv_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + int ng = 0; + static char *capi_kwlist[] = {"ubi","gv","tol",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.score",\ + capi_kwlist,&ubi_capi,&gv_capi,&tol_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ubi */ + ubi_Dims[0]=3,ubi_Dims[1]=3; + capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score: failed to create array from the 1st argument `ubi`"; + capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); + if (capi_ubi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); + + /* Processing variable gv */ + gv_Dims[1]=3; + capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score: failed to create array from the 2nd argument `gv`"; + capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); + if (capi_gv_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gv = (double *)(PyArray_DATA(capi_gv_as_array)); + + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.score() 3rd argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable ng */ + ng = shape(gv, 0); + CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","score:ng=%d",ng) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + score_return_value = (*f2py_func)(ubi,gv,tol,ng); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",score_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(gv, 0) == ng)*/ + /* End of cleaning variable ng */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + if((PyObject *)capi_gv_as_array!=gv_capi) { + Py_XDECREF(capi_gv_as_array); } + } /* if (capi_gv_as_array == NULL) ... else of gv */ + /* End of cleaning variable gv */ + if((PyObject *)capi_ubi_as_array!=ubi_capi) { + Py_XDECREF(capi_ubi_as_array); } + } /* if (capi_ubi_as_array == NULL) ... else of ubi */ + /* End of cleaning variable ubi */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of score ********************************/ + +/****************************** score_and_refine ******************************/ +static char doc_f2py_rout__cImageD11_score_and_refine[] = "\ +n,sumdrlv2 = score_and_refine(ubi,gv,tol)\n\nWrapper for ``score_and_refine``.\ +\n\nParameters\n----------\n" +"ubi : in/output rank-2 array('d') with bounds (3,3)\n" +"gv : input rank-2 array('d') with bounds (ng,3)\n" +"tol : input float\n" +"\nReturns\n-------\n" +"n : int\n" +"sumdrlv2 : float"; +/* extern void score_and_refine(double*,double*,double,int*,double*,int); */ +static PyObject *f2py_rout__cImageD11_score_and_refine(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double,int*,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ubi = NULL; + npy_intp ubi_Dims[2] = {-1, -1}; + const int ubi_Rank = 2; + PyArrayObject *capi_ubi_as_array = NULL; + int capi_ubi_intent = 0; + PyObject *ubi_capi = Py_None; + double *gv = NULL; + npy_intp gv_Dims[2] = {-1, -1}; + const int gv_Rank = 2; + PyArrayObject *capi_gv_as_array = NULL; + int capi_gv_intent = 0; + PyObject *gv_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + int n = 0; + double sumdrlv2 = 0; + int ng = 0; + static char *capi_kwlist[] = {"ubi","gv","tol",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.score_and_refine",\ + capi_kwlist,&ubi_capi,&gv_capi,&tol_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable n */ + /* Processing variable sumdrlv2 */ + /* Processing variable ubi */ + ubi_Dims[0]=3,ubi_Dims[1]=3; + capi_ubi_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_and_refine: failed to create array from the 1st argument `ubi`"; + capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); + if (capi_ubi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); + + /* Processing variable gv */ + gv_Dims[1]=3; + capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_and_refine: failed to create array from the 2nd argument `gv`"; + capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); + if (capi_gv_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gv = (double *)(PyArray_DATA(capi_gv_as_array)); + + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.score_and_refine() 3rd argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable ng */ + ng = shape(gv, 0); + CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","score_and_refine:ng=%d",ng) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(ubi,gv,tol,&n,&sumdrlv2,ng); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("id",n,sumdrlv2); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(gv, 0) == ng)*/ + /* End of cleaning variable ng */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + if((PyObject *)capi_gv_as_array!=gv_capi) { + Py_XDECREF(capi_gv_as_array); } + } /* if (capi_gv_as_array == NULL) ... else of gv */ + /* End of cleaning variable gv */ + if((PyObject *)capi_ubi_as_array!=ubi_capi) { + Py_XDECREF(capi_ubi_as_array); } + } /* if (capi_ubi_as_array == NULL) ... else of ubi */ + /* End of cleaning variable ubi */ + /* End of cleaning variable sumdrlv2 */ + /* End of cleaning variable n */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of score_and_refine **************************/ + +/****************************** score_and_assign ******************************/ +static char doc_f2py_rout__cImageD11_score_and_assign[] = "\ +score_and_assign = score_and_assign(ubi,gv,tol,drlv2,labels,label)\n\nWrapper for ``score_and_assign``.\ +\n\nParameters\n----------\n" +"ubi : input rank-2 array('d') with bounds (3,3)\n" +"gv : input rank-2 array('d') with bounds (ng,3)\n" +"tol : input float\n" +"drlv2 : in/output rank-1 array('d') with bounds (ng)\n" +"labels : in/output rank-1 array('i') with bounds (ng)\n" +"label : input int\n" +"\nReturns\n-------\n" +"score_and_assign : int"; +/* extern int score_and_assign(double*,double*,double,double*,int*,int,int); */ +static PyObject *f2py_rout__cImageD11_score_and_assign(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(double*,double*,double,double*,int*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int score_and_assign_return_value=0; + double *ubi = NULL; + npy_intp ubi_Dims[2] = {-1, -1}; + const int ubi_Rank = 2; + PyArrayObject *capi_ubi_as_array = NULL; + int capi_ubi_intent = 0; + PyObject *ubi_capi = Py_None; + double *gv = NULL; + npy_intp gv_Dims[2] = {-1, -1}; + const int gv_Rank = 2; + PyArrayObject *capi_gv_as_array = NULL; + int capi_gv_intent = 0; + PyObject *gv_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + double *drlv2 = NULL; + npy_intp drlv2_Dims[1] = {-1}; + const int drlv2_Rank = 1; + PyArrayObject *capi_drlv2_as_array = NULL; + int capi_drlv2_intent = 0; + PyObject *drlv2_capi = Py_None; + int *labels = NULL; + npy_intp labels_Dims[1] = {-1}; + const int labels_Rank = 1; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + int label = 0; + PyObject *label_capi = Py_None; + int ng = 0; + static char *capi_kwlist[] = {"ubi","gv","tol","drlv2","labels","label",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.score_and_assign",\ + capi_kwlist,&ubi_capi,&gv_capi,&tol_capi,&drlv2_capi,&labels_capi,&label_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ubi */ + ubi_Dims[0]=3,ubi_Dims[1]=3; + capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 1st argument `ubi`"; + capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); + if (capi_ubi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); + + /* Processing variable gv */ + gv_Dims[1]=3; + capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 2nd argument `gv`"; + capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); + if (capi_gv_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gv = (double *)(PyArray_DATA(capi_gv_as_array)); + + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.score_and_assign() 3rd argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable label */ + f2py_success = int_from_pyobj(&label,label_capi,"_cImageD11.score_and_assign() 6th argument (label) can't be converted to int"); + if (f2py_success) { + /* Processing variable ng */ + ng = shape(gv, 0); + CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","score_and_assign:ng=%d",ng) { + /* Processing variable drlv2 */ + drlv2_Dims[0]=ng; + capi_drlv2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 4th argument `drlv2`"; + capi_drlv2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,drlv2_Dims,drlv2_Rank, capi_drlv2_intent,drlv2_capi,capi_errmess); + if (capi_drlv2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + drlv2 = (double *)(PyArray_DATA(capi_drlv2_as_array)); + + /* Processing variable labels */ + labels_Dims[0]=ng; + capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 5th argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + score_and_assign_return_value = (*f2py_func)(ubi,gv,tol,drlv2,labels,label,ng); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",score_and_assign_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + if((PyObject *)capi_drlv2_as_array!=drlv2_capi) { + Py_XDECREF(capi_drlv2_as_array); } + } /* if (capi_drlv2_as_array == NULL) ... else of drlv2 */ + /* End of cleaning variable drlv2 */ + } /*CHECKSCALAR(shape(gv, 0) == ng)*/ + /* End of cleaning variable ng */ + } /*if (f2py_success) of label*/ + /* End of cleaning variable label */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + if((PyObject *)capi_gv_as_array!=gv_capi) { + Py_XDECREF(capi_gv_as_array); } + } /* if (capi_gv_as_array == NULL) ... else of gv */ + /* End of cleaning variable gv */ + if((PyObject *)capi_ubi_as_array!=ubi_capi) { + Py_XDECREF(capi_ubi_as_array); } + } /* if (capi_ubi_as_array == NULL) ... else of ubi */ + /* End of cleaning variable ubi */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of score_and_assign **************************/ + +/****************************** refine_assigned ******************************/ +static char doc_f2py_rout__cImageD11_refine_assigned[] = "\ +npk,drlv2 = refine_assigned(ubi,gv,labels,label)\n\nWrapper for ``refine_assigned``.\ +\n\nParameters\n----------\n" +"ubi : input rank-2 array('d') with bounds (3,3)\n" +"gv : input rank-2 array('d') with bounds (ng,3)\n" +"labels : input rank-1 array('i') with bounds (ng)\n" +"label : input int\n" +"\nReturns\n-------\n" +"npk : int\n" +"drlv2 : float"; +/* extern void refine_assigned(double*,double*,int*,int,int*,double*,int); */ +static PyObject *f2py_rout__cImageD11_refine_assigned(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int*,int,int*,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ubi = NULL; + npy_intp ubi_Dims[2] = {-1, -1}; + const int ubi_Rank = 2; + PyArrayObject *capi_ubi_as_array = NULL; + int capi_ubi_intent = 0; + PyObject *ubi_capi = Py_None; + double *gv = NULL; + npy_intp gv_Dims[2] = {-1, -1}; + const int gv_Rank = 2; + PyArrayObject *capi_gv_as_array = NULL; + int capi_gv_intent = 0; + PyObject *gv_capi = Py_None; + int *labels = NULL; + npy_intp labels_Dims[1] = {-1}; + const int labels_Rank = 1; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + int label = 0; + PyObject *label_capi = Py_None; + int npk = 0; + double drlv2 = 0; + int ng = 0; + static char *capi_kwlist[] = {"ubi","gv","labels","label",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.refine_assigned",\ + capi_kwlist,&ubi_capi,&gv_capi,&labels_capi,&label_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ubi */ + ubi_Dims[0]=3,ubi_Dims[1]=3; + capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.refine_assigned: failed to create array from the 1st argument `ubi`"; + capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); + if (capi_ubi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); + + /* Processing variable gv */ + gv_Dims[1]=3; + capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.refine_assigned: failed to create array from the 2nd argument `gv`"; + capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); + if (capi_gv_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gv = (double *)(PyArray_DATA(capi_gv_as_array)); + + /* Processing variable label */ + f2py_success = int_from_pyobj(&label,label_capi,"_cImageD11.refine_assigned() 4th argument (label) can't be converted to int"); + if (f2py_success) { + /* Processing variable npk */ + /* Processing variable drlv2 */ + /* Processing variable ng */ + ng = shape(gv, 0); + CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","refine_assigned:ng=%d",ng) { + /* Processing variable labels */ + labels_Dims[0]=ng; + capi_labels_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.refine_assigned: failed to create array from the 3rd argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(ubi,gv,labels,label,&npk,&drlv2,ng); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("id",npk,drlv2); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + } /*CHECKSCALAR(shape(gv, 0) == ng)*/ + /* End of cleaning variable ng */ + /* End of cleaning variable drlv2 */ + /* End of cleaning variable npk */ + } /*if (f2py_success) of label*/ + /* End of cleaning variable label */ + if((PyObject *)capi_gv_as_array!=gv_capi) { + Py_XDECREF(capi_gv_as_array); } + } /* if (capi_gv_as_array == NULL) ... else of gv */ + /* End of cleaning variable gv */ + if((PyObject *)capi_ubi_as_array!=ubi_capi) { + Py_XDECREF(capi_ubi_as_array); } + } /* if (capi_ubi_as_array == NULL) ... else of ubi */ + /* End of cleaning variable ubi */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of refine_assigned ***************************/ + +/********************************* put_incr64 *********************************/ +static char doc_f2py_rout__cImageD11_put_incr64[] = "\ +put_incr64(data,ind,vals,[boundscheck])\n\nWrapper for ``put_incr64``.\ +\n\nParameters\n----------\n" +"data : in/output rank-1 array('f') with bounds (m)\n" +"ind : input rank-1 array('q') with bounds (n)\n" +"vals : input rank-1 array('f') with bounds (n)\n" +"\nOther Parameters\n----------------\n" +"boundscheck : input int, optional\n Default: 0"; +/* extern void put_incr64(float*,long_long*,float*,int,int,int); */ +static PyObject *f2py_rout__cImageD11_put_incr64(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,long_long*,float*,int,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + long_long *ind = NULL; + npy_intp ind_Dims[1] = {-1}; + const int ind_Rank = 1; + PyArrayObject *capi_ind_as_array = NULL; + int capi_ind_intent = 0; + PyObject *ind_capi = Py_None; + float *vals = NULL; + npy_intp vals_Dims[1] = {-1}; + const int vals_Rank = 1; + PyArrayObject *capi_vals_as_array = NULL; + int capi_vals_intent = 0; + PyObject *vals_capi = Py_None; + int boundscheck = 0; + PyObject *boundscheck_capi = Py_None; + int n = 0; + int m = 0; + static char *capi_kwlist[] = {"data","ind","vals","boundscheck",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:_cImageD11.put_incr64",\ + capi_kwlist,&data_capi,&ind_capi,&vals_capi,&boundscheck_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.put_incr64: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (float *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable ind */ + ; + capi_ind_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.put_incr64: failed to create array from the 2nd argument `ind`"; + capi_ind_as_array = ndarray_from_pyobj( NPY_LONGLONG,1,ind_Dims,ind_Rank, capi_ind_intent,ind_capi,capi_errmess); + if (capi_ind_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ind = (long_long *)(PyArray_DATA(capi_ind_as_array)); + + /* Processing variable boundscheck */ + if (boundscheck_capi == Py_None) boundscheck = 0; else + f2py_success = int_from_pyobj(&boundscheck,boundscheck_capi,"_cImageD11.put_incr64() 1st keyword (boundscheck) can't be converted to int"); + if (f2py_success) { + /* Processing variable n */ + n = shape(ind, 0); + CHECKSCALAR(shape(ind, 0) == n,"shape(ind, 0) == n","hidden n","put_incr64:n=%d",n) { + /* Processing variable m */ + m = shape(data, 0); + CHECKSCALAR(shape(data, 0) == m,"shape(data, 0) == m","hidden m","put_incr64:m=%d",m) { + /* Processing variable vals */ + vals_Dims[0]=n; + capi_vals_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.put_incr64: failed to create array from the 3rd argument `vals`"; + capi_vals_as_array = ndarray_from_pyobj( NPY_FLOAT,1,vals_Dims,vals_Rank, capi_vals_intent,vals_capi,capi_errmess); + if (capi_vals_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + vals = (float *)(PyArray_DATA(capi_vals_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(data,ind,vals,boundscheck,n,m); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_vals_as_array!=vals_capi) { + Py_XDECREF(capi_vals_as_array); } + } /* if (capi_vals_as_array == NULL) ... else of vals */ + /* End of cleaning variable vals */ + } /*CHECKSCALAR(shape(data, 0) == m)*/ + /* End of cleaning variable m */ + } /*CHECKSCALAR(shape(ind, 0) == n)*/ + /* End of cleaning variable n */ + } /*if (f2py_success) of boundscheck*/ + /* End of cleaning variable boundscheck */ + if((PyObject *)capi_ind_as_array!=ind_capi) { + Py_XDECREF(capi_ind_as_array); } + } /* if (capi_ind_as_array == NULL) ... else of ind */ + /* End of cleaning variable ind */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of put_incr64 *****************************/ + +/********************************* put_incr32 *********************************/ +static char doc_f2py_rout__cImageD11_put_incr32[] = "\ +put_incr32(data,ind,vals,[boundscheck])\n\nWrapper for ``put_incr32``.\ +\n\nParameters\n----------\n" +"data : in/output rank-1 array('f') with bounds (m)\n" +"ind : input rank-1 array('i') with bounds (n)\n" +"vals : input rank-1 array('f') with bounds (n)\n" +"\nOther Parameters\n----------------\n" +"boundscheck : input int, optional\n Default: 0"; +/* extern void put_incr32(float*,int*,float*,int,int,int); */ +static PyObject *f2py_rout__cImageD11_put_incr32(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int*,float*,int,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *data = NULL; + npy_intp data_Dims[1] = {-1}; + const int data_Rank = 1; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *ind = NULL; + npy_intp ind_Dims[1] = {-1}; + const int ind_Rank = 1; + PyArrayObject *capi_ind_as_array = NULL; + int capi_ind_intent = 0; + PyObject *ind_capi = Py_None; + float *vals = NULL; + npy_intp vals_Dims[1] = {-1}; + const int vals_Rank = 1; + PyArrayObject *capi_vals_as_array = NULL; + int capi_vals_intent = 0; + PyObject *vals_capi = Py_None; + int boundscheck = 0; + PyObject *boundscheck_capi = Py_None; + int n = 0; + int m = 0; + static char *capi_kwlist[] = {"data","ind","vals","boundscheck",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|O:_cImageD11.put_incr32",\ + capi_kwlist,&data_capi,&ind_capi,&vals_capi,&boundscheck_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.put_incr32: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (float *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable ind */ + ; + capi_ind_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.put_incr32: failed to create array from the 2nd argument `ind`"; + capi_ind_as_array = ndarray_from_pyobj( NPY_INT,1,ind_Dims,ind_Rank, capi_ind_intent,ind_capi,capi_errmess); + if (capi_ind_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ind = (int *)(PyArray_DATA(capi_ind_as_array)); + + /* Processing variable boundscheck */ + if (boundscheck_capi == Py_None) boundscheck = 0; else + f2py_success = int_from_pyobj(&boundscheck,boundscheck_capi,"_cImageD11.put_incr32() 1st keyword (boundscheck) can't be converted to int"); + if (f2py_success) { + /* Processing variable n */ + n = shape(ind, 0); + CHECKSCALAR(shape(ind, 0) == n,"shape(ind, 0) == n","hidden n","put_incr32:n=%d",n) { + /* Processing variable m */ + m = shape(data, 0); + CHECKSCALAR(shape(data, 0) == m,"shape(data, 0) == m","hidden m","put_incr32:m=%d",m) { + /* Processing variable vals */ + vals_Dims[0]=n; + capi_vals_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.put_incr32: failed to create array from the 3rd argument `vals`"; + capi_vals_as_array = ndarray_from_pyobj( NPY_FLOAT,1,vals_Dims,vals_Rank, capi_vals_intent,vals_capi,capi_errmess); + if (capi_vals_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + vals = (float *)(PyArray_DATA(capi_vals_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(data,ind,vals,boundscheck,n,m); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_vals_as_array!=vals_capi) { + Py_XDECREF(capi_vals_as_array); } + } /* if (capi_vals_as_array == NULL) ... else of vals */ + /* End of cleaning variable vals */ + } /*CHECKSCALAR(shape(data, 0) == m)*/ + /* End of cleaning variable m */ + } /*CHECKSCALAR(shape(ind, 0) == n)*/ + /* End of cleaning variable n */ + } /*if (f2py_success) of boundscheck*/ + /* End of cleaning variable boundscheck */ + if((PyObject *)capi_ind_as_array!=ind_capi) { + Py_XDECREF(capi_ind_as_array); } + } /* if (capi_ind_as_array == NULL) ... else of ind */ + /* End of cleaning variable ind */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of put_incr32 *****************************/ + +/********************************* cluster1d *********************************/ +static char doc_f2py_rout__cImageD11_cluster1d[] = "\ +nclusters = cluster1d(ar,order,tol,ids,avgs)\n\nWrapper for ``cluster1d``.\ +\n\nParameters\n----------\n" +"ar : input rank-1 array('d') with bounds (n)\n" +"order : input rank-1 array('i') with bounds (n)\n" +"tol : input float\n" +"ids : in/output rank-1 array('i') with bounds (n)\n" +"avgs : in/output rank-1 array('d') with bounds (n)\n" +"\nReturns\n-------\n" +"nclusters : int"; +/* extern void cluster1d(double*,int,int*,double,int*,int*,double*); */ +static PyObject *f2py_rout__cImageD11_cluster1d(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int,int*,double,int*,int*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ar = NULL; + npy_intp ar_Dims[1] = {-1}; + const int ar_Rank = 1; + PyArrayObject *capi_ar_as_array = NULL; + int capi_ar_intent = 0; + PyObject *ar_capi = Py_None; + int n = 0; + int *order = NULL; + npy_intp order_Dims[1] = {-1}; + const int order_Rank = 1; + PyArrayObject *capi_order_as_array = NULL; + int capi_order_intent = 0; + PyObject *order_capi = Py_None; + double tol = 0; + PyObject *tol_capi = Py_None; + int nclusters = 0; + int *ids = NULL; + npy_intp ids_Dims[1] = {-1}; + const int ids_Rank = 1; + PyArrayObject *capi_ids_as_array = NULL; + int capi_ids_intent = 0; + PyObject *ids_capi = Py_None; + double *avgs = NULL; + npy_intp avgs_Dims[1] = {-1}; + const int avgs_Rank = 1; + PyArrayObject *capi_avgs_as_array = NULL; + int capi_avgs_intent = 0; + PyObject *avgs_capi = Py_None; + static char *capi_kwlist[] = {"ar","order","tol","ids","avgs",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|:_cImageD11.cluster1d",\ + capi_kwlist,&ar_capi,&order_capi,&tol_capi,&ids_capi,&avgs_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ar */ + ; + capi_ar_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 1st argument `ar`"; + capi_ar_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ar_Dims,ar_Rank, capi_ar_intent,ar_capi,capi_errmess); + if (capi_ar_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ar = (double *)(PyArray_DATA(capi_ar_as_array)); + + /* Processing variable tol */ + f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.cluster1d() 3rd argument (tol) can't be converted to double"); + if (f2py_success) { + /* Processing variable nclusters */ + /* Processing variable n */ + n = shape(ar, 0); + CHECKSCALAR(shape(ar, 0) == n,"shape(ar, 0) == n","hidden n","cluster1d:n=%d",n) { + /* Processing variable order */ + order_Dims[0]=n; + capi_order_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 2nd argument `order`"; + capi_order_as_array = ndarray_from_pyobj( NPY_INT,1,order_Dims,order_Rank, capi_order_intent,order_capi,capi_errmess); + if (capi_order_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + order = (int *)(PyArray_DATA(capi_order_as_array)); + + /* Processing variable ids */ + ids_Dims[0]=n; + capi_ids_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 4th argument `ids`"; + capi_ids_as_array = ndarray_from_pyobj( NPY_INT,1,ids_Dims,ids_Rank, capi_ids_intent,ids_capi,capi_errmess); + if (capi_ids_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ids = (int *)(PyArray_DATA(capi_ids_as_array)); + + /* Processing variable avgs */ + avgs_Dims[0]=n; + capi_avgs_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 5th argument `avgs`"; + capi_avgs_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,avgs_Dims,avgs_Rank, capi_avgs_intent,avgs_capi,capi_errmess); + if (capi_avgs_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + avgs = (double *)(PyArray_DATA(capi_avgs_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ar,n,order,tol,&nclusters,ids,avgs); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",nclusters); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_avgs_as_array!=avgs_capi) { + Py_XDECREF(capi_avgs_as_array); } + } /* if (capi_avgs_as_array == NULL) ... else of avgs */ + /* End of cleaning variable avgs */ + if((PyObject *)capi_ids_as_array!=ids_capi) { + Py_XDECREF(capi_ids_as_array); } + } /* if (capi_ids_as_array == NULL) ... else of ids */ + /* End of cleaning variable ids */ + if((PyObject *)capi_order_as_array!=order_capi) { + Py_XDECREF(capi_order_as_array); } + } /* if (capi_order_as_array == NULL) ... else of order */ + /* End of cleaning variable order */ + } /*CHECKSCALAR(shape(ar, 0) == n)*/ + /* End of cleaning variable n */ + /* End of cleaning variable nclusters */ + } /*if (f2py_success) of tol*/ + /* End of cleaning variable tol */ + if((PyObject *)capi_ar_as_array!=ar_capi) { + Py_XDECREF(capi_ar_as_array); } + } /* if (capi_ar_as_array == NULL) ... else of ar */ + /* End of cleaning variable ar */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of cluster1d ******************************/ + +/******************************** score_gvec_z ********************************/ +static char doc_f2py_rout__cImageD11_score_gvec_z[] = "\ +score_gvec_z(ubi,ub,gv,g0,g1,g2,e,recompute)\n\nWrapper for ``score_gvec_z``.\ +\n\nParameters\n----------\n" +"ubi : input rank-2 array('d') with bounds (3,3)\n" +"ub : input rank-2 array('d') with bounds (3,3)\n" +"gv : input rank-2 array('d') with bounds (n,3)\n" +"g0 : in/output rank-2 array('d') with bounds (n,3)\n" +"g1 : in/output rank-2 array('d') with bounds (n,3)\n" +"g2 : in/output rank-2 array('d') with bounds (n,3)\n" +"e : in/output rank-2 array('d') with bounds (n,3)\n" +"recompute : input int"; +/* extern void score_gvec_z(double*,double*,double*,double*,double*,double*,double*,int,int); */ +static PyObject *f2py_rout__cImageD11_score_gvec_z(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *ubi = NULL; + npy_intp ubi_Dims[2] = {-1, -1}; + const int ubi_Rank = 2; + PyArrayObject *capi_ubi_as_array = NULL; + int capi_ubi_intent = 0; + PyObject *ubi_capi = Py_None; + double *ub = NULL; + npy_intp ub_Dims[2] = {-1, -1}; + const int ub_Rank = 2; + PyArrayObject *capi_ub_as_array = NULL; + int capi_ub_intent = 0; + PyObject *ub_capi = Py_None; + double *gv = NULL; + npy_intp gv_Dims[2] = {-1, -1}; + const int gv_Rank = 2; + PyArrayObject *capi_gv_as_array = NULL; + int capi_gv_intent = 0; + PyObject *gv_capi = Py_None; + double *g0 = NULL; + npy_intp g0_Dims[2] = {-1, -1}; + const int g0_Rank = 2; + PyArrayObject *capi_g0_as_array = NULL; + int capi_g0_intent = 0; + PyObject *g0_capi = Py_None; + double *g1 = NULL; + npy_intp g1_Dims[2] = {-1, -1}; + const int g1_Rank = 2; + PyArrayObject *capi_g1_as_array = NULL; + int capi_g1_intent = 0; + PyObject *g1_capi = Py_None; + double *g2 = NULL; + npy_intp g2_Dims[2] = {-1, -1}; + const int g2_Rank = 2; + PyArrayObject *capi_g2_as_array = NULL; + int capi_g2_intent = 0; + PyObject *g2_capi = Py_None; + double *e = NULL; + npy_intp e_Dims[2] = {-1, -1}; + const int e_Rank = 2; + PyArrayObject *capi_e_as_array = NULL; + int capi_e_intent = 0; + PyObject *e_capi = Py_None; + int recompute = 0; + PyObject *recompute_capi = Py_None; + int n = 0; + static char *capi_kwlist[] = {"ubi","ub","gv","g0","g1","g2","e","recompute",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|:_cImageD11.score_gvec_z",\ + capi_kwlist,&ubi_capi,&ub_capi,&gv_capi,&g0_capi,&g1_capi,&g2_capi,&e_capi,&recompute_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable ubi */ + ubi_Dims[0]=3,ubi_Dims[1]=3; + capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 1st argument `ubi`"; + capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); + if (capi_ubi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); + + /* Processing variable ub */ + ub_Dims[0]=3,ub_Dims[1]=3; + capi_ub_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 2nd argument `ub`"; + capi_ub_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ub_Dims,ub_Rank, capi_ub_intent,ub_capi,capi_errmess); + if (capi_ub_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ub = (double *)(PyArray_DATA(capi_ub_as_array)); + + /* Processing variable gv */ + gv_Dims[1]=3; + capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 3rd argument `gv`"; + capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); + if (capi_gv_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gv = (double *)(PyArray_DATA(capi_gv_as_array)); + + /* Processing variable recompute */ + f2py_success = int_from_pyobj(&recompute,recompute_capi,"_cImageD11.score_gvec_z() 8th argument (recompute) can't be converted to int"); + if (f2py_success) { + /* Processing variable n */ + n = shape(gv, 0); + CHECKSCALAR(shape(gv, 0) == n,"shape(gv, 0) == n","hidden n","score_gvec_z:n=%d",n) { + /* Processing variable g0 */ + g0_Dims[0]=n,g0_Dims[1]=3; + capi_g0_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 4th argument `g0`"; + capi_g0_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,g0_Dims,g0_Rank, capi_g0_intent,g0_capi,capi_errmess); + if (capi_g0_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + g0 = (double *)(PyArray_DATA(capi_g0_as_array)); + + /* Processing variable g1 */ + g1_Dims[0]=n,g1_Dims[1]=3; + capi_g1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 5th argument `g1`"; + capi_g1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,g1_Dims,g1_Rank, capi_g1_intent,g1_capi,capi_errmess); + if (capi_g1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + g1 = (double *)(PyArray_DATA(capi_g1_as_array)); + + /* Processing variable g2 */ + g2_Dims[0]=n,g2_Dims[1]=3; + capi_g2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 6th argument `g2`"; + capi_g2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,g2_Dims,g2_Rank, capi_g2_intent,g2_capi,capi_errmess); + if (capi_g2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + g2 = (double *)(PyArray_DATA(capi_g2_as_array)); + + /* Processing variable e */ + e_Dims[0]=n,e_Dims[1]=3; + capi_e_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 7th argument `e`"; + capi_e_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,e_Dims,e_Rank, capi_e_intent,e_capi,capi_errmess); + if (capi_e_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + e = (double *)(PyArray_DATA(capi_e_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(ubi,ub,gv,g0,g1,g2,e,recompute,n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_e_as_array!=e_capi) { + Py_XDECREF(capi_e_as_array); } + } /* if (capi_e_as_array == NULL) ... else of e */ + /* End of cleaning variable e */ + if((PyObject *)capi_g2_as_array!=g2_capi) { + Py_XDECREF(capi_g2_as_array); } + } /* if (capi_g2_as_array == NULL) ... else of g2 */ + /* End of cleaning variable g2 */ + if((PyObject *)capi_g1_as_array!=g1_capi) { + Py_XDECREF(capi_g1_as_array); } + } /* if (capi_g1_as_array == NULL) ... else of g1 */ + /* End of cleaning variable g1 */ + if((PyObject *)capi_g0_as_array!=g0_capi) { + Py_XDECREF(capi_g0_as_array); } + } /* if (capi_g0_as_array == NULL) ... else of g0 */ + /* End of cleaning variable g0 */ + } /*CHECKSCALAR(shape(gv, 0) == n)*/ + /* End of cleaning variable n */ + } /*if (f2py_success) of recompute*/ + /* End of cleaning variable recompute */ + if((PyObject *)capi_gv_as_array!=gv_capi) { + Py_XDECREF(capi_gv_as_array); } + } /* if (capi_gv_as_array == NULL) ... else of gv */ + /* End of cleaning variable gv */ + if((PyObject *)capi_ub_as_array!=ub_capi) { + Py_XDECREF(capi_ub_as_array); } + } /* if (capi_ub_as_array == NULL) ... else of ub */ + /* End of cleaning variable ub */ + if((PyObject *)capi_ubi_as_array!=ubi_capi) { + Py_XDECREF(capi_ubi_as_array); } + } /* if (capi_ubi_as_array == NULL) ... else of ubi */ + /* End of cleaning variable ubi */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of score_gvec_z ****************************/ + +/******************************** misori_cubic ********************************/ +static char doc_f2py_rout__cImageD11_misori_cubic[] = "\ +misori_cubic = misori_cubic(u1,u2)\n\nWrapper for ``misori_cubic``.\ +\n\nParameters\n----------\n" +"u1 : input rank-2 array('d') with bounds (3,3)\n" +"u2 : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"misori_cubic : float"; +/* extern double misori_cubic(double*,double*); */ +static PyObject *f2py_rout__cImageD11_misori_cubic(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + double (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double misori_cubic_return_value=0; + double *u1 = NULL; + npy_intp u1_Dims[2] = {-1, -1}; + const int u1_Rank = 2; + PyArrayObject *capi_u1_as_array = NULL; + int capi_u1_intent = 0; + PyObject *u1_capi = Py_None; + double *u2 = NULL; + npy_intp u2_Dims[2] = {-1, -1}; + const int u2_Rank = 2; + PyArrayObject *capi_u2_as_array = NULL; + int capi_u2_intent = 0; + PyObject *u2_capi = Py_None; + static char *capi_kwlist[] = {"u1","u2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.misori_cubic",\ + capi_kwlist,&u1_capi,&u2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable u1 */ + u1_Dims[0]=3,u1_Dims[1]=3; + capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic: failed to create array from the 1st argument `u1`"; + capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); + if (capi_u1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u1 = (double *)(PyArray_DATA(capi_u1_as_array)); + + /* Processing variable u2 */ + u2_Dims[0]=3,u2_Dims[1]=3; + capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic: failed to create array from the 2nd argument `u2`"; + capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); + if (capi_u2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u2 = (double *)(PyArray_DATA(capi_u2_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + misori_cubic_return_value = (*f2py_func)(u1,u2); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",misori_cubic_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_u2_as_array!=u2_capi) { + Py_XDECREF(capi_u2_as_array); } + } /* if (capi_u2_as_array == NULL) ... else of u2 */ + /* End of cleaning variable u2 */ + if((PyObject *)capi_u1_as_array!=u1_capi) { + Py_XDECREF(capi_u1_as_array); } + } /* if (capi_u1_as_array == NULL) ... else of u1 */ + /* End of cleaning variable u1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of misori_cubic ****************************/ + +/**************************** misori_orthorhombic ****************************/ +static char doc_f2py_rout__cImageD11_misori_orthorhombic[] = "\ +misori_orthorhombic = misori_orthorhombic(u1,u2)\n\nWrapper for ``misori_orthorhombic``.\ +\n\nParameters\n----------\n" +"u1 : input rank-2 array('d') with bounds (3,3)\n" +"u2 : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"misori_orthorhombic : float"; +/* extern double misori_orthorhombic(double*,double*); */ +static PyObject *f2py_rout__cImageD11_misori_orthorhombic(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + double (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double misori_orthorhombic_return_value=0; + double *u1 = NULL; + npy_intp u1_Dims[2] = {-1, -1}; + const int u1_Rank = 2; + PyArrayObject *capi_u1_as_array = NULL; + int capi_u1_intent = 0; + PyObject *u1_capi = Py_None; + double *u2 = NULL; + npy_intp u2_Dims[2] = {-1, -1}; + const int u2_Rank = 2; + PyArrayObject *capi_u2_as_array = NULL; + int capi_u2_intent = 0; + PyObject *u2_capi = Py_None; + static char *capi_kwlist[] = {"u1","u2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.misori_orthorhombic",\ + capi_kwlist,&u1_capi,&u2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable u1 */ + u1_Dims[0]=3,u1_Dims[1]=3; + capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_orthorhombic: failed to create array from the 1st argument `u1`"; + capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); + if (capi_u1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u1 = (double *)(PyArray_DATA(capi_u1_as_array)); + + /* Processing variable u2 */ + u2_Dims[0]=3,u2_Dims[1]=3; + capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_orthorhombic: failed to create array from the 2nd argument `u2`"; + capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); + if (capi_u2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u2 = (double *)(PyArray_DATA(capi_u2_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + misori_orthorhombic_return_value = (*f2py_func)(u1,u2); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",misori_orthorhombic_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_u2_as_array!=u2_capi) { + Py_XDECREF(capi_u2_as_array); } + } /* if (capi_u2_as_array == NULL) ... else of u2 */ + /* End of cleaning variable u2 */ + if((PyObject *)capi_u1_as_array!=u1_capi) { + Py_XDECREF(capi_u1_as_array); } + } /* if (capi_u1_as_array == NULL) ... else of u1 */ + /* End of cleaning variable u1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of misori_orthorhombic *************************/ + +/***************************** misori_tetragonal *****************************/ +static char doc_f2py_rout__cImageD11_misori_tetragonal[] = "\ +misori_tetragonal = misori_tetragonal(u1,u2)\n\nWrapper for ``misori_tetragonal``.\ +\n\nParameters\n----------\n" +"u1 : input rank-2 array('d') with bounds (3,3)\n" +"u2 : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"misori_tetragonal : float"; +/* extern double misori_tetragonal(double*,double*); */ +static PyObject *f2py_rout__cImageD11_misori_tetragonal(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + double (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double misori_tetragonal_return_value=0; + double *u1 = NULL; + npy_intp u1_Dims[2] = {-1, -1}; + const int u1_Rank = 2; + PyArrayObject *capi_u1_as_array = NULL; + int capi_u1_intent = 0; + PyObject *u1_capi = Py_None; + double *u2 = NULL; + npy_intp u2_Dims[2] = {-1, -1}; + const int u2_Rank = 2; + PyArrayObject *capi_u2_as_array = NULL; + int capi_u2_intent = 0; + PyObject *u2_capi = Py_None; + static char *capi_kwlist[] = {"u1","u2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.misori_tetragonal",\ + capi_kwlist,&u1_capi,&u2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable u1 */ + u1_Dims[0]=3,u1_Dims[1]=3; + capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_tetragonal: failed to create array from the 1st argument `u1`"; + capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); + if (capi_u1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u1 = (double *)(PyArray_DATA(capi_u1_as_array)); + + /* Processing variable u2 */ + u2_Dims[0]=3,u2_Dims[1]=3; + capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_tetragonal: failed to create array from the 2nd argument `u2`"; + capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); + if (capi_u2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u2 = (double *)(PyArray_DATA(capi_u2_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + misori_tetragonal_return_value = (*f2py_func)(u1,u2); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",misori_tetragonal_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_u2_as_array!=u2_capi) { + Py_XDECREF(capi_u2_as_array); } + } /* if (capi_u2_as_array == NULL) ... else of u2 */ + /* End of cleaning variable u2 */ + if((PyObject *)capi_u1_as_array!=u1_capi) { + Py_XDECREF(capi_u1_as_array); } + } /* if (capi_u1_as_array == NULL) ... else of u1 */ + /* End of cleaning variable u1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of misori_tetragonal **************************/ + +/***************************** misori_monoclinic *****************************/ +static char doc_f2py_rout__cImageD11_misori_monoclinic[] = "\ +misori_monoclinic = misori_monoclinic(u1,u2)\n\nWrapper for ``misori_monoclinic``.\ +\n\nParameters\n----------\n" +"u1 : input rank-2 array('d') with bounds (3,3)\n" +"u2 : input rank-2 array('d') with bounds (3,3)\n" +"\nReturns\n-------\n" +"misori_monoclinic : float"; +/* extern double misori_monoclinic(double*,double*); */ +static PyObject *f2py_rout__cImageD11_misori_monoclinic(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + double (*f2py_func)(double*,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double misori_monoclinic_return_value=0; + double *u1 = NULL; + npy_intp u1_Dims[2] = {-1, -1}; + const int u1_Rank = 2; + PyArrayObject *capi_u1_as_array = NULL; + int capi_u1_intent = 0; + PyObject *u1_capi = Py_None; + double *u2 = NULL; + npy_intp u2_Dims[2] = {-1, -1}; + const int u2_Rank = 2; + PyArrayObject *capi_u2_as_array = NULL; + int capi_u2_intent = 0; + PyObject *u2_capi = Py_None; + static char *capi_kwlist[] = {"u1","u2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.misori_monoclinic",\ + capi_kwlist,&u1_capi,&u2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable u1 */ + u1_Dims[0]=3,u1_Dims[1]=3; + capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_monoclinic: failed to create array from the 1st argument `u1`"; + capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); + if (capi_u1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u1 = (double *)(PyArray_DATA(capi_u1_as_array)); + + /* Processing variable u2 */ + u2_Dims[0]=3,u2_Dims[1]=3; + capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_monoclinic: failed to create array from the 2nd argument `u2`"; + capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); + if (capi_u2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u2 = (double *)(PyArray_DATA(capi_u2_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + misori_monoclinic_return_value = (*f2py_func)(u1,u2); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("d",misori_monoclinic_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_u2_as_array!=u2_capi) { + Py_XDECREF(capi_u2_as_array); } + } /* if (capi_u2_as_array == NULL) ... else of u2 */ + /* End of cleaning variable u2 */ + if((PyObject *)capi_u1_as_array!=u1_capi) { + Py_XDECREF(capi_u1_as_array); } + } /* if (capi_u1_as_array == NULL) ... else of u1 */ + /* End of cleaning variable u1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of misori_monoclinic **************************/ + +/***************************** misori_cubic_pairs *****************************/ +static char doc_f2py_rout__cImageD11_misori_cubic_pairs[] = "\ +misori_cubic_pairs(u,dist,[n])\n\nWrapper for ``misori_cubic_pairs``.\ +\n\nParameters\n----------\n" +"u : input rank-3 array('d') with bounds (n,3,3)\n" +"dist : in/output rank-1 array('d') with bounds ((-n + n * n) / 2)\n" +"\nOther Parameters\n----------------\n" +"n : input int, optional\n Default: shape(u, 0)"; +/* extern void misori_cubic_pairs(double*,double*,int); */ +static PyObject *f2py_rout__cImageD11_misori_cubic_pairs(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *u = NULL; + npy_intp u_Dims[3] = {-1, -1, -1}; + const int u_Rank = 3; + PyArrayObject *capi_u_as_array = NULL; + int capi_u_intent = 0; + PyObject *u_capi = Py_None; + double *dist = NULL; + npy_intp dist_Dims[1] = {-1}; + const int dist_Rank = 1; + PyArrayObject *capi_dist_as_array = NULL; + int capi_dist_intent = 0; + PyObject *dist_capi = Py_None; + int n = 0; + PyObject *n_capi = Py_None; + static char *capi_kwlist[] = {"u","dist","n",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|O:_cImageD11.misori_cubic_pairs",\ + capi_kwlist,&u_capi,&dist_capi,&n_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable u */ + u_Dims[1]=3,u_Dims[2]=3; + capi_u_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic_pairs: failed to create array from the 1st argument `u`"; + capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); + if (capi_u_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u = (double *)(PyArray_DATA(capi_u_as_array)); + + /* Processing variable n */ + if (n_capi == Py_None) n = shape(u, 0); else + f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.misori_cubic_pairs() 1st keyword (n) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(u, 0) == n,"shape(u, 0) == n","1st keyword n","misori_cubic_pairs:n=%d",n) { + /* Processing variable dist */ + dist_Dims[0]=(-n + n * n) / 2; + capi_dist_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic_pairs: failed to create array from the 2nd argument `dist`"; + capi_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dist_Dims,dist_Rank, capi_dist_intent,dist_capi,capi_errmess); + if (capi_dist_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + dist = (double *)(PyArray_DATA(capi_dist_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(u,dist,n); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_dist_as_array!=dist_capi) { + Py_XDECREF(capi_dist_as_array); } + } /* if (capi_dist_as_array == NULL) ... else of dist */ + /* End of cleaning variable dist */ + } /*CHECKSCALAR(shape(u, 0) == n)*/ + } /*if (f2py_success) of n*/ + /* End of cleaning variable n */ + if((PyObject *)capi_u_as_array!=u_capi) { + Py_XDECREF(capi_u_as_array); } + } /* if (capi_u_as_array == NULL) ... else of u */ + /* End of cleaning variable u */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of misori_cubic_pairs *************************/ + +/******************************** count_shared ********************************/ +static char doc_f2py_rout__cImageD11_count_shared[] = "\ +count_shared = count_shared(pi,pj,[ni,nj])\n\nWrapper for ``count_shared``.\ +\n\nParameters\n----------\n" +"pi : input rank-1 array('i') with bounds (ni)\n" +"pj : input rank-1 array('i') with bounds (nj)\n" +"\nOther Parameters\n----------------\n" +"ni : input int, optional\n Default: shape(pi, 0)\n" +"nj : input int, optional\n Default: shape(pj, 0)\n" +"\nReturns\n-------\n" +"count_shared : int"; +/* extern int count_shared(int*,int,int*,int); */ +static PyObject *f2py_rout__cImageD11_count_shared(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(int*,int,int*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int count_shared_return_value=0; + int *pi = NULL; + npy_intp pi_Dims[1] = {-1}; + const int pi_Rank = 1; + PyArrayObject *capi_pi_as_array = NULL; + int capi_pi_intent = 0; + PyObject *pi_capi = Py_None; + int ni = 0; + PyObject *ni_capi = Py_None; + int *pj = NULL; + npy_intp pj_Dims[1] = {-1}; + const int pj_Rank = 1; + PyArrayObject *capi_pj_as_array = NULL; + int capi_pj_intent = 0; + PyObject *pj_capi = Py_None; + int nj = 0; + PyObject *nj_capi = Py_None; + static char *capi_kwlist[] = {"pi","pj","ni","nj",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|OO:_cImageD11.count_shared",\ + capi_kwlist,&pi_capi,&pj_capi,&ni_capi,&nj_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable pi */ + ; + capi_pi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.count_shared: failed to create array from the 1st argument `pi`"; + capi_pi_as_array = ndarray_from_pyobj( NPY_INT,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); + if (capi_pi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pi = (int *)(PyArray_DATA(capi_pi_as_array)); + + /* Processing variable pj */ + ; + capi_pj_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.count_shared: failed to create array from the 2nd argument `pj`"; + capi_pj_as_array = ndarray_from_pyobj( NPY_INT,1,pj_Dims,pj_Rank, capi_pj_intent,pj_capi,capi_errmess); + if (capi_pj_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + pj = (int *)(PyArray_DATA(capi_pj_as_array)); + + /* Processing variable ni */ + if (ni_capi == Py_None) ni = shape(pi, 0); else + f2py_success = int_from_pyobj(&ni,ni_capi,"_cImageD11.count_shared() 1st keyword (ni) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(pi, 0) == ni,"shape(pi, 0) == ni","1st keyword ni","count_shared:ni=%d",ni) { + /* Processing variable nj */ + if (nj_capi == Py_None) nj = shape(pj, 0); else + f2py_success = int_from_pyobj(&nj,nj_capi,"_cImageD11.count_shared() 2nd keyword (nj) can't be converted to int"); + if (f2py_success) { + CHECKSCALAR(shape(pj, 0) == nj,"shape(pj, 0) == nj","2nd keyword nj","count_shared:nj=%d",nj) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + count_shared_return_value = (*f2py_func)(pi,ni,pj,nj); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",count_shared_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(pj, 0) == nj)*/ + } /*if (f2py_success) of nj*/ + /* End of cleaning variable nj */ + } /*CHECKSCALAR(shape(pi, 0) == ni)*/ + } /*if (f2py_success) of ni*/ + /* End of cleaning variable ni */ + if((PyObject *)capi_pj_as_array!=pj_capi) { + Py_XDECREF(capi_pj_as_array); } + } /* if (capi_pj_as_array == NULL) ... else of pj */ + /* End of cleaning variable pj */ + if((PyObject *)capi_pi_as_array!=pi_capi) { + Py_XDECREF(capi_pi_as_array); } + } /* if (capi_pi_as_array == NULL) ... else of pi */ + /* End of cleaning variable pi */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of count_shared ****************************/ + +/****************************** connectedpixels ******************************/ +static char doc_f2py_rout__cImageD11_connectedpixels[] = "\ +connectedpixels = connectedpixels(data,labels,threshold,[verbose,con8])\n\nWrapper for ``connectedpixels``.\ +\n\nParameters\n----------\n" +"data : input rank-2 array('f') with bounds (ns,nf)\n" +"labels : in/output rank-2 array('i') with bounds (ns,nf)\n" +"threshold : input float\n" +"\nOther Parameters\n----------------\n" +"verbose : input int, optional\n Default: 0\n" +"con8 : input int, optional\n Default: 1\n" +"\nReturns\n-------\n" +"connectedpixels : int"; +/* extern int connectedpixels(float*,int*,float,int,int,int,int); */ +static PyObject *f2py_rout__cImageD11_connectedpixels(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(float*,int*,float,int,int,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int connectedpixels_return_value=0; + float *data = NULL; + npy_intp data_Dims[2] = {-1, -1}; + const int data_Rank = 2; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *labels = NULL; + npy_intp labels_Dims[2] = {-1, -1}; + const int labels_Rank = 2; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + float threshold = 0; + PyObject *threshold_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + int con8 = 0; + PyObject *con8_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"data","labels","threshold","verbose","con8",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:_cImageD11.connectedpixels",\ + capi_kwlist,&data_capi,&labels_capi,&threshold_capi,&verbose_capi,&con8_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.connectedpixels: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (float *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable threshold */ + f2py_success = float_from_pyobj(&threshold,threshold_capi,"_cImageD11.connectedpixels() 3rd argument (threshold) can't be converted to float"); + if (f2py_success) { + /* Processing variable verbose */ + if (verbose_capi == Py_None) verbose = 0; else + f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.connectedpixels() 1st keyword (verbose) can't be converted to int"); + if (f2py_success) { + /* Processing variable con8 */ + if (con8_capi == Py_None) con8 = 1; else + f2py_success = int_from_pyobj(&con8,con8_capi,"_cImageD11.connectedpixels() 2nd keyword (con8) can't be converted to int"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(data,0); + /* Processing variable nf */ + nf = shape(data,1); + /* Processing variable labels */ + labels_Dims[0]=ns,labels_Dims[1]=nf; + capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.connectedpixels: failed to create array from the 2nd argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + connectedpixels_return_value = (*f2py_func)(data,labels,threshold,verbose,con8,ns,nf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",connectedpixels_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of con8*/ + /* End of cleaning variable con8 */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of threshold*/ + /* End of cleaning variable threshold */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of connectedpixels ***************************/ + +/******************************* blobproperties *******************************/ +static char doc_f2py_rout__cImageD11_blobproperties[] = "\ +results = blobproperties(data,labels,np,[omega,verbose])\n\nWrapper for ``blobproperties``.\ +\n\nParameters\n----------\n" +"data : input rank-2 array('f') with bounds (ns,nf)\n" +"labels : input rank-2 array('i') with bounds (ns,nf)\n" +"np : input int\n" +"\nOther Parameters\n----------------\n" +"omega : input float, optional\n Default: 0\n" +"verbose : input int, optional\n Default: 0\n" +"\nReturns\n-------\n" +"results : rank-2 array('d') with bounds (np,NPROPERTY)"; +/* extern void blobproperties(float*,int*,int,float,int,int,int,double*); */ +static PyObject *f2py_rout__cImageD11_blobproperties(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,int*,int,float,int,int,int,double*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *data = NULL; + npy_intp data_Dims[2] = {-1, -1}; + const int data_Rank = 2; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *labels = NULL; + npy_intp labels_Dims[2] = {-1, -1}; + const int labels_Rank = 2; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + int np = 0; + PyObject *np_capi = Py_None; + float omega = 0; + PyObject *omega_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + int ns = 0; + int nf = 0; + double *results = NULL; + npy_intp results_Dims[2] = {-1, -1}; + const int results_Rank = 2; + PyArrayObject *capi_results_as_array = NULL; + int capi_results_intent = 0; + static char *capi_kwlist[] = {"data","labels","np","omega","verbose",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|OO:_cImageD11.blobproperties",\ + capi_kwlist,&data_capi,&labels_capi,&np_capi,&omega_capi,&verbose_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.blobproperties: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (float *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable np */ + f2py_success = int_from_pyobj(&np,np_capi,"_cImageD11.blobproperties() 3rd argument (np) can't be converted to int"); + if (f2py_success) { + /* Processing variable omega */ + if (omega_capi == Py_None) omega = 0; else + f2py_success = float_from_pyobj(&omega,omega_capi,"_cImageD11.blobproperties() 1st keyword (omega) can't be converted to float"); + if (f2py_success) { + /* Processing variable verbose */ + if (verbose_capi == Py_None) verbose = 0; else + f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.blobproperties() 2nd keyword (verbose) can't be converted to int"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(data,0); + /* Processing variable nf */ + nf = shape(data,1); + /* Processing variable results */ + results_Dims[0]=np,results_Dims[1]=NPROPERTY; + capi_results_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.blobproperties: failed to create array from the hidden `results`"; + capi_results_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results_Dims,results_Rank, capi_results_intent,Py_None,capi_errmess); + if (capi_results_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + results = (double *)(PyArray_DATA(capi_results_as_array)); + + /* Processing variable labels */ + labels_Dims[0]=ns,labels_Dims[1]=nf; + capi_labels_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.blobproperties: failed to create array from the 2nd argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(data,labels,np,omega,verbose,ns,nf,results); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_results_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + } /* if (capi_results_as_array == NULL) ... else of results */ + /* End of cleaning variable results */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + } /*if (f2py_success) of omega*/ + /* End of cleaning variable omega */ + } /*if (f2py_success) of np*/ + /* End of cleaning variable np */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of blobproperties ***************************/ + +/******************************** bloboverlaps ********************************/ +static char doc_f2py_rout__cImageD11_bloboverlaps[] = "\ +bloboverlaps = bloboverlaps(labels1,npk1,results1,labels2,npk2,results2,[verbose])\n\nWrapper for ``bloboverlaps``.\ +\n\nParameters\n----------\n" +"labels1 : in/output rank-2 array('i') with bounds (ns,nf)\n" +"npk1 : input int\n" +"results1 : in/output rank-2 array('d') with bounds (:,NPROPERTY)\n" +"labels2 : in/output rank-2 array('i') with bounds (ns,nf)\n" +"npk2 : input int\n" +"results2 : in/output rank-2 array('d') with bounds (:,NPROPERTY)\n" +"\nOther Parameters\n----------------\n" +"verbose : input int, optional\n Default: 0\n" +"\nReturns\n-------\n" +"bloboverlaps : int"; +/* extern int bloboverlaps(int*,int,double*,int*,int,double*,int,int,int); */ +static PyObject *f2py_rout__cImageD11_bloboverlaps(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(int*,int,double*,int*,int,double*,int,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int bloboverlaps_return_value=0; + int *labels1 = NULL; + npy_intp labels1_Dims[2] = {-1, -1}; + const int labels1_Rank = 2; + PyArrayObject *capi_labels1_as_array = NULL; + int capi_labels1_intent = 0; + PyObject *labels1_capi = Py_None; + int npk1 = 0; + PyObject *npk1_capi = Py_None; + double *results1 = NULL; + npy_intp results1_Dims[2] = {-1, -1}; + const int results1_Rank = 2; + PyArrayObject *capi_results1_as_array = NULL; + int capi_results1_intent = 0; + PyObject *results1_capi = Py_None; + int *labels2 = NULL; + npy_intp labels2_Dims[2] = {-1, -1}; + const int labels2_Rank = 2; + PyArrayObject *capi_labels2_as_array = NULL; + int capi_labels2_intent = 0; + PyObject *labels2_capi = Py_None; + int npk2 = 0; + PyObject *npk2_capi = Py_None; + double *results2 = NULL; + npy_intp results2_Dims[2] = {-1, -1}; + const int results2_Rank = 2; + PyArrayObject *capi_results2_as_array = NULL; + int capi_results2_intent = 0; + PyObject *results2_capi = Py_None; + int verbose = 0; + PyObject *verbose_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"labels1","npk1","results1","labels2","npk2","results2","verbose",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|O:_cImageD11.bloboverlaps",\ + capi_kwlist,&labels1_capi,&npk1_capi,&results1_capi,&labels2_capi,&npk2_capi,&results2_capi,&verbose_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable labels1 */ + ; + capi_labels1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 1st argument `labels1`"; + capi_labels1_as_array = ndarray_from_pyobj( NPY_INT,1,labels1_Dims,labels1_Rank, capi_labels1_intent,labels1_capi,capi_errmess); + if (capi_labels1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels1 = (int *)(PyArray_DATA(capi_labels1_as_array)); + + /* Processing variable npk1 */ + f2py_success = int_from_pyobj(&npk1,npk1_capi,"_cImageD11.bloboverlaps() 2nd argument (npk1) can't be converted to int"); + if (f2py_success) { + /* Processing variable results1 */ + results1_Dims[1]=NPROPERTY; + capi_results1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 3rd argument `results1`"; + capi_results1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results1_Dims,results1_Rank, capi_results1_intent,results1_capi,capi_errmess); + if (capi_results1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + results1 = (double *)(PyArray_DATA(capi_results1_as_array)); + + /* Processing variable npk2 */ + f2py_success = int_from_pyobj(&npk2,npk2_capi,"_cImageD11.bloboverlaps() 5th argument (npk2) can't be converted to int"); + if (f2py_success) { + /* Processing variable results2 */ + results2_Dims[1]=NPROPERTY; + capi_results2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 6th argument `results2`"; + capi_results2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results2_Dims,results2_Rank, capi_results2_intent,results2_capi,capi_errmess); + if (capi_results2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + results2 = (double *)(PyArray_DATA(capi_results2_as_array)); + + /* Processing variable verbose */ + if (verbose_capi == Py_None) verbose = 0; else + f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.bloboverlaps() 1st keyword (verbose) can't be converted to int"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(labels1,0); + /* Processing variable nf */ + nf = shape(labels1,1); + /* Processing variable labels2 */ + labels2_Dims[0]=ns,labels2_Dims[1]=nf; + capi_labels2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 4th argument `labels2`"; + capi_labels2_as_array = ndarray_from_pyobj( NPY_INT,1,labels2_Dims,labels2_Rank, capi_labels2_intent,labels2_capi,capi_errmess); + if (capi_labels2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels2 = (int *)(PyArray_DATA(capi_labels2_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + bloboverlaps_return_value = (*f2py_func)(labels1,npk1,results1,labels2,npk2,results2,verbose,ns,nf); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",bloboverlaps_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_labels2_as_array!=labels2_capi) { + Py_XDECREF(capi_labels2_as_array); } + } /* if (capi_labels2_as_array == NULL) ... else of labels2 */ + /* End of cleaning variable labels2 */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of verbose*/ + /* End of cleaning variable verbose */ + if((PyObject *)capi_results2_as_array!=results2_capi) { + Py_XDECREF(capi_results2_as_array); } + } /* if (capi_results2_as_array == NULL) ... else of results2 */ + /* End of cleaning variable results2 */ + } /*if (f2py_success) of npk2*/ + /* End of cleaning variable npk2 */ + if((PyObject *)capi_results1_as_array!=results1_capi) { + Py_XDECREF(capi_results1_as_array); } + } /* if (capi_results1_as_array == NULL) ... else of results1 */ + /* End of cleaning variable results1 */ + } /*if (f2py_success) of npk1*/ + /* End of cleaning variable npk1 */ + if((PyObject *)capi_labels1_as_array!=labels1_capi) { + Py_XDECREF(capi_labels1_as_array); } + } /* if (capi_labels1_as_array == NULL) ... else of labels1 */ + /* End of cleaning variable labels1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of bloboverlaps ****************************/ + +/******************************** blob_moments ********************************/ +static char doc_f2py_rout__cImageD11_blob_moments[] = "\ +blob_moments(results)\n\nWrapper for ``blob_moments``.\ +\n\nParameters\n----------\n" +"results : in/output rank-2 array('d') with bounds (np,NPROPERTY)"; +/* extern void blob_moments(double*,int); */ +static PyObject *f2py_rout__cImageD11_blob_moments(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + double *results = NULL; + npy_intp results_Dims[2] = {-1, -1}; + const int results_Rank = 2; + PyArrayObject *capi_results_as_array = NULL; + int capi_results_intent = 0; + PyObject *results_capi = Py_None; + int np = 0; + static char *capi_kwlist[] = {"results",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "O|:_cImageD11.blob_moments",\ + capi_kwlist,&results_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable results */ + results_Dims[1]=NPROPERTY; + capi_results_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.blob_moments: failed to create array from the 1st argument `results`"; + capi_results_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results_Dims,results_Rank, capi_results_intent,results_capi,capi_errmess); + if (capi_results_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + results = (double *)(PyArray_DATA(capi_results_as_array)); + + /* Processing variable np */ + np = shape(results,0); +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(results,np); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + /* End of cleaning variable np */ + if((PyObject *)capi_results_as_array!=results_capi) { + Py_XDECREF(capi_results_as_array); } + } /* if (capi_results_as_array == NULL) ... else of results */ + /* End of cleaning variable results */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of blob_moments ****************************/ + +/********************************* clean_mask *********************************/ +static char doc_f2py_rout__cImageD11_clean_mask[] = "\ +clean_mask = clean_mask(msk,ret)\n\nWrapper for ``clean_mask``.\ +\n\nParameters\n----------\n" +"msk : input rank-2 array('b') with bounds (ns,nf)\n" +"ret : in/output rank-2 array('b') with bounds (ns,nf)\n" +"\nReturns\n-------\n" +"clean_mask : int"; +/* extern int clean_mask(signed_char*,signed_char*,int,int); */ +static PyObject *f2py_rout__cImageD11_clean_mask(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(signed_char*,signed_char*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int clean_mask_return_value=0; + signed_char *msk = NULL; + npy_intp msk_Dims[2] = {-1, -1}; + const int msk_Rank = 2; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + signed_char *ret = NULL; + npy_intp ret_Dims[2] = {-1, -1}; + const int ret_Rank = 2; + PyArrayObject *capi_ret_as_array = NULL; + int capi_ret_intent = 0; + PyObject *ret_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"msk","ret",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.clean_mask",\ + capi_kwlist,&msk_capi,&ret_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable msk */ + ; + capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.clean_mask: failed to create array from the 1st argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); + + /* Processing variable ns */ + ns = shape(msk,0); + /* Processing variable nf */ + nf = shape(msk,1); + /* Processing variable ret */ + ret_Dims[0]=ns,ret_Dims[1]=nf; + capi_ret_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.clean_mask: failed to create array from the 2nd argument `ret`"; + capi_ret_as_array = ndarray_from_pyobj( NPY_BYTE,1,ret_Dims,ret_Rank, capi_ret_intent,ret_capi,capi_errmess); + if (capi_ret_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ret = (signed_char *)(PyArray_DATA(capi_ret_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + clean_mask_return_value = (*f2py_func)(msk,ret,ns,nf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",clean_mask_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_ret_as_array!=ret_capi) { + Py_XDECREF(capi_ret_as_array); } + } /* if (capi_ret_as_array == NULL) ... else of ret */ + /* End of cleaning variable ret */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of clean_mask *****************************/ + +/****************************** make_clean_mask ******************************/ +static char doc_f2py_rout__cImageD11_make_clean_mask[] = "\ +make_clean_mask = make_clean_mask(img,cut,msk,ret)\n\nWrapper for ``make_clean_mask``.\ +\n\nParameters\n----------\n" +"img : input rank-2 array('f') with bounds (ns,nf)\n" +"cut : input float\n" +"msk : input rank-2 array('b') with bounds (ns,nf)\n" +"ret : in/output rank-2 array('b') with bounds (ns,nf)\n" +"\nReturns\n-------\n" +"make_clean_mask : int"; +/* extern int make_clean_mask(float*,float,signed_char*,signed_char*,int,int); */ +static PyObject *f2py_rout__cImageD11_make_clean_mask(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(float*,float,signed_char*,signed_char*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int make_clean_mask_return_value=0; + float *img = NULL; + npy_intp img_Dims[2] = {-1, -1}; + const int img_Rank = 2; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + float cut = 0; + PyObject *cut_capi = Py_None; + signed_char *msk = NULL; + npy_intp msk_Dims[2] = {-1, -1}; + const int msk_Rank = 2; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + signed_char *ret = NULL; + npy_intp ret_Dims[2] = {-1, -1}; + const int ret_Rank = 2; + PyArrayObject *capi_ret_as_array = NULL; + int capi_ret_intent = 0; + PyObject *ret_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"img","cut","msk","ret",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.make_clean_mask",\ + capi_kwlist,&img_capi,&cut_capi,&msk_capi,&ret_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable cut */ + f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.make_clean_mask() 2nd argument (cut) can't be converted to float"); + if (f2py_success) { + /* Processing variable msk */ + ; + capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.make_clean_mask: failed to create array from the 3rd argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); + + /* Processing variable ns */ + ns = shape(msk,0); + /* Processing variable nf */ + nf = shape(msk,1); + /* Processing variable img */ + img_Dims[0]=ns,img_Dims[1]=nf; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.make_clean_mask: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable ret */ + ret_Dims[0]=ns,ret_Dims[1]=nf; + capi_ret_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.make_clean_mask: failed to create array from the 4th argument `ret`"; + capi_ret_as_array = ndarray_from_pyobj( NPY_BYTE,1,ret_Dims,ret_Rank, capi_ret_intent,ret_capi,capi_errmess); + if (capi_ret_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + ret = (signed_char *)(PyArray_DATA(capi_ret_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + make_clean_mask_return_value = (*f2py_func)(img,cut,msk,ret,ns,nf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",make_clean_mask_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_ret_as_array!=ret_capi) { + Py_XDECREF(capi_ret_as_array); } + } /* if (capi_ret_as_array == NULL) ... else of ret */ + /* End of cleaning variable ret */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of make_clean_mask ***************************/ + +/******************************* localmaxlabel *******************************/ +static char doc_f2py_rout__cImageD11_localmaxlabel[] = "\ +localmaxlabel = localmaxlabel(data,labels,wrk)\n\nWrapper for ``localmaxlabel``.\ +\n\nParameters\n----------\n" +"data : input rank-2 array('f') with bounds (ns,nf)\n" +"labels : in/output rank-2 array('i') with bounds (ns,nf)\n" +"wrk : in/output rank-2 array('b') with bounds (ns,nf)\n" +"\nReturns\n-------\n" +"localmaxlabel : int"; +/* extern int localmaxlabel(float*,int*,signed_char*,int,int); */ +static PyObject *f2py_rout__cImageD11_localmaxlabel(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(float*,int*,signed_char*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int localmaxlabel_return_value=0; + float *data = NULL; + npy_intp data_Dims[2] = {-1, -1}; + const int data_Rank = 2; + PyArrayObject *capi_data_as_array = NULL; + int capi_data_intent = 0; + PyObject *data_capi = Py_None; + int *labels = NULL; + npy_intp labels_Dims[2] = {-1, -1}; + const int labels_Rank = 2; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + signed_char *wrk = NULL; + npy_intp wrk_Dims[2] = {-1, -1}; + const int wrk_Rank = 2; + PyArrayObject *capi_wrk_as_array = NULL; + int capi_wrk_intent = 0; + PyObject *wrk_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"data","labels","wrk",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOO|:_cImageD11.localmaxlabel",\ + capi_kwlist,&data_capi,&labels_capi,&wrk_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable data */ + ; + capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.localmaxlabel: failed to create array from the 1st argument `data`"; + capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); + if (capi_data_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + data = (float *)(PyArray_DATA(capi_data_as_array)); + + /* Processing variable ns */ + ns = shape(data,0); + /* Processing variable nf */ + nf = shape(data,1); + /* Processing variable labels */ + labels_Dims[0]=ns,labels_Dims[1]=nf; + capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.localmaxlabel: failed to create array from the 2nd argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + + /* Processing variable wrk */ + wrk_Dims[0]=ns,wrk_Dims[1]=nf; + capi_wrk_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.localmaxlabel: failed to create array from the 3rd argument `wrk`"; + capi_wrk_as_array = ndarray_from_pyobj( NPY_BYTE,1,wrk_Dims,wrk_Rank, capi_wrk_intent,wrk_capi,capi_errmess); + if (capi_wrk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + wrk = (signed_char *)(PyArray_DATA(capi_wrk_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + localmaxlabel_return_value = (*f2py_func)(data,labels,wrk,ns,nf); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",localmaxlabel_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_wrk_as_array!=wrk_capi) { + Py_XDECREF(capi_wrk_as_array); } + } /* if (capi_wrk_as_array == NULL) ... else of wrk */ + /* End of cleaning variable wrk */ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + if((PyObject *)capi_data_as_array!=data_capi) { + Py_XDECREF(capi_data_as_array); } + } /* if (capi_data_as_array == NULL) ... else of data */ + /* End of cleaning variable data */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of localmaxlabel ****************************/ + +/******************************** mask_to_coo ********************************/ +static char doc_f2py_rout__cImageD11_mask_to_coo[] = "\ +mask_to_coo = mask_to_coo(msk,i,j,w)\n\nWrapper for ``mask_to_coo``.\ +\n\nParameters\n----------\n" +"msk : input rank-2 array('b') with bounds (ns,nf)\n" +"i : in/output rank-1 array('H') with bounds (nnz)\n" +"j : in/output rank-1 array('H') with bounds (nnz)\n" +"w : in/output rank-1 array('i') with bounds (ns)\n" +"\nReturns\n-------\n" +"mask_to_coo : int"; +/* extern int mask_to_coo(signed_char*,int,int,unsigned_short*,unsigned_short*,int,int*); */ +static PyObject *f2py_rout__cImageD11_mask_to_coo(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(signed_char*,int,int,unsigned_short*,unsigned_short*,int,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int mask_to_coo_return_value=0; + signed_char *msk = NULL; + npy_intp msk_Dims[2] = {-1, -1}; + const int msk_Rank = 2; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + int ns = 0; + int nf = 0; + unsigned_short *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + unsigned_short *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int nnz = 0; + int *w = NULL; + npy_intp w_Dims[1] = {-1}; + const int w_Rank = 1; + PyArrayObject *capi_w_as_array = NULL; + int capi_w_intent = 0; + PyObject *w_capi = Py_None; + static char *capi_kwlist[] = {"msk","i","j","w",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.mask_to_coo",\ + capi_kwlist,&msk_capi,&i_capi,&j_capi,&w_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable msk */ + ; + capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 1st argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); + + /* Processing variable i */ + ; + capi_i_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 2nd argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable ns */ + ns = shape(msk,0); + /* Processing variable nf */ + nf = shape(msk,1); + /* Processing variable nnz */ + nnz = shape(i,0); + /* Processing variable w */ + w_Dims[0]=ns; + capi_w_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 4th argument `w`"; + capi_w_as_array = ndarray_from_pyobj( NPY_INT,1,w_Dims,w_Rank, capi_w_intent,w_capi,capi_errmess); + if (capi_w_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + w = (int *)(PyArray_DATA(capi_w_as_array)); + + /* Processing variable j */ + j_Dims[0]=nnz; + capi_j_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 3rd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + mask_to_coo_return_value = (*f2py_func)(msk,ns,nf,i,j,nnz,w); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",mask_to_coo_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + if((PyObject *)capi_w_as_array!=w_capi) { + Py_XDECREF(capi_w_as_array); } + } /* if (capi_w_as_array == NULL) ... else of w */ + /* End of cleaning variable w */ + /* End of cleaning variable nnz */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/***************************** end of mask_to_coo *****************************/ + +/****************************** sparse_is_sorted ******************************/ +static char doc_f2py_rout__cImageD11_sparse_is_sorted[] = "\ +sparse_is_sorted = sparse_is_sorted(i,j)\n\nWrapper for ``sparse_is_sorted``.\ +\n\nParameters\n----------\n" +"i : input rank-1 array('H') with bounds (nnz)\n" +"j : input rank-1 array('H') with bounds (nnz)\n" +"\nReturns\n-------\n" +"sparse_is_sorted : int"; +/* extern int sparse_is_sorted(unsigned_short*,unsigned_short*,int); */ +static PyObject *f2py_rout__cImageD11_sparse_is_sorted(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(unsigned_short*,unsigned_short*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int sparse_is_sorted_return_value=0; + unsigned_short *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + unsigned_short *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int nnz = 0; + static char *capi_kwlist[] = {"i","j",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OO|:_cImageD11.sparse_is_sorted",\ + capi_kwlist,&i_capi,&j_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable i */ + ; + capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_is_sorted: failed to create array from the 1st argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable nnz */ + nnz = shape(i, 0); + /* Processing variable j */ + j_Dims[0]=nnz; + capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_is_sorted: failed to create array from the 2nd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + sparse_is_sorted_return_value = (*f2py_func)(i,j,nnz); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",sparse_is_sorted_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + /* End of cleaning variable nnz */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************** end of sparse_is_sorted **************************/ + +/*************************** sparse_connectedpixels ***************************/ +static char doc_f2py_rout__cImageD11_sparse_connectedpixels[] = "\ +sparse_connectedpixels = sparse_connectedpixels(v,i,j,threshold,labels)\n\nWrapper for ``sparse_connectedpixels``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('f') with bounds (nnz)\n" +"i : input rank-1 array('H') with bounds (nnz)\n" +"j : input rank-1 array('H') with bounds (nnz)\n" +"threshold : input float\n" +"labels : in/output rank-1 array('i') with bounds (nnz)\n" +"\nReturns\n-------\n" +"sparse_connectedpixels : int"; +/* extern int sparse_connectedpixels(float*,unsigned_short*,unsigned_short*,int,float,int*); */ +static PyObject *f2py_rout__cImageD11_sparse_connectedpixels(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int sparse_connectedpixels_return_value=0; + float *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + unsigned_short *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + unsigned_short *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int nnz = 0; + float threshold = 0; + PyObject *threshold_capi = Py_None; + int *labels = NULL; + npy_intp labels_Dims[1] = {-1}; + const int labels_Rank = 1; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + static char *capi_kwlist[] = {"v","i","j","threshold","labels",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|:_cImageD11.sparse_connectedpixels",\ + capi_kwlist,&v_capi,&i_capi,&j_capi,&threshold_capi,&labels_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable i */ + ; + capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 2nd argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable threshold */ + f2py_success = float_from_pyobj(&threshold,threshold_capi,"_cImageD11.sparse_connectedpixels() 4th argument (threshold) can't be converted to float"); + if (f2py_success) { + /* Processing variable nnz */ + nnz = shape(i, 0); + /* Processing variable labels */ + labels_Dims[0]=nnz; + capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 5th argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + + /* Processing variable v */ + v_Dims[0]=nnz; + capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (float *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable j */ + j_Dims[0]=nnz; + capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 3rd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + sparse_connectedpixels_return_value = (*f2py_func)(v,i,j,nnz,threshold,labels); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",sparse_connectedpixels_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + /* End of cleaning variable nnz */ + } /*if (f2py_success) of threshold*/ + /* End of cleaning variable threshold */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of sparse_connectedpixels ***********************/ + +/************************ sparse_connectedpixels_splat ************************/ +static char doc_f2py_rout__cImageD11_sparse_connectedpixels_splat[] = "\ +sparse_connectedpixels_splat = sparse_connectedpixels_splat(v,i,j,th,lbl,Z,ni,nj)\n\nWrapper for ``sparse_connectedpixels_splat``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('f') with bounds (nnz)\n" +"i : input rank-1 array('H') with bounds (nnz)\n" +"j : input rank-1 array('H') with bounds (nnz)\n" +"th : input float\n" +"lbl : in/output rank-1 array('i') with bounds (nnz)\n" +"Z : in/output rank-1 array('i') with bounds (4 + 2 * ni + 2 * nj + ni * nj)\n" +"ni : input int\n" +"nj : input int\n" +"\nReturns\n-------\n" +"sparse_connectedpixels_splat : int"; +/* extern int sparse_connectedpixels_splat(float*,unsigned_short*,unsigned_short*,int,float,int*,int*,int,int); */ +static PyObject *f2py_rout__cImageD11_sparse_connectedpixels_splat(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float,int*,int*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int sparse_connectedpixels_splat_return_value=0; + float *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + unsigned_short *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + unsigned_short *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int nnz = 0; + float th = 0; + PyObject *th_capi = Py_None; + int *lbl = NULL; + npy_intp lbl_Dims[1] = {-1}; + const int lbl_Rank = 1; + PyArrayObject *capi_lbl_as_array = NULL; + int capi_lbl_intent = 0; + PyObject *lbl_capi = Py_None; + int *Z = NULL; + npy_intp Z_Dims[1] = {-1}; + const int Z_Rank = 1; + PyArrayObject *capi_Z_as_array = NULL; + int capi_Z_intent = 0; + PyObject *Z_capi = Py_None; + int ni = 0; + PyObject *ni_capi = Py_None; + int nj = 0; + PyObject *nj_capi = Py_None; + static char *capi_kwlist[] = {"v","i","j","th","lbl","Z","ni","nj",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|:_cImageD11.sparse_connectedpixels_splat",\ + capi_kwlist,&v_capi,&i_capi,&j_capi,&th_capi,&lbl_capi,&Z_capi,&ni_capi,&nj_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable i */ + ; + capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 2nd argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable th */ + f2py_success = float_from_pyobj(&th,th_capi,"_cImageD11.sparse_connectedpixels_splat() 4th argument (th) can't be converted to float"); + if (f2py_success) { + /* Processing variable ni */ + f2py_success = int_from_pyobj(&ni,ni_capi,"_cImageD11.sparse_connectedpixels_splat() 7th argument (ni) can't be converted to int"); + if (f2py_success) { + /* Processing variable nj */ + f2py_success = int_from_pyobj(&nj,nj_capi,"_cImageD11.sparse_connectedpixels_splat() 8th argument (nj) can't be converted to int"); + if (f2py_success) { + /* Processing variable nnz */ + nnz = shape(i, 0); + /* Processing variable lbl */ + lbl_Dims[0]=nnz; + capi_lbl_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 5th argument `lbl`"; + capi_lbl_as_array = ndarray_from_pyobj( NPY_INT,1,lbl_Dims,lbl_Rank, capi_lbl_intent,lbl_capi,capi_errmess); + if (capi_lbl_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + lbl = (int *)(PyArray_DATA(capi_lbl_as_array)); + + /* Processing variable Z */ + Z_Dims[0]=4 + 2 * ni + 2 * nj + ni * nj; + capi_Z_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 6th argument `Z`"; + capi_Z_as_array = ndarray_from_pyobj( NPY_INT,1,Z_Dims,Z_Rank, capi_Z_intent,Z_capi,capi_errmess); + if (capi_Z_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + Z = (int *)(PyArray_DATA(capi_Z_as_array)); + + CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj,"shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj","6th argument Z") { + CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj,"shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj","6th argument Z") { + /* Processing variable v */ + v_Dims[0]=nnz; + capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (float *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable j */ + j_Dims[0]=nnz; + capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 3rd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + sparse_connectedpixels_splat_return_value = (*f2py_func)(v,i,j,nnz,th,lbl,Z,ni,nj); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",sparse_connectedpixels_splat_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ + } /*CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj)*/ + } /*CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj)*/ + if((PyObject *)capi_Z_as_array!=Z_capi) { + Py_XDECREF(capi_Z_as_array); } + } /* if (capi_Z_as_array == NULL) ... else of Z */ + /* End of cleaning variable Z */ + if((PyObject *)capi_lbl_as_array!=lbl_capi) { + Py_XDECREF(capi_lbl_as_array); } + } /* if (capi_lbl_as_array == NULL) ... else of lbl */ + /* End of cleaning variable lbl */ + /* End of cleaning variable nnz */ + } /*if (f2py_success) of nj*/ + /* End of cleaning variable nj */ + } /*if (f2py_success) of ni*/ + /* End of cleaning variable ni */ + } /*if (f2py_success) of th*/ + /* End of cleaning variable th */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************** end of sparse_connectedpixels_splat ********************/ + +/************************** sparse_blob2Dproperties **************************/ +static char doc_f2py_rout__cImageD11_sparse_blob2Dproperties[] = "\ +results = sparse_blob2Dproperties(v,i,j,labels,npk)\n\nWrapper for ``sparse_blob2Dproperties``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('f') with bounds (nnz)\n" +"i : input rank-1 array('H') with bounds (nnz)\n" +"j : input rank-1 array('H') with bounds (nnz)\n" +"labels : input rank-1 array('i') with bounds (nnz)\n" +"npk : input int\n" +"\nReturns\n-------\n" +"results : rank-2 array('d') with bounds (npk,NPROPERTY2D)"; +/* extern void sparse_blob2Dproperties(float*,unsigned_short*,unsigned_short*,int,int*,double*,int); */ +static PyObject *f2py_rout__cImageD11_sparse_blob2Dproperties(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,int*,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + unsigned_short *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + unsigned_short *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int nnz = 0; + int *labels = NULL; + npy_intp labels_Dims[1] = {-1}; + const int labels_Rank = 1; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + double *results = NULL; + npy_intp results_Dims[2] = {-1, -1}; + const int results_Rank = 2; + PyArrayObject *capi_results_as_array = NULL; + int capi_results_intent = 0; + int npk = 0; + PyObject *npk_capi = Py_None; + static char *capi_kwlist[] = {"v","i","j","labels","npk",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|:_cImageD11.sparse_blob2Dproperties",\ + capi_kwlist,&v_capi,&i_capi,&j_capi,&labels_capi,&npk_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + ; + capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (float *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable npk */ + f2py_success = int_from_pyobj(&npk,npk_capi,"_cImageD11.sparse_blob2Dproperties() 5th argument (npk) can't be converted to int"); + if (f2py_success) { + /* Processing variable nnz */ + nnz = shape(v, 0); + /* Processing variable labels */ + labels_Dims[0]=nnz; + capi_labels_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 4th argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + + /* Processing variable results */ + results_Dims[0]=npk,results_Dims[1]=NPROPERTY2D; + capi_results_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the hidden `results`"; + capi_results_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results_Dims,results_Rank, capi_results_intent,Py_None,capi_errmess); + if (capi_results_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + results = (double *)(PyArray_DATA(capi_results_as_array)); + + /* Processing variable i */ + i_Dims[0]=nnz; + capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 2nd argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable j */ + j_Dims[0]=nnz; + capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 3rd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(v,i,j,nnz,labels,results,npk); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("N",capi_results_as_array); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ + } /* if (capi_results_as_array == NULL) ... else of results */ + /* End of cleaning variable results */ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + /* End of cleaning variable nnz */ + } /*if (f2py_success) of npk*/ + /* End of cleaning variable npk */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*********************** end of sparse_blob2Dproperties ***********************/ + +/******************************* sparse_smooth *******************************/ +static char doc_f2py_rout__cImageD11_sparse_smooth[] = "\ +sparse_smooth(v,i,j,s)\n\nWrapper for ``sparse_smooth``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('f') with bounds (nnz)\n" +"i : input rank-1 array('H') with bounds (nnz)\n" +"j : input rank-1 array('H') with bounds (nnz)\n" +"s : in/output rank-1 array('f') with bounds (nnz)"; +/* extern void sparse_smooth(float*,unsigned_short*,unsigned_short*,int,float*); */ +static PyObject *f2py_rout__cImageD11_sparse_smooth(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + float *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + unsigned_short *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + unsigned_short *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int nnz = 0; + float *s = NULL; + npy_intp s_Dims[1] = {-1}; + const int s_Rank = 1; + PyArrayObject *capi_s_as_array = NULL; + int capi_s_intent = 0; + PyObject *s_capi = Py_None; + static char *capi_kwlist[] = {"v","i","j","s",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.sparse_smooth",\ + capi_kwlist,&v_capi,&i_capi,&j_capi,&s_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + ; + capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (float *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable nnz */ + nnz = shape(v, 0); + /* Processing variable s */ + s_Dims[0]=nnz; + capi_s_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 4th argument `s`"; + capi_s_as_array = ndarray_from_pyobj( NPY_FLOAT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); + if (capi_s_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + s = (float *)(PyArray_DATA(capi_s_as_array)); + + /* Processing variable i */ + i_Dims[0]=nnz; + capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 2nd argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable j */ + j_Dims[0]=nnz; + capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 3rd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + (*f2py_func)(v,i,j,nnz,s); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ + if((PyObject *)capi_s_as_array!=s_capi) { + Py_XDECREF(capi_s_as_array); } + } /* if (capi_s_as_array == NULL) ... else of s */ + /* End of cleaning variable s */ + /* End of cleaning variable nnz */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of sparse_smooth ****************************/ + +/**************************** sparse_localmaxlabel ****************************/ +static char doc_f2py_rout__cImageD11_sparse_localmaxlabel[] = "\ +sparse_localmaxlabel = sparse_localmaxlabel(v,i,j,MV,iMV,labels)\n\nWrapper for ``sparse_localmaxlabel``.\ +\n\nParameters\n----------\n" +"v : input rank-1 array('f') with bounds (nnz)\n" +"i : input rank-1 array('H') with bounds (nnz)\n" +"j : input rank-1 array('H') with bounds (nnz)\n" +"MV : in/output rank-1 array('f') with bounds (nnz)\n" +"iMV : in/output rank-1 array('i') with bounds (nnz)\n" +"labels : in/output rank-1 array('i') with bounds (nnz)\n" +"\nReturns\n-------\n" +"sparse_localmaxlabel : int"; +/* extern int sparse_localmaxlabel(float*,unsigned_short*,unsigned_short*,int,float*,int*,int*); */ +static PyObject *f2py_rout__cImageD11_sparse_localmaxlabel(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float*,int*,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int sparse_localmaxlabel_return_value=0; + float *v = NULL; + npy_intp v_Dims[1] = {-1}; + const int v_Rank = 1; + PyArrayObject *capi_v_as_array = NULL; + int capi_v_intent = 0; + PyObject *v_capi = Py_None; + unsigned_short *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + unsigned_short *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int nnz = 0; + float *MV = NULL; + npy_intp MV_Dims[1] = {-1}; + const int MV_Rank = 1; + PyArrayObject *capi_MV_as_array = NULL; + int capi_MV_intent = 0; + PyObject *MV_capi = Py_None; + int *iMV = NULL; + npy_intp iMV_Dims[1] = {-1}; + const int iMV_Rank = 1; + PyArrayObject *capi_iMV_as_array = NULL; + int capi_iMV_intent = 0; + PyObject *iMV_capi = Py_None; + int *labels = NULL; + npy_intp labels_Dims[1] = {-1}; + const int labels_Rank = 1; + PyArrayObject *capi_labels_as_array = NULL; + int capi_labels_intent = 0; + PyObject *labels_capi = Py_None; + static char *capi_kwlist[] = {"v","i","j","MV","iMV","labels",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.sparse_localmaxlabel",\ + capi_kwlist,&v_capi,&i_capi,&j_capi,&MV_capi,&iMV_capi,&labels_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable v */ + ; + capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 1st argument `v`"; + capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); + if (capi_v_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + v = (float *)(PyArray_DATA(capi_v_as_array)); + + /* Processing variable nnz */ + nnz = shape(v, 0); + /* Processing variable MV */ + MV_Dims[0]=nnz; + capi_MV_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 4th argument `MV`"; + capi_MV_as_array = ndarray_from_pyobj( NPY_FLOAT,1,MV_Dims,MV_Rank, capi_MV_intent,MV_capi,capi_errmess); + if (capi_MV_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + MV = (float *)(PyArray_DATA(capi_MV_as_array)); + + /* Processing variable iMV */ + iMV_Dims[0]=nnz; + capi_iMV_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 5th argument `iMV`"; + capi_iMV_as_array = ndarray_from_pyobj( NPY_INT,1,iMV_Dims,iMV_Rank, capi_iMV_intent,iMV_capi,capi_errmess); + if (capi_iMV_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + iMV = (int *)(PyArray_DATA(capi_iMV_as_array)); + + /* Processing variable labels */ + labels_Dims[0]=nnz; + capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 6th argument `labels`"; + capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); + if (capi_labels_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels = (int *)(PyArray_DATA(capi_labels_as_array)); + + /* Processing variable i */ + i_Dims[0]=nnz; + capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 2nd argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable j */ + j_Dims[0]=nnz; + capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 3rd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + sparse_localmaxlabel_return_value = (*f2py_func)(v,i,j,nnz,MV,iMV,labels); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",sparse_localmaxlabel_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ + if((PyObject *)capi_labels_as_array!=labels_capi) { + Py_XDECREF(capi_labels_as_array); } + } /* if (capi_labels_as_array == NULL) ... else of labels */ + /* End of cleaning variable labels */ + if((PyObject *)capi_iMV_as_array!=iMV_capi) { + Py_XDECREF(capi_iMV_as_array); } + } /* if (capi_iMV_as_array == NULL) ... else of iMV */ + /* End of cleaning variable iMV */ + if((PyObject *)capi_MV_as_array!=MV_capi) { + Py_XDECREF(capi_MV_as_array); } + } /* if (capi_MV_as_array == NULL) ... else of MV */ + /* End of cleaning variable MV */ + /* End of cleaning variable nnz */ + if((PyObject *)capi_v_as_array!=v_capi) { + Py_XDECREF(capi_v_as_array); } + } /* if (capi_v_as_array == NULL) ... else of v */ + /* End of cleaning variable v */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************ end of sparse_localmaxlabel ************************/ + +/****************************** sparse_overlaps ******************************/ +static char doc_f2py_rout__cImageD11_sparse_overlaps[] = "\ +sparse_overlaps = sparse_overlaps(i1,j1,k1,i2,j2,k2)\n\nWrapper for ``sparse_overlaps``.\ +\n\nParameters\n----------\n" +"i1 : input rank-1 array('H') with bounds (nnz1)\n" +"j1 : input rank-1 array('H') with bounds (nnz1)\n" +"k1 : in/output rank-1 array('i') with bounds (nnz1)\n" +"i2 : input rank-1 array('H') with bounds (nnz2)\n" +"j2 : input rank-1 array('H') with bounds (nnz2)\n" +"k2 : in/output rank-1 array('i') with bounds (nnz2)\n" +"\nReturns\n-------\n" +"sparse_overlaps : int"; +/* extern int sparse_overlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int); */ +static PyObject *f2py_rout__cImageD11_sparse_overlaps(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int sparse_overlaps_return_value=0; + unsigned_short *i1 = NULL; + npy_intp i1_Dims[1] = {-1}; + const int i1_Rank = 1; + PyArrayObject *capi_i1_as_array = NULL; + int capi_i1_intent = 0; + PyObject *i1_capi = Py_None; + unsigned_short *j1 = NULL; + npy_intp j1_Dims[1] = {-1}; + const int j1_Rank = 1; + PyArrayObject *capi_j1_as_array = NULL; + int capi_j1_intent = 0; + PyObject *j1_capi = Py_None; + int *k1 = NULL; + npy_intp k1_Dims[1] = {-1}; + const int k1_Rank = 1; + PyArrayObject *capi_k1_as_array = NULL; + int capi_k1_intent = 0; + PyObject *k1_capi = Py_None; + int nnz1 = 0; + unsigned_short *i2 = NULL; + npy_intp i2_Dims[1] = {-1}; + const int i2_Rank = 1; + PyArrayObject *capi_i2_as_array = NULL; + int capi_i2_intent = 0; + PyObject *i2_capi = Py_None; + unsigned_short *j2 = NULL; + npy_intp j2_Dims[1] = {-1}; + const int j2_Rank = 1; + PyArrayObject *capi_j2_as_array = NULL; + int capi_j2_intent = 0; + PyObject *j2_capi = Py_None; + int *k2 = NULL; + npy_intp k2_Dims[1] = {-1}; + const int k2_Rank = 1; + PyArrayObject *capi_k2_as_array = NULL; + int capi_k2_intent = 0; + PyObject *k2_capi = Py_None; + int nnz2 = 0; + static char *capi_kwlist[] = {"i1","j1","k1","i2","j2","k2",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.sparse_overlaps",\ + capi_kwlist,&i1_capi,&j1_capi,&k1_capi,&i2_capi,&j2_capi,&k2_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable i1 */ + ; + capi_i1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 1st argument `i1`"; + capi_i1_as_array = ndarray_from_pyobj( NPY_USHORT,1,i1_Dims,i1_Rank, capi_i1_intent,i1_capi,capi_errmess); + if (capi_i1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i1 = (unsigned_short *)(PyArray_DATA(capi_i1_as_array)); + + /* Processing variable i2 */ + ; + capi_i2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 4th argument `i2`"; + capi_i2_as_array = ndarray_from_pyobj( NPY_USHORT,1,i2_Dims,i2_Rank, capi_i2_intent,i2_capi,capi_errmess); + if (capi_i2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i2 = (unsigned_short *)(PyArray_DATA(capi_i2_as_array)); + + /* Processing variable nnz1 */ + nnz1 = shape(i1,0); + /* Processing variable nnz2 */ + nnz2 = shape(i2,0); + /* Processing variable j1 */ + j1_Dims[0]=nnz1; + capi_j1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 2nd argument `j1`"; + capi_j1_as_array = ndarray_from_pyobj( NPY_USHORT,1,j1_Dims,j1_Rank, capi_j1_intent,j1_capi,capi_errmess); + if (capi_j1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j1 = (unsigned_short *)(PyArray_DATA(capi_j1_as_array)); + + /* Processing variable k1 */ + k1_Dims[0]=nnz1; + capi_k1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 3rd argument `k1`"; + capi_k1_as_array = ndarray_from_pyobj( NPY_INT,1,k1_Dims,k1_Rank, capi_k1_intent,k1_capi,capi_errmess); + if (capi_k1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + k1 = (int *)(PyArray_DATA(capi_k1_as_array)); + + /* Processing variable j2 */ + j2_Dims[0]=nnz2; + capi_j2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 5th argument `j2`"; + capi_j2_as_array = ndarray_from_pyobj( NPY_USHORT,1,j2_Dims,j2_Rank, capi_j2_intent,j2_capi,capi_errmess); + if (capi_j2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j2 = (unsigned_short *)(PyArray_DATA(capi_j2_as_array)); + + /* Processing variable k2 */ + k2_Dims[0]=nnz2; + capi_k2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 6th argument `k2`"; + capi_k2_as_array = ndarray_from_pyobj( NPY_INT,1,k2_Dims,k2_Rank, capi_k2_intent,k2_capi,capi_errmess); + if (capi_k2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + k2 = (int *)(PyArray_DATA(capi_k2_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + sparse_overlaps_return_value = (*f2py_func)(i1,j1,k1,nnz1,i2,j2,k2,nnz2); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",sparse_overlaps_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_k2_as_array!=k2_capi) { + Py_XDECREF(capi_k2_as_array); } + } /* if (capi_k2_as_array == NULL) ... else of k2 */ + /* End of cleaning variable k2 */ + if((PyObject *)capi_j2_as_array!=j2_capi) { + Py_XDECREF(capi_j2_as_array); } + } /* if (capi_j2_as_array == NULL) ... else of j2 */ + /* End of cleaning variable j2 */ + if((PyObject *)capi_k1_as_array!=k1_capi) { + Py_XDECREF(capi_k1_as_array); } + } /* if (capi_k1_as_array == NULL) ... else of k1 */ + /* End of cleaning variable k1 */ + if((PyObject *)capi_j1_as_array!=j1_capi) { + Py_XDECREF(capi_j1_as_array); } + } /* if (capi_j1_as_array == NULL) ... else of j1 */ + /* End of cleaning variable j1 */ + /* End of cleaning variable nnz2 */ + /* End of cleaning variable nnz1 */ + if((PyObject *)capi_i2_as_array!=i2_capi) { + Py_XDECREF(capi_i2_as_array); } + } /* if (capi_i2_as_array == NULL) ... else of i2 */ + /* End of cleaning variable i2 */ + if((PyObject *)capi_i1_as_array!=i1_capi) { + Py_XDECREF(capi_i1_as_array); } + } /* if (capi_i1_as_array == NULL) ... else of i1 */ + /* End of cleaning variable i1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/*************************** end of sparse_overlaps ***************************/ + +/**************************** compress_duplicates ****************************/ +static char doc_f2py_rout__cImageD11_compress_duplicates[] = "\ +compress_duplicates = compress_duplicates(i,j,oi,oj,tmp)\n\nWrapper for ``compress_duplicates``.\ +\n\nParameters\n----------\n" +"i : input rank-1 array('i') with bounds (n)\n" +"j : input rank-1 array('i') with bounds (n)\n" +"oi : in/output rank-1 array('i') with bounds (n)\n" +"oj : in/output rank-1 array('i') with bounds (n)\n" +"tmp : in/output rank-1 array('i') with bounds (nt)\n" +"\nReturns\n-------\n" +"compress_duplicates : int"; +/* extern int compress_duplicates(int*,int*,int*,int*,int*,int,int); */ +static PyObject *f2py_rout__cImageD11_compress_duplicates(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(int*,int*,int*,int*,int*,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int compress_duplicates_return_value=0; + int *i = NULL; + npy_intp i_Dims[1] = {-1}; + const int i_Rank = 1; + PyArrayObject *capi_i_as_array = NULL; + int capi_i_intent = 0; + PyObject *i_capi = Py_None; + int *j = NULL; + npy_intp j_Dims[1] = {-1}; + const int j_Rank = 1; + PyArrayObject *capi_j_as_array = NULL; + int capi_j_intent = 0; + PyObject *j_capi = Py_None; + int *oi = NULL; + npy_intp oi_Dims[1] = {-1}; + const int oi_Rank = 1; + PyArrayObject *capi_oi_as_array = NULL; + int capi_oi_intent = 0; + PyObject *oi_capi = Py_None; + int *oj = NULL; + npy_intp oj_Dims[1] = {-1}; + const int oj_Rank = 1; + PyArrayObject *capi_oj_as_array = NULL; + int capi_oj_intent = 0; + PyObject *oj_capi = Py_None; + int *tmp = NULL; + npy_intp tmp_Dims[1] = {-1}; + const int tmp_Rank = 1; + PyArrayObject *capi_tmp_as_array = NULL; + int capi_tmp_intent = 0; + PyObject *tmp_capi = Py_None; + int n = 0; + int nt = 0; + static char *capi_kwlist[] = {"i","j","oi","oj","tmp",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOO|:_cImageD11.compress_duplicates",\ + capi_kwlist,&i_capi,&j_capi,&oi_capi,&oj_capi,&tmp_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable i */ + ; + capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 1st argument `i`"; + capi_i_as_array = ndarray_from_pyobj( NPY_INT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); + if (capi_i_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + i = (int *)(PyArray_DATA(capi_i_as_array)); + + /* Processing variable tmp */ + ; + capi_tmp_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 5th argument `tmp`"; + capi_tmp_as_array = ndarray_from_pyobj( NPY_INT,1,tmp_Dims,tmp_Rank, capi_tmp_intent,tmp_capi,capi_errmess); + if (capi_tmp_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + tmp = (int *)(PyArray_DATA(capi_tmp_as_array)); + + /* Processing variable n */ + n = shape(i,0); + /* Processing variable nt */ + nt = shape(tmp,0); + /* Processing variable j */ + j_Dims[0]=n; + capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 2nd argument `j`"; + capi_j_as_array = ndarray_from_pyobj( NPY_INT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); + if (capi_j_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + j = (int *)(PyArray_DATA(capi_j_as_array)); + + /* Processing variable oi */ + oi_Dims[0]=n; + capi_oi_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 3rd argument `oi`"; + capi_oi_as_array = ndarray_from_pyobj( NPY_INT,1,oi_Dims,oi_Rank, capi_oi_intent,oi_capi,capi_errmess); + if (capi_oi_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + oi = (int *)(PyArray_DATA(capi_oi_as_array)); + + /* Processing variable oj */ + oj_Dims[0]=n; + capi_oj_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 4th argument `oj`"; + capi_oj_as_array = ndarray_from_pyobj( NPY_INT,1,oj_Dims,oj_Rank, capi_oj_intent,oj_capi,capi_errmess); + if (capi_oj_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + oj = (int *)(PyArray_DATA(capi_oj_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + compress_duplicates_return_value = (*f2py_func)(i,j,oi,oj,tmp,n,nt); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",compress_duplicates_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_oj_as_array!=oj_capi) { + Py_XDECREF(capi_oj_as_array); } + } /* if (capi_oj_as_array == NULL) ... else of oj */ + /* End of cleaning variable oj */ + if((PyObject *)capi_oi_as_array!=oi_capi) { + Py_XDECREF(capi_oi_as_array); } + } /* if (capi_oi_as_array == NULL) ... else of oi */ + /* End of cleaning variable oi */ + if((PyObject *)capi_j_as_array!=j_capi) { + Py_XDECREF(capi_j_as_array); } + } /* if (capi_j_as_array == NULL) ... else of j */ + /* End of cleaning variable j */ + /* End of cleaning variable nt */ + /* End of cleaning variable n */ + if((PyObject *)capi_tmp_as_array!=tmp_capi) { + Py_XDECREF(capi_tmp_as_array); } + } /* if (capi_tmp_as_array == NULL) ... else of tmp */ + /* End of cleaning variable tmp */ + if((PyObject *)capi_i_as_array!=i_capi) { + Py_XDECREF(capi_i_as_array); } + } /* if (capi_i_as_array == NULL) ... else of i */ + /* End of cleaning variable i */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/************************* end of compress_duplicates *************************/ + +/********************************* coverlaps *********************************/ +static char doc_f2py_rout__cImageD11_coverlaps[] = "\ +coverlaps = coverlaps(row1,col1,labels1,row2,col2,labels2,mat,results)\n\nWrapper for ``coverlaps``.\ +\n\nParameters\n----------\n" +"row1 : input rank-1 array('H') with bounds (nnz1)\n" +"col1 : input rank-1 array('H') with bounds (nnz1)\n" +"labels1 : input rank-1 array('i') with bounds (nnz1)\n" +"row2 : input rank-1 array('H') with bounds (nnz2)\n" +"col2 : input rank-1 array('H') with bounds (nnz2)\n" +"labels2 : input rank-1 array('i') with bounds (nnz2)\n" +"mat : input rank-2 array('i') with bounds (npk1,npk2)\n" +"results : in/output rank-1 array('i') with bounds (*)\n" +"\nReturns\n-------\n" +"coverlaps : int"; +/* extern int coverlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int,int*,int,int,int*); */ +static PyObject *f2py_rout__cImageD11_coverlaps(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int,int*,int,int,int*)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int coverlaps_return_value=0; + unsigned_short *row1 = NULL; + npy_intp row1_Dims[1] = {-1}; + const int row1_Rank = 1; + PyArrayObject *capi_row1_as_array = NULL; + int capi_row1_intent = 0; + PyObject *row1_capi = Py_None; + unsigned_short *col1 = NULL; + npy_intp col1_Dims[1] = {-1}; + const int col1_Rank = 1; + PyArrayObject *capi_col1_as_array = NULL; + int capi_col1_intent = 0; + PyObject *col1_capi = Py_None; + int *labels1 = NULL; + npy_intp labels1_Dims[1] = {-1}; + const int labels1_Rank = 1; + PyArrayObject *capi_labels1_as_array = NULL; + int capi_labels1_intent = 0; + PyObject *labels1_capi = Py_None; + int nnz1 = 0; + unsigned_short *row2 = NULL; + npy_intp row2_Dims[1] = {-1}; + const int row2_Rank = 1; + PyArrayObject *capi_row2_as_array = NULL; + int capi_row2_intent = 0; + PyObject *row2_capi = Py_None; + unsigned_short *col2 = NULL; + npy_intp col2_Dims[1] = {-1}; + const int col2_Rank = 1; + PyArrayObject *capi_col2_as_array = NULL; + int capi_col2_intent = 0; + PyObject *col2_capi = Py_None; + int *labels2 = NULL; + npy_intp labels2_Dims[1] = {-1}; + const int labels2_Rank = 1; + PyArrayObject *capi_labels2_as_array = NULL; + int capi_labels2_intent = 0; + PyObject *labels2_capi = Py_None; + int nnz2 = 0; + int *mat = NULL; + npy_intp mat_Dims[2] = {-1, -1}; + const int mat_Rank = 2; + PyArrayObject *capi_mat_as_array = NULL; + int capi_mat_intent = 0; + PyObject *mat_capi = Py_None; + int npk1 = 0; + int npk2 = 0; + int *results = NULL; + npy_intp results_Dims[1] = {-1}; + const int results_Rank = 1; + PyArrayObject *capi_results_as_array = NULL; + int capi_results_intent = 0; + PyObject *results_capi = Py_None; + static char *capi_kwlist[] = {"row1","col1","labels1","row2","col2","labels2","mat","results",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOOOO|:_cImageD11.coverlaps",\ + capi_kwlist,&row1_capi,&col1_capi,&labels1_capi,&row2_capi,&col2_capi,&labels2_capi,&mat_capi,&results_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable row1 */ + ; + capi_row1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 1st argument `row1`"; + capi_row1_as_array = ndarray_from_pyobj( NPY_USHORT,1,row1_Dims,row1_Rank, capi_row1_intent,row1_capi,capi_errmess); + if (capi_row1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + row1 = (unsigned_short *)(PyArray_DATA(capi_row1_as_array)); + + /* Processing variable row2 */ + ; + capi_row2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 4th argument `row2`"; + capi_row2_as_array = ndarray_from_pyobj( NPY_USHORT,1,row2_Dims,row2_Rank, capi_row2_intent,row2_capi,capi_errmess); + if (capi_row2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + row2 = (unsigned_short *)(PyArray_DATA(capi_row2_as_array)); + + /* Processing variable mat */ + ; + capi_mat_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 7th argument `mat`"; + capi_mat_as_array = ndarray_from_pyobj( NPY_INT,1,mat_Dims,mat_Rank, capi_mat_intent,mat_capi,capi_errmess); + if (capi_mat_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + mat = (int *)(PyArray_DATA(capi_mat_as_array)); + + /* Processing variable results */ + ; + capi_results_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 8th argument `results`"; + capi_results_as_array = ndarray_from_pyobj( NPY_INT,1,results_Dims,results_Rank, capi_results_intent,results_capi,capi_errmess); + if (capi_results_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + results = (int *)(PyArray_DATA(capi_results_as_array)); + + /* Processing variable nnz1 */ + nnz1 = shape(row1,0); + /* Processing variable nnz2 */ + nnz2 = shape(row2,0); + /* Processing variable npk1 */ + npk1 = shape(mat, 0); + /* Processing variable npk2 */ + npk2 = shape(mat, 1); + /* Processing variable col1 */ + col1_Dims[0]=nnz1; + capi_col1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 2nd argument `col1`"; + capi_col1_as_array = ndarray_from_pyobj( NPY_USHORT,1,col1_Dims,col1_Rank, capi_col1_intent,col1_capi,capi_errmess); + if (capi_col1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + col1 = (unsigned_short *)(PyArray_DATA(capi_col1_as_array)); + + /* Processing variable labels1 */ + labels1_Dims[0]=nnz1; + capi_labels1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 3rd argument `labels1`"; + capi_labels1_as_array = ndarray_from_pyobj( NPY_INT,1,labels1_Dims,labels1_Rank, capi_labels1_intent,labels1_capi,capi_errmess); + if (capi_labels1_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels1 = (int *)(PyArray_DATA(capi_labels1_as_array)); + + /* Processing variable col2 */ + col2_Dims[0]=nnz2; + capi_col2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 5th argument `col2`"; + capi_col2_as_array = ndarray_from_pyobj( NPY_USHORT,1,col2_Dims,col2_Rank, capi_col2_intent,col2_capi,capi_errmess); + if (capi_col2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + col2 = (unsigned_short *)(PyArray_DATA(capi_col2_as_array)); + + /* Processing variable labels2 */ + labels2_Dims[0]=nnz2; + capi_labels2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 6th argument `labels2`"; + capi_labels2_as_array = ndarray_from_pyobj( NPY_INT,1,labels2_Dims,labels2_Rank, capi_labels2_intent,labels2_capi,capi_errmess); + if (capi_labels2_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + labels2 = (int *)(PyArray_DATA(capi_labels2_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + coverlaps_return_value = (*f2py_func)(row1,col1,labels1,nnz1,row2,col2,labels2,nnz2,mat,npk1,npk2,results); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",coverlaps_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_labels2_as_array!=labels2_capi) { + Py_XDECREF(capi_labels2_as_array); } + } /* if (capi_labels2_as_array == NULL) ... else of labels2 */ + /* End of cleaning variable labels2 */ + if((PyObject *)capi_col2_as_array!=col2_capi) { + Py_XDECREF(capi_col2_as_array); } + } /* if (capi_col2_as_array == NULL) ... else of col2 */ + /* End of cleaning variable col2 */ + if((PyObject *)capi_labels1_as_array!=labels1_capi) { + Py_XDECREF(capi_labels1_as_array); } + } /* if (capi_labels1_as_array == NULL) ... else of labels1 */ + /* End of cleaning variable labels1 */ + if((PyObject *)capi_col1_as_array!=col1_capi) { + Py_XDECREF(capi_col1_as_array); } + } /* if (capi_col1_as_array == NULL) ... else of col1 */ + /* End of cleaning variable col1 */ + /* End of cleaning variable npk2 */ + /* End of cleaning variable npk1 */ + /* End of cleaning variable nnz2 */ + /* End of cleaning variable nnz1 */ + if((PyObject *)capi_results_as_array!=results_capi) { + Py_XDECREF(capi_results_as_array); } + } /* if (capi_results_as_array == NULL) ... else of results */ + /* End of cleaning variable results */ + if((PyObject *)capi_mat_as_array!=mat_capi) { + Py_XDECREF(capi_mat_as_array); } + } /* if (capi_mat_as_array == NULL) ... else of mat */ + /* End of cleaning variable mat */ + if((PyObject *)capi_row2_as_array!=row2_capi) { + Py_XDECREF(capi_row2_as_array); } + } /* if (capi_row2_as_array == NULL) ... else of row2 */ + /* End of cleaning variable row2 */ + if((PyObject *)capi_row1_as_array!=row1_capi) { + Py_XDECREF(capi_row1_as_array); } + } /* if (capi_row1_as_array == NULL) ... else of row1 */ + /* End of cleaning variable row1 */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/****************************** end of coverlaps ******************************/ + +/******************************** tosparse_u16 ********************************/ +static char doc_f2py_rout__cImageD11_tosparse_u16[] = "\ +tosparse_u16 = tosparse_u16(img,msk,row,col,val,cut)\n\nWrapper for ``tosparse_u16``.\ +\n\nParameters\n----------\n" +"img : input rank-2 array('H') with bounds (ns,nf)\n" +"msk : input rank-2 array('B') with bounds (ns,nf)\n" +"row : input rank-2 array('H') with bounds (ns,nf)\n" +"col : input rank-2 array('H') with bounds (ns,nf)\n" +"val : input rank-2 array('H') with bounds (ns,nf)\n" +"cut : input int\n" +"\nReturns\n-------\n" +"tosparse_u16 : int"; +/* extern int tosparse_u16(unsigned_short*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned_short*,int,int,int); */ +static PyObject *f2py_rout__cImageD11_tosparse_u16(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(unsigned_short*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned_short*,int,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int tosparse_u16_return_value=0; + unsigned_short *img = NULL; + npy_intp img_Dims[2] = {-1, -1}; + const int img_Rank = 2; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + unsigned_char *msk = NULL; + npy_intp msk_Dims[2] = {-1, -1}; + const int msk_Rank = 2; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + unsigned_short *row = NULL; + npy_intp row_Dims[2] = {-1, -1}; + const int row_Rank = 2; + PyArrayObject *capi_row_as_array = NULL; + int capi_row_intent = 0; + PyObject *row_capi = Py_None; + unsigned_short *col = NULL; + npy_intp col_Dims[2] = {-1, -1}; + const int col_Rank = 2; + PyArrayObject *capi_col_as_array = NULL; + int capi_col_intent = 0; + PyObject *col_capi = Py_None; + unsigned_short *val = NULL; + npy_intp val_Dims[2] = {-1, -1}; + const int val_Rank = 2; + PyArrayObject *capi_val_as_array = NULL; + int capi_val_intent = 0; + PyObject *val_capi = Py_None; + int cut = 0; + PyObject *cut_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"img","msk","row","col","val","cut",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.tosparse_u16",\ + capi_kwlist,&img_capi,&msk_capi,&row_capi,&col_capi,&val_capi,&cut_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_USHORT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (unsigned_short *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable cut */ + f2py_success = int_from_pyobj(&cut,cut_capi,"_cImageD11.tosparse_u16() 6th argument (cut) can't be converted to int"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(img,0); + /* Processing variable nf */ + nf = shape(img,1); + /* Processing variable msk */ + msk_Dims[0]=ns,msk_Dims[1]=nf; + capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 2nd argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); + + /* Processing variable row */ + row_Dims[0]=ns,row_Dims[1]=nf; + capi_row_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 3rd argument `row`"; + capi_row_as_array = ndarray_from_pyobj( NPY_USHORT,1,row_Dims,row_Rank, capi_row_intent,row_capi,capi_errmess); + if (capi_row_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + row = (unsigned_short *)(PyArray_DATA(capi_row_as_array)); + + /* Processing variable col */ + col_Dims[0]=ns,col_Dims[1]=nf; + capi_col_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 4th argument `col`"; + capi_col_as_array = ndarray_from_pyobj( NPY_USHORT,1,col_Dims,col_Rank, capi_col_intent,col_capi,capi_errmess); + if (capi_col_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + col = (unsigned_short *)(PyArray_DATA(capi_col_as_array)); + + /* Processing variable val */ + val_Dims[0]=ns,val_Dims[1]=nf; + capi_val_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 5th argument `val`"; + capi_val_as_array = ndarray_from_pyobj( NPY_USHORT,1,val_Dims,val_Rank, capi_val_intent,val_capi,capi_errmess); + if (capi_val_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + val = (unsigned_short *)(PyArray_DATA(capi_val_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + tosparse_u16_return_value = (*f2py_func)(img,msk,row,col,val,cut,ns,nf); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",tosparse_u16_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_val_as_array!=val_capi) { + Py_XDECREF(capi_val_as_array); } + } /* if (capi_val_as_array == NULL) ... else of val */ + /* End of cleaning variable val */ + if((PyObject *)capi_col_as_array!=col_capi) { + Py_XDECREF(capi_col_as_array); } + } /* if (capi_col_as_array == NULL) ... else of col */ + /* End of cleaning variable col */ + if((PyObject *)capi_row_as_array!=row_capi) { + Py_XDECREF(capi_row_as_array); } + } /* if (capi_row_as_array == NULL) ... else of row */ + /* End of cleaning variable row */ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of tosparse_u16 ****************************/ + +/******************************** tosparse_u32 ********************************/ +static char doc_f2py_rout__cImageD11_tosparse_u32[] = "\ +tosparse_u32 = tosparse_u32(img,msk,row,col,val,cut)\n\nWrapper for ``tosparse_u32``.\ +\n\nParameters\n----------\n" +"img : input rank-2 array('I') with bounds (ns,nf)\n" +"msk : input rank-2 array('B') with bounds (ns,nf)\n" +"row : input rank-1 array('H') with bounds (*)\n" +"col : input rank-1 array('H') with bounds (*)\n" +"val : input rank-1 array('I') with bounds (*)\n" +"cut : input float\n" +"\nReturns\n-------\n" +"tosparse_u32 : int"; +/* extern int tosparse_u32(unsigned*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned*,float,int,int); */ +static PyObject *f2py_rout__cImageD11_tosparse_u32(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(unsigned*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned*,float,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int tosparse_u32_return_value=0; + unsigned *img = NULL; + npy_intp img_Dims[2] = {-1, -1}; + const int img_Rank = 2; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + unsigned_char *msk = NULL; + npy_intp msk_Dims[2] = {-1, -1}; + const int msk_Rank = 2; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + unsigned_short *row = NULL; + npy_intp row_Dims[1] = {-1}; + const int row_Rank = 1; + PyArrayObject *capi_row_as_array = NULL; + int capi_row_intent = 0; + PyObject *row_capi = Py_None; + unsigned_short *col = NULL; + npy_intp col_Dims[1] = {-1}; + const int col_Rank = 1; + PyArrayObject *capi_col_as_array = NULL; + int capi_col_intent = 0; + PyObject *col_capi = Py_None; + unsigned *val = NULL; + npy_intp val_Dims[1] = {-1}; + const int val_Rank = 1; + PyArrayObject *capi_val_as_array = NULL; + int capi_val_intent = 0; + PyObject *val_capi = Py_None; + float cut = 0; + PyObject *cut_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"img","msk","row","col","val","cut",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.tosparse_u32",\ + capi_kwlist,&img_capi,&msk_capi,&row_capi,&col_capi,&val_capi,&cut_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_UINT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (unsigned *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable row */ + ; + capi_row_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 3rd argument `row`"; + capi_row_as_array = ndarray_from_pyobj( NPY_USHORT,1,row_Dims,row_Rank, capi_row_intent,row_capi,capi_errmess); + if (capi_row_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + row = (unsigned_short *)(PyArray_DATA(capi_row_as_array)); + + /* Processing variable col */ + ; + capi_col_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 4th argument `col`"; + capi_col_as_array = ndarray_from_pyobj( NPY_USHORT,1,col_Dims,col_Rank, capi_col_intent,col_capi,capi_errmess); + if (capi_col_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + col = (unsigned_short *)(PyArray_DATA(capi_col_as_array)); + + /* Processing variable val */ + ; + capi_val_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 5th argument `val`"; + capi_val_as_array = ndarray_from_pyobj( NPY_UINT,1,val_Dims,val_Rank, capi_val_intent,val_capi,capi_errmess); + if (capi_val_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + val = (unsigned *)(PyArray_DATA(capi_val_as_array)); + + /* Processing variable cut */ + f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.tosparse_u32() 6th argument (cut) can't be converted to float"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(img,0); + /* Processing variable nf */ + nf = shape(img,1); + /* Processing variable msk */ + msk_Dims[0]=ns,msk_Dims[1]=nf; + capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 2nd argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + tosparse_u32_return_value = (*f2py_func)(img,msk,row,col,val,cut,ns,nf); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",tosparse_u32_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ + if((PyObject *)capi_val_as_array!=val_capi) { + Py_XDECREF(capi_val_as_array); } + } /* if (capi_val_as_array == NULL) ... else of val */ + /* End of cleaning variable val */ + if((PyObject *)capi_col_as_array!=col_capi) { + Py_XDECREF(capi_col_as_array); } + } /* if (capi_col_as_array == NULL) ... else of col */ + /* End of cleaning variable col */ + if((PyObject *)capi_row_as_array!=row_capi) { + Py_XDECREF(capi_row_as_array); } + } /* if (capi_row_as_array == NULL) ... else of row */ + /* End of cleaning variable row */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of tosparse_u32 ****************************/ + +/******************************** tosparse_f32 ********************************/ +static char doc_f2py_rout__cImageD11_tosparse_f32[] = "\ +tosparse_f32 = tosparse_f32(img,msk,row,col,val,cut)\n\nWrapper for ``tosparse_f32``.\ +\n\nParameters\n----------\n" +"img : input rank-2 array('f') with bounds (ns,nf)\n" +"msk : input rank-2 array('B') with bounds (ns,nf)\n" +"row : input rank-2 array('H') with bounds (ns,nf)\n" +"col : input rank-2 array('H') with bounds (ns,nf)\n" +"val : input rank-2 array('f') with bounds (ns,nf)\n" +"cut : input float\n" +"\nReturns\n-------\n" +"tosparse_f32 : int"; +/* extern int tosparse_f32(float*,unsigned_char*,unsigned_short*,unsigned_short*,float*,float,int,int); */ +static PyObject *f2py_rout__cImageD11_tosparse_f32(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + int (*f2py_func)(float*,unsigned_char*,unsigned_short*,unsigned_short*,float*,float,int,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + int tosparse_f32_return_value=0; + float *img = NULL; + npy_intp img_Dims[2] = {-1, -1}; + const int img_Rank = 2; + PyArrayObject *capi_img_as_array = NULL; + int capi_img_intent = 0; + PyObject *img_capi = Py_None; + unsigned_char *msk = NULL; + npy_intp msk_Dims[2] = {-1, -1}; + const int msk_Rank = 2; + PyArrayObject *capi_msk_as_array = NULL; + int capi_msk_intent = 0; + PyObject *msk_capi = Py_None; + unsigned_short *row = NULL; + npy_intp row_Dims[2] = {-1, -1}; + const int row_Rank = 2; + PyArrayObject *capi_row_as_array = NULL; + int capi_row_intent = 0; + PyObject *row_capi = Py_None; + unsigned_short *col = NULL; + npy_intp col_Dims[2] = {-1, -1}; + const int col_Rank = 2; + PyArrayObject *capi_col_as_array = NULL; + int capi_col_intent = 0; + PyObject *col_capi = Py_None; + float *val = NULL; + npy_intp val_Dims[2] = {-1, -1}; + const int val_Rank = 2; + PyArrayObject *capi_val_as_array = NULL; + int capi_val_intent = 0; + PyObject *val_capi = Py_None; + float cut = 0; + PyObject *cut_capi = Py_None; + int ns = 0; + int nf = 0; + static char *capi_kwlist[] = {"img","msk","row","col","val","cut",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOOOO|:_cImageD11.tosparse_f32",\ + capi_kwlist,&img_capi,&msk_capi,&row_capi,&col_capi,&val_capi,&cut_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable img */ + ; + capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 1st argument `img`"; + capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); + if (capi_img_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + img = (float *)(PyArray_DATA(capi_img_as_array)); + + /* Processing variable cut */ + f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.tosparse_f32() 6th argument (cut) can't be converted to float"); + if (f2py_success) { + /* Processing variable ns */ + ns = shape(img,0); + /* Processing variable nf */ + nf = shape(img,1); + /* Processing variable msk */ + msk_Dims[0]=ns,msk_Dims[1]=nf; + capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 2nd argument `msk`"; + capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); + if (capi_msk_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); + + /* Processing variable row */ + row_Dims[0]=ns,row_Dims[1]=nf; + capi_row_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 3rd argument `row`"; + capi_row_as_array = ndarray_from_pyobj( NPY_USHORT,1,row_Dims,row_Rank, capi_row_intent,row_capi,capi_errmess); + if (capi_row_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + row = (unsigned_short *)(PyArray_DATA(capi_row_as_array)); + + /* Processing variable col */ + col_Dims[0]=ns,col_Dims[1]=nf; + capi_col_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 4th argument `col`"; + capi_col_as_array = ndarray_from_pyobj( NPY_USHORT,1,col_Dims,col_Rank, capi_col_intent,col_capi,capi_errmess); + if (capi_col_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + col = (unsigned_short *)(PyArray_DATA(capi_col_as_array)); + + /* Processing variable val */ + val_Dims[0]=ns,val_Dims[1]=nf; + capi_val_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 5th argument `val`"; + capi_val_as_array = ndarray_from_pyobj( NPY_FLOAT,1,val_Dims,val_Rank, capi_val_intent,val_capi,capi_errmess); + if (capi_val_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + val = (float *)(PyArray_DATA(capi_val_as_array)); + +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + Py_BEGIN_ALLOW_THREADS + tosparse_f32_return_value = (*f2py_func)(img,msk,row,col,val,cut,ns,nf); + Py_END_ALLOW_THREADS +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue("i",tosparse_f32_return_value); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + if((PyObject *)capi_val_as_array!=val_capi) { + Py_XDECREF(capi_val_as_array); } + } /* if (capi_val_as_array == NULL) ... else of val */ + /* End of cleaning variable val */ + if((PyObject *)capi_col_as_array!=col_capi) { + Py_XDECREF(capi_col_as_array); } + } /* if (capi_col_as_array == NULL) ... else of col */ + /* End of cleaning variable col */ + if((PyObject *)capi_row_as_array!=row_capi) { + Py_XDECREF(capi_row_as_array); } + } /* if (capi_row_as_array == NULL) ... else of row */ + /* End of cleaning variable row */ + if((PyObject *)capi_msk_as_array!=msk_capi) { + Py_XDECREF(capi_msk_as_array); } + } /* if (capi_msk_as_array == NULL) ... else of msk */ + /* End of cleaning variable msk */ + /* End of cleaning variable nf */ + /* End of cleaning variable ns */ + } /*if (f2py_success) of cut*/ + /* End of cleaning variable cut */ + if((PyObject *)capi_img_as_array!=img_capi) { + Py_XDECREF(capi_img_as_array); } + } /* if (capi_img_as_array == NULL) ... else of img */ + /* End of cleaning variable img */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/**************************** end of tosparse_f32 ****************************/ + +/*********************************** splat ***********************************/ +static char doc_f2py_rout__cImageD11_splat[] = "\ +splat(rgba,gve,u,npx)\n\nWrapper for ``splat``.\ +\n\nParameters\n----------\n" +"rgba : input rank-3 array('B') with bounds (w,h,4)\n" +"gve : in/output rank-2 array('d') with bounds (ng,3)\n" +"u : input rank-1 array('d') with bounds (9)\n" +"npx : input int"; +/* extern void splat(unsigned_char*,int,int,double*,int,double*,int); */ +static PyObject *f2py_rout__cImageD11_splat(const PyObject *capi_self, + PyObject *capi_args, + PyObject *capi_keywds, + void (*f2py_func)(unsigned_char*,int,int,double*,int,double*,int)) { + PyObject * volatile capi_buildvalue = NULL; + volatile int f2py_success = 1; +/*decl*/ + + unsigned_char *rgba = NULL; + npy_intp rgba_Dims[3] = {-1, -1, -1}; + const int rgba_Rank = 3; + PyArrayObject *capi_rgba_as_array = NULL; + int capi_rgba_intent = 0; + PyObject *rgba_capi = Py_None; + int w = 0; + int h = 0; + double *gve = NULL; + npy_intp gve_Dims[2] = {-1, -1}; + const int gve_Rank = 2; + PyArrayObject *capi_gve_as_array = NULL; + int capi_gve_intent = 0; + PyObject *gve_capi = Py_None; + int ng = 0; + double *u = NULL; + npy_intp u_Dims[1] = {-1}; + const int u_Rank = 1; + PyArrayObject *capi_u_as_array = NULL; + int capi_u_intent = 0; + PyObject *u_capi = Py_None; + int npx = 0; + PyObject *npx_capi = Py_None; + static char *capi_kwlist[] = {"rgba","gve","u","npx",NULL}; + +/*routdebugenter*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_clock(); +#endif + if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ + "OOOO|:_cImageD11.splat",\ + capi_kwlist,&rgba_capi,&gve_capi,&u_capi,&npx_capi)) + return NULL; +/*frompyobj*/ + /* Processing variable rgba */ + rgba_Dims[2]=4; + capi_rgba_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.splat: failed to create array from the 1st argument `rgba`"; + capi_rgba_as_array = ndarray_from_pyobj( NPY_UBYTE,1,rgba_Dims,rgba_Rank, capi_rgba_intent,rgba_capi,capi_errmess); + if (capi_rgba_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + rgba = (unsigned_char *)(PyArray_DATA(capi_rgba_as_array)); + + /* Processing variable gve */ + gve_Dims[1]=3; + capi_gve_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.splat: failed to create array from the 2nd argument `gve`"; + capi_gve_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gve_Dims,gve_Rank, capi_gve_intent,gve_capi,capi_errmess); + if (capi_gve_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + gve = (double *)(PyArray_DATA(capi_gve_as_array)); + + /* Processing variable u */ + u_Dims[0]=9; + capi_u_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; + const char * capi_errmess = "_cImageD11._cImageD11.splat: failed to create array from the 3rd argument `u`"; + capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); + if (capi_u_as_array == NULL) { + PyObject* capi_err = PyErr_Occurred(); + if (capi_err == NULL) { + capi_err = _cImageD11_error; + PyErr_SetString(capi_err, capi_errmess); + } + } else { + u = (double *)(PyArray_DATA(capi_u_as_array)); + + /* Processing variable npx */ + f2py_success = int_from_pyobj(&npx,npx_capi,"_cImageD11.splat() 4th argument (npx) can't be converted to int"); + if (f2py_success) { + /* Processing variable w */ + w = shape(rgba, 1); + /* Processing variable h */ + h = shape(rgba, 0); + /* Processing variable ng */ + ng = shape(gve, 0); + CHECKSCALAR(shape(gve, 0) == ng,"shape(gve, 0) == ng","hidden ng","splat:ng=%d",ng) { +/*end of frompyobj*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_start_call_clock(); +#endif +/*callfortranroutine*/ + (*f2py_func)(rgba,w,h,gve,ng,u,npx); +if (PyErr_Occurred()) + f2py_success = 0; +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_call_clock(); +#endif +/*end of callfortranroutine*/ + if (f2py_success) { +/*pyobjfrom*/ +/*end of pyobjfrom*/ + CFUNCSMESS("Building return value.\n"); + capi_buildvalue = Py_BuildValue(""); +/*closepyobjfrom*/ +/*end of closepyobjfrom*/ + } /*if (f2py_success) after callfortranroutine*/ +/*cleanupfrompyobj*/ + } /*CHECKSCALAR(shape(gve, 0) == ng)*/ + /* End of cleaning variable ng */ + /* End of cleaning variable h */ + /* End of cleaning variable w */ + } /*if (f2py_success) of npx*/ + /* End of cleaning variable npx */ + if((PyObject *)capi_u_as_array!=u_capi) { + Py_XDECREF(capi_u_as_array); } + } /* if (capi_u_as_array == NULL) ... else of u */ + /* End of cleaning variable u */ + if((PyObject *)capi_gve_as_array!=gve_capi) { + Py_XDECREF(capi_gve_as_array); } + } /* if (capi_gve_as_array == NULL) ... else of gve */ + /* End of cleaning variable gve */ + if((PyObject *)capi_rgba_as_array!=rgba_capi) { + Py_XDECREF(capi_rgba_as_array); } + } /* if (capi_rgba_as_array == NULL) ... else of rgba */ + /* End of cleaning variable rgba */ +/*end of cleanupfrompyobj*/ + if (capi_buildvalue == NULL) { +/*routdebugfailure*/ + } else { +/*routdebugleave*/ + } + CFUNCSMESS("Freeing memory.\n"); +/*freemem*/ +#ifdef F2PY_REPORT_ATEXIT +f2py_stop_clock(); +#endif + return capi_buildvalue; +} +/******************************** end of splat ********************************/ +/*eof body*/ + +/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ +/*need_f90modhooks*/ + +/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ + +/******************* See f2py2e/common_rules.py: buildhooks *******************/ + +/*need_commonhooks*/ + +/**************************** See f2py2e/rules.py ****************************/ + +static FortranDataDef f2py_routine_defs[] = { + {"compute_geometry",-1,{{-1}},0,0,(char *)compute_geometry, (f2py_init_func)f2py_rout__cImageD11_compute_geometry,doc_f2py_rout__cImageD11_compute_geometry}, + {"compute_gv",-1,{{-1}},0,0,(char *)compute_gv, (f2py_init_func)f2py_rout__cImageD11_compute_gv,doc_f2py_rout__cImageD11_compute_gv}, + {"compute_xlylzl",-1,{{-1}},0,0,(char *)compute_xlylzl, (f2py_init_func)f2py_rout__cImageD11_compute_xlylzl,doc_f2py_rout__cImageD11_compute_xlylzl}, + {"quickorient",-1,{{-1}},0,0,(char *)quickorient, (f2py_init_func)f2py_rout__cImageD11_quickorient,doc_f2py_rout__cImageD11_quickorient}, + {"cimaged11_omp_set_num_threads",-1,{{-1}},0,0,(char *)cimaged11_omp_set_num_threads, (f2py_init_func)f2py_rout__cImageD11_cimaged11_omp_set_num_threads,doc_f2py_rout__cImageD11_cimaged11_omp_set_num_threads}, + {"cimaged11_omp_get_max_threads",-1,{{-1}},0,0,(char *)cimaged11_omp_get_max_threads, (f2py_init_func)f2py_rout__cImageD11_cimaged11_omp_get_max_threads,doc_f2py_rout__cImageD11_cimaged11_omp_get_max_threads}, + {"uint16_to_float_darksub",-1,{{-1}},0,0,(char *)uint16_to_float_darksub, (f2py_init_func)f2py_rout__cImageD11_uint16_to_float_darksub,doc_f2py_rout__cImageD11_uint16_to_float_darksub}, + {"uint16_to_float_darkflm",-1,{{-1}},0,0,(char *)uint16_to_float_darkflm, (f2py_init_func)f2py_rout__cImageD11_uint16_to_float_darkflm,doc_f2py_rout__cImageD11_uint16_to_float_darkflm}, + {"frelon_lines",-1,{{-1}},0,0,(char *)frelon_lines, (f2py_init_func)f2py_rout__cImageD11_frelon_lines,doc_f2py_rout__cImageD11_frelon_lines}, + {"frelon_lines_sub",-1,{{-1}},0,0,(char *)frelon_lines_sub, (f2py_init_func)f2py_rout__cImageD11_frelon_lines_sub,doc_f2py_rout__cImageD11_frelon_lines_sub}, + {"array_mean_var_cut",-1,{{-1}},0,0,(char *)array_mean_var_cut, (f2py_init_func)f2py_rout__cImageD11_array_mean_var_cut,doc_f2py_rout__cImageD11_array_mean_var_cut}, + {"array_mean_var_msk",-1,{{-1}},0,0,(char *)array_mean_var_msk, (f2py_init_func)f2py_rout__cImageD11_array_mean_var_msk,doc_f2py_rout__cImageD11_array_mean_var_msk}, + {"array_stats",-1,{{-1}},0,0,(char *)array_stats, (f2py_init_func)f2py_rout__cImageD11_array_stats,doc_f2py_rout__cImageD11_array_stats}, + {"array_histogram",-1,{{-1}},0,0,(char *)array_histogram, (f2py_init_func)f2py_rout__cImageD11_array_histogram,doc_f2py_rout__cImageD11_array_histogram}, + {"reorder_u16_a32",-1,{{-1}},0,0,(char *)reorder_u16_a32, (f2py_init_func)f2py_rout__cImageD11_reorder_u16_a32,doc_f2py_rout__cImageD11_reorder_u16_a32}, + {"reorder_f32_a32",-1,{{-1}},0,0,(char *)reorder_f32_a32, (f2py_init_func)f2py_rout__cImageD11_reorder_f32_a32,doc_f2py_rout__cImageD11_reorder_f32_a32}, + {"reorderlut_u16_a32",-1,{{-1}},0,0,(char *)reorderlut_u16_a32, (f2py_init_func)f2py_rout__cImageD11_reorderlut_u16_a32,doc_f2py_rout__cImageD11_reorderlut_u16_a32}, + {"reorderlut_f32_a32",-1,{{-1}},0,0,(char *)reorderlut_f32_a32, (f2py_init_func)f2py_rout__cImageD11_reorderlut_f32_a32,doc_f2py_rout__cImageD11_reorderlut_f32_a32}, + {"reorder_u16_a32_a16",-1,{{-1}},0,0,(char *)reorder_u16_a32_a16, (f2py_init_func)f2py_rout__cImageD11_reorder_u16_a32_a16,doc_f2py_rout__cImageD11_reorder_u16_a32_a16}, + {"bgcalc",-1,{{-1}},0,0,(char *)bgcalc, (f2py_init_func)f2py_rout__cImageD11_bgcalc,doc_f2py_rout__cImageD11_bgcalc}, + {"verify_rounding",-1,{{-1}},0,0,(char *)verify_rounding, (f2py_init_func)f2py_rout__cImageD11_verify_rounding,doc_f2py_rout__cImageD11_verify_rounding}, + {"closest_vec",-1,{{-1}},0,0,(char *)closest_vec, (f2py_init_func)f2py_rout__cImageD11_closest_vec,doc_f2py_rout__cImageD11_closest_vec}, + {"closest",-1,{{-1}},0,0,(char *)closest, (f2py_init_func)f2py_rout__cImageD11_closest,doc_f2py_rout__cImageD11_closest}, + {"score",-1,{{-1}},0,0,(char *)score, (f2py_init_func)f2py_rout__cImageD11_score,doc_f2py_rout__cImageD11_score}, + {"score_and_refine",-1,{{-1}},0,0,(char *)score_and_refine, (f2py_init_func)f2py_rout__cImageD11_score_and_refine,doc_f2py_rout__cImageD11_score_and_refine}, + {"score_and_assign",-1,{{-1}},0,0,(char *)score_and_assign, (f2py_init_func)f2py_rout__cImageD11_score_and_assign,doc_f2py_rout__cImageD11_score_and_assign}, + {"refine_assigned",-1,{{-1}},0,0,(char *)refine_assigned, (f2py_init_func)f2py_rout__cImageD11_refine_assigned,doc_f2py_rout__cImageD11_refine_assigned}, + {"put_incr64",-1,{{-1}},0,0,(char *)put_incr64, (f2py_init_func)f2py_rout__cImageD11_put_incr64,doc_f2py_rout__cImageD11_put_incr64}, + {"put_incr32",-1,{{-1}},0,0,(char *)put_incr32, (f2py_init_func)f2py_rout__cImageD11_put_incr32,doc_f2py_rout__cImageD11_put_incr32}, + {"cluster1d",-1,{{-1}},0,0,(char *)cluster1d, (f2py_init_func)f2py_rout__cImageD11_cluster1d,doc_f2py_rout__cImageD11_cluster1d}, + {"score_gvec_z",-1,{{-1}},0,0,(char *)score_gvec_z, (f2py_init_func)f2py_rout__cImageD11_score_gvec_z,doc_f2py_rout__cImageD11_score_gvec_z}, + {"misori_cubic",-1,{{-1}},0,0,(char *)misori_cubic, (f2py_init_func)f2py_rout__cImageD11_misori_cubic,doc_f2py_rout__cImageD11_misori_cubic}, + {"misori_orthorhombic",-1,{{-1}},0,0,(char *)misori_orthorhombic, (f2py_init_func)f2py_rout__cImageD11_misori_orthorhombic,doc_f2py_rout__cImageD11_misori_orthorhombic}, + {"misori_tetragonal",-1,{{-1}},0,0,(char *)misori_tetragonal, (f2py_init_func)f2py_rout__cImageD11_misori_tetragonal,doc_f2py_rout__cImageD11_misori_tetragonal}, + {"misori_monoclinic",-1,{{-1}},0,0,(char *)misori_monoclinic, (f2py_init_func)f2py_rout__cImageD11_misori_monoclinic,doc_f2py_rout__cImageD11_misori_monoclinic}, + {"misori_cubic_pairs",-1,{{-1}},0,0,(char *)misori_cubic_pairs, (f2py_init_func)f2py_rout__cImageD11_misori_cubic_pairs,doc_f2py_rout__cImageD11_misori_cubic_pairs}, + {"count_shared",-1,{{-1}},0,0,(char *)count_shared, (f2py_init_func)f2py_rout__cImageD11_count_shared,doc_f2py_rout__cImageD11_count_shared}, + {"connectedpixels",-1,{{-1}},0,0,(char *)connectedpixels, (f2py_init_func)f2py_rout__cImageD11_connectedpixels,doc_f2py_rout__cImageD11_connectedpixels}, + {"blobproperties",-1,{{-1}},0,0,(char *)blobproperties, (f2py_init_func)f2py_rout__cImageD11_blobproperties,doc_f2py_rout__cImageD11_blobproperties}, + {"bloboverlaps",-1,{{-1}},0,0,(char *)bloboverlaps, (f2py_init_func)f2py_rout__cImageD11_bloboverlaps,doc_f2py_rout__cImageD11_bloboverlaps}, + {"blob_moments",-1,{{-1}},0,0,(char *)blob_moments, (f2py_init_func)f2py_rout__cImageD11_blob_moments,doc_f2py_rout__cImageD11_blob_moments}, + {"clean_mask",-1,{{-1}},0,0,(char *)clean_mask, (f2py_init_func)f2py_rout__cImageD11_clean_mask,doc_f2py_rout__cImageD11_clean_mask}, + {"make_clean_mask",-1,{{-1}},0,0,(char *)make_clean_mask, (f2py_init_func)f2py_rout__cImageD11_make_clean_mask,doc_f2py_rout__cImageD11_make_clean_mask}, + {"localmaxlabel",-1,{{-1}},0,0,(char *)localmaxlabel, (f2py_init_func)f2py_rout__cImageD11_localmaxlabel,doc_f2py_rout__cImageD11_localmaxlabel}, + {"mask_to_coo",-1,{{-1}},0,0,(char *)mask_to_coo, (f2py_init_func)f2py_rout__cImageD11_mask_to_coo,doc_f2py_rout__cImageD11_mask_to_coo}, + {"sparse_is_sorted",-1,{{-1}},0,0,(char *)sparse_is_sorted, (f2py_init_func)f2py_rout__cImageD11_sparse_is_sorted,doc_f2py_rout__cImageD11_sparse_is_sorted}, + {"sparse_connectedpixels",-1,{{-1}},0,0,(char *)sparse_connectedpixels, (f2py_init_func)f2py_rout__cImageD11_sparse_connectedpixels,doc_f2py_rout__cImageD11_sparse_connectedpixels}, + {"sparse_connectedpixels_splat",-1,{{-1}},0,0,(char *)sparse_connectedpixels_splat, (f2py_init_func)f2py_rout__cImageD11_sparse_connectedpixels_splat,doc_f2py_rout__cImageD11_sparse_connectedpixels_splat}, + {"sparse_blob2Dproperties",-1,{{-1}},0,0,(char *)sparse_blob2Dproperties, (f2py_init_func)f2py_rout__cImageD11_sparse_blob2Dproperties,doc_f2py_rout__cImageD11_sparse_blob2Dproperties}, + {"sparse_smooth",-1,{{-1}},0,0,(char *)sparse_smooth, (f2py_init_func)f2py_rout__cImageD11_sparse_smooth,doc_f2py_rout__cImageD11_sparse_smooth}, + {"sparse_localmaxlabel",-1,{{-1}},0,0,(char *)sparse_localmaxlabel, (f2py_init_func)f2py_rout__cImageD11_sparse_localmaxlabel,doc_f2py_rout__cImageD11_sparse_localmaxlabel}, + {"sparse_overlaps",-1,{{-1}},0,0,(char *)sparse_overlaps, (f2py_init_func)f2py_rout__cImageD11_sparse_overlaps,doc_f2py_rout__cImageD11_sparse_overlaps}, + {"compress_duplicates",-1,{{-1}},0,0,(char *)compress_duplicates, (f2py_init_func)f2py_rout__cImageD11_compress_duplicates,doc_f2py_rout__cImageD11_compress_duplicates}, + {"coverlaps",-1,{{-1}},0,0,(char *)coverlaps, (f2py_init_func)f2py_rout__cImageD11_coverlaps,doc_f2py_rout__cImageD11_coverlaps}, + {"tosparse_u16",-1,{{-1}},0,0,(char *)tosparse_u16, (f2py_init_func)f2py_rout__cImageD11_tosparse_u16,doc_f2py_rout__cImageD11_tosparse_u16}, + {"tosparse_u32",-1,{{-1}},0,0,(char *)tosparse_u32, (f2py_init_func)f2py_rout__cImageD11_tosparse_u32,doc_f2py_rout__cImageD11_tosparse_u32}, + {"tosparse_f32",-1,{{-1}},0,0,(char *)tosparse_f32, (f2py_init_func)f2py_rout__cImageD11_tosparse_f32,doc_f2py_rout__cImageD11_tosparse_f32}, + {"splat",-1,{{-1}},0,0,(char *)splat, (f2py_init_func)f2py_rout__cImageD11_splat,doc_f2py_rout__cImageD11_splat}, + +/*eof routine_defs*/ + {NULL} +}; + +static PyMethodDef f2py_module_methods[] = { + + {NULL,NULL} +}; + +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_cImageD11", + NULL, + -1, + f2py_module_methods, + NULL, + NULL, + NULL, + NULL +}; + +PyMODINIT_FUNC PyInit__cImageD11(void) { + int i; + PyObject *m,*d, *s, *tmp; + m = _cImageD11_module = PyModule_Create(&moduledef); + Py_SET_TYPE(&PyFortran_Type, &PyType_Type); + import_array(); + if (PyErr_Occurred()) + {PyErr_SetString(PyExc_ImportError, "can't initialize module _cImageD11 (failed to import numpy)"); return m;} + d = PyModule_GetDict(m); + s = PyUnicode_FromString("1.24.4"); + PyDict_SetItemString(d, "__version__", s); + Py_DECREF(s); + s = PyUnicode_FromString( + "This module '_cImageD11' is auto-generated with f2py (version:1.24.4).\nFunctions:\n" +" compute_geometry(xlylzl,omega,omegasign,wvln,wedge,chi,t,out)\n" +" compute_gv(xlylzl,omega,omegasign,wvln,wedge,chi,t,gv)\n" +" compute_xlylzl(s,f,p,r,dist,xlylzl)\n" +" quickorient(ubi,bt)\n" +" cimaged11_omp_set_num_threads(n)\n" +" cimaged11_omp_get_max_threads = cimaged11_omp_get_max_threads()\n" +" uint16_to_float_darksub(img,drk,data)\n" +" uint16_to_float_darkflm(img,drk,flm,data)\n" +" frelon_lines(img,cut)\n" +" frelon_lines_sub(img,drk,cut)\n" +" mean,var = array_mean_var_cut(img,n=3,cut=3.0,verbose=0)\n" +" mean,var = array_mean_var_msk(img,msk,n=3,cut=3.0,verbose=0)\n" +" minval,maxval,mean,var = array_stats(img)\n" +" array_histogram(img,low,high,hist)\n" +" reorder_u16_a32(data,adr,out)\n" +" reorder_f32_a32(data,adr,out)\n" +" reorderlut_u16_a32(data,adr,out)\n" +" reorderlut_f32_a32(data,adr,out)\n" +" reorder_u16_a32_a16(data,adr0,adr1,out)\n" +" bgcalc(img,bg,msk,gain,sp,st)\n" +" verify_rounding = verify_rounding(n)\n" +" closest_vec(x,ic)\n" +" ibest,best = closest(x,v)\n" +" score = score(ubi,gv,tol)\n" +" n,sumdrlv2 = score_and_refine(ubi,gv,tol)\n" +" score_and_assign = score_and_assign(ubi,gv,tol,drlv2,labels,label)\n" +" npk,drlv2 = refine_assigned(ubi,gv,labels,label)\n" +" put_incr64(data,ind,vals,boundscheck=0)\n" +" put_incr32(data,ind,vals,boundscheck=0)\n" +" nclusters = cluster1d(ar,order,tol,ids,avgs)\n" +" score_gvec_z(ubi,ub,gv,g0,g1,g2,e,recompute)\n" +" misori_cubic = misori_cubic(u1,u2)\n" +" misori_orthorhombic = misori_orthorhombic(u1,u2)\n" +" misori_tetragonal = misori_tetragonal(u1,u2)\n" +" misori_monoclinic = misori_monoclinic(u1,u2)\n" +" misori_cubic_pairs(u,dist,n=shape(u, 0))\n" +" count_shared = count_shared(pi,pj,ni=shape(pi, 0),nj=shape(pj, 0))\n" +" connectedpixels = connectedpixels(data,labels,threshold,verbose=0,con8=1)\n" +" results = blobproperties(data,labels,np,omega=0,verbose=0)\n" +" bloboverlaps = bloboverlaps(labels1,npk1,results1,labels2,npk2,results2,verbose=0)\n" +" blob_moments(results)\n" +" clean_mask = clean_mask(msk,ret)\n" +" make_clean_mask = make_clean_mask(img,cut,msk,ret)\n" +" localmaxlabel = localmaxlabel(data,labels,wrk)\n" +" mask_to_coo = mask_to_coo(msk,i,j,w)\n" +" sparse_is_sorted = sparse_is_sorted(i,j)\n" +" sparse_connectedpixels = sparse_connectedpixels(v,i,j,threshold,labels)\n" +" sparse_connectedpixels_splat = sparse_connectedpixels_splat(v,i,j,th,lbl,Z,ni,nj)\n" +" results = sparse_blob2Dproperties(v,i,j,labels,npk)\n" +" sparse_smooth(v,i,j,s)\n" +" sparse_localmaxlabel = sparse_localmaxlabel(v,i,j,MV,iMV,labels)\n" +" sparse_overlaps = sparse_overlaps(i1,j1,k1,i2,j2,k2)\n" +" compress_duplicates = compress_duplicates(i,j,oi,oj,tmp)\n" +" coverlaps = coverlaps(row1,col1,labels1,row2,col2,labels2,mat,results)\n" +" tosparse_u16 = tosparse_u16(img,msk,row,col,val,cut)\n" +" tosparse_u32 = tosparse_u32(img,msk,row,col,val,cut)\n" +" tosparse_f32 = tosparse_f32(img,msk,row,col,val,cut)\n" +" splat(rgba,gve,u,npx)\n" +"."); + PyDict_SetItemString(d, "__doc__", s); + Py_DECREF(s); + s = PyUnicode_FromString("1.24.4"); + PyDict_SetItemString(d, "__f2py_numpy_version__", s); + Py_DECREF(s); + _cImageD11_error = PyErr_NewException ("_cImageD11.error", NULL, NULL); + /* + * Store the error object inside the dict, so that it could get deallocated. + * (in practice, this is a module, so it likely will not and cannot.) + */ + PyDict_SetItemString(d, "__cImageD11_error", _cImageD11_error); + Py_DECREF(_cImageD11_error); + for(i=0;f2py_routine_defs[i].name!=NULL;i++) { + tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); + PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); + Py_DECREF(tmp); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/*eof initf2pywraphooks*/ +/*eof initf90modhooks*/ + +/*eof initcommonhooks*/ + /* start usercode multiline (0) */ + +/* This runs inside the init part of the module as it is after interface */ +#define str(x) (#x) +PyDict_SetItemString(d,str(s_1) ,PyInt_FromLong(s_1)); +PyDict_SetItemString(d,str(s_I) ,PyInt_FromLong(s_I)); +PyDict_SetItemString(d,str(s_I2) ,PyInt_FromLong(s_I2)); +PyDict_SetItemString(d,str(s_fI) ,PyInt_FromLong(s_fI)); +PyDict_SetItemString(d,str(s_ffI) ,PyInt_FromLong(s_ffI)); +PyDict_SetItemString(d,str(s_sI) ,PyInt_FromLong(s_sI)); +PyDict_SetItemString(d,str(s_ssI) ,PyInt_FromLong(s_ssI)); +PyDict_SetItemString(d,str(s_sfI) ,PyInt_FromLong(s_sfI)); +PyDict_SetItemString(d,str(s_oI) ,PyInt_FromLong(s_oI)); +PyDict_SetItemString(d,str(s_ooI) ,PyInt_FromLong(s_ooI)); +PyDict_SetItemString(d,str(s_soI) ,PyInt_FromLong(s_soI)); +PyDict_SetItemString(d,str(s_foI) ,PyInt_FromLong(s_foI)); +PyDict_SetItemString(d,str(mx_I) ,PyInt_FromLong(mx_I)); +PyDict_SetItemString(d,str(mx_I_f) ,PyInt_FromLong(mx_I_f)); +PyDict_SetItemString(d,str(mx_I_s) ,PyInt_FromLong(mx_I_s)); +PyDict_SetItemString(d,str(mx_I_o) ,PyInt_FromLong(mx_I_o)); +PyDict_SetItemString(d,str(bb_mx_f),PyInt_FromLong(bb_mx_f)); +PyDict_SetItemString(d,str(bb_mx_s),PyInt_FromLong(bb_mx_s)); +PyDict_SetItemString(d,str(bb_mx_o),PyInt_FromLong(bb_mx_o)); +PyDict_SetItemString(d,str(bb_mn_f),PyInt_FromLong(bb_mn_f)); +PyDict_SetItemString(d,str(bb_mn_s),PyInt_FromLong(bb_mn_s)); +PyDict_SetItemString(d,str(bb_mn_o),PyInt_FromLong(bb_mn_o)); + +PyDict_SetItemString(d,str(avg_i),PyInt_FromLong(avg_i)); +PyDict_SetItemString(d,str(f_raw),PyInt_FromLong(f_raw)); +PyDict_SetItemString(d,str(s_raw),PyInt_FromLong(s_raw)); +PyDict_SetItemString(d,str(f_cen),PyInt_FromLong(f_cen)); +PyDict_SetItemString(d,str(s_cen),PyInt_FromLong(s_cen)); +PyDict_SetItemString(d,str(o_raw),PyInt_FromLong(o_raw)); +PyDict_SetItemString(d,str(m_ff),PyInt_FromLong(m_ff)); +PyDict_SetItemString(d,str(m_ss),PyInt_FromLong(m_ss)); +PyDict_SetItemString(d,str(m_oo),PyInt_FromLong(m_oo)); +PyDict_SetItemString(d,str(m_sf),PyInt_FromLong(m_sf)); +PyDict_SetItemString(d,str(m_so),PyInt_FromLong(m_so)); +PyDict_SetItemString(d,str(m_fo),PyInt_FromLong(m_fo)); +PyDict_SetItemString(d,str(dety),PyInt_FromLong(dety)); +PyDict_SetItemString(d,str(detz),PyInt_FromLong(detz)); + +PyDict_SetItemString(d,str(NPROPERTY),PyInt_FromLong(NPROPERTY)); + +PyDict_SetItemString(d,str(s2D_1),PyInt_FromLong(s2D_1)); +PyDict_SetItemString(d,str(s2D_I),PyInt_FromLong(s2D_I)); +PyDict_SetItemString(d,str(s2D_fI),PyInt_FromLong(s2D_fI)); +PyDict_SetItemString(d,str(s2D_sI),PyInt_FromLong(s2D_sI)); +PyDict_SetItemString(d,str(s2D_ffI),PyInt_FromLong(s2D_ffI)); +PyDict_SetItemString(d,str(s2D_sfI),PyInt_FromLong(s2D_sfI)); +PyDict_SetItemString(d,str(s2D_ssI),PyInt_FromLong(s2D_ssI)); +PyDict_SetItemString(d,str(s2D_bb_mx_f),PyInt_FromLong(s2D_bb_mx_f)); +PyDict_SetItemString(d,str(s2D_bb_mx_s),PyInt_FromLong(s2D_bb_mx_s)); +PyDict_SetItemString(d,str(s2D_bb_mn_f),PyInt_FromLong(s2D_bb_mn_f)); +PyDict_SetItemString(d,str(s2D_bb_mn_s),PyInt_FromLong(s2D_bb_mn_s)); +PyDict_SetItemString(d,str(NPROPERTY2D),PyInt_FromLong(NPROPERTY2D)); +/* ends user code */ + + /* end multiline (0)*/ + +#ifdef F2PY_REPORT_ATEXIT + if (! PyErr_Occurred()) + on_exit(f2py_report_on_exit,(void*)"_cImageD11"); +#endif + return m; +} +#ifdef __cplusplus +} +#endif diff --git a/test.txt b/test.txt new file mode 100644 index 00000000..e69de29b From 9a741ec13b5a8afdb0a449c334f654ee2983a123 Mon Sep 17 00:00:00 2001 From: Loic Jegou Date: Mon, 13 Jan 2025 15:40:40 +0100 Subject: [PATCH 2/4] Adding cache=True to speed up tensorMap imports --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test.txt diff --git a/test.txt b/test.txt deleted file mode 100644 index e69de29b..00000000 From c335f411f0f723c4fac6722e60991d66facd956a Mon Sep 17 00:00:00 2001 From: Loic Jegou Date: Tue, 14 Jan 2025 08:59:37 +0100 Subject: [PATCH 3/4] Removing _cImageD11 files and adding cache=True in point_by_point.py --- _cImageD11-f2pywrappers.f | 0 _cImageD11-f2pywrappers2.f90 | 0 _cImageD11module.c | 9595 ---------------------------------- 3 files changed, 9595 deletions(-) delete mode 100644 _cImageD11-f2pywrappers.f delete mode 100644 _cImageD11-f2pywrappers2.f90 delete mode 100644 _cImageD11module.c diff --git a/_cImageD11-f2pywrappers.f b/_cImageD11-f2pywrappers.f deleted file mode 100644 index e69de29b..00000000 diff --git a/_cImageD11-f2pywrappers2.f90 b/_cImageD11-f2pywrappers2.f90 deleted file mode 100644 index e69de29b..00000000 diff --git a/_cImageD11module.c b/_cImageD11module.c deleted file mode 100644 index 95e95c44..00000000 --- a/_cImageD11module.c +++ /dev/null @@ -1,9595 +0,0 @@ -/* File: _cImageD11module.c - * This file is auto-generated with f2py (version:1.24.4). - * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition, - * written by Pearu Peterson . - * Generation date: Thu Jan 9 17:38:03 2025 - * Do not edit this file directly unless you know what you are doing!!! - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PY_SSIZE_T_CLEAN -#define PY_SSIZE_T_CLEAN -#endif /* PY_SSIZE_T_CLEAN */ - -/* Unconditionally included */ -#include -#include - -/*********************** See f2py2e/cfuncs.py: includes ***********************/ -#include "fortranobject.h" -#include - -/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/ -static PyObject *_cImageD11_error; -static PyObject *_cImageD11_module; - -/*********************** See f2py2e/cfuncs.py: typedefs ***********************/ -typedef unsigned short unsigned_short; -typedef unsigned char unsigned_char; -typedef signed char signed_char; -#if defined(NPY_OS_WIN32) -typedef __int64 long_long; -#else -typedef long long long_long; -typedef unsigned long long unsigned_long_long; -#endif - - -/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/ -/*need_typedefs_generated*/ - -/********************** See f2py2e/cfuncs.py: cppmacros **********************/ -/* See fortranobject.h for definitions. The macros here are provided for BC. */ -#define rank f2py_rank -#define shape f2py_shape -#define fshape f2py_shape -#define len f2py_len -#define flen f2py_flen -#define slen f2py_slen -#define size f2py_size - -#define CHECKSCALAR(check,tcheck,name,show,var)\ - if (!(check)) {\ - char errstring[256];\ - sprintf(errstring, "%s: "show, "("tcheck") failed for "name, var);\ - PyErr_SetString(_cImageD11_error,errstring);\ - /*goto capi_fail;*/\ - } else -#ifdef DEBUGCFUNCS -#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess); -#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \ - PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\ - fprintf(stderr,"\n"); -#else -#define CFUNCSMESS(mess) -#define CFUNCSMESSPY(mess,obj) -#endif - -#ifndef max -#define max(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef min -#define min(a,b) ((a < b) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a > b) ? (a) : (b)) -#endif -#ifndef MIN -#define MIN(a,b) ((a < b) ? (a) : (b)) -#endif - -#if defined(PREPEND_FORTRAN) -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F -#else -#define F_FUNC(f,F) _##f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) _##F##_ -#else -#define F_FUNC(f,F) _##f##_ -#endif -#endif -#else -#if defined(NO_APPEND_FORTRAN) -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F -#else -#define F_FUNC(f,F) f -#endif -#else -#if defined(UPPERCASE_FORTRAN) -#define F_FUNC(f,F) F##_ -#else -#define F_FUNC(f,F) f##_ -#endif -#endif -#endif -#if defined(UNDERSCORE_G77) -#define F_FUNC_US(f,F) F_FUNC(f##_,F##_) -#else -#define F_FUNC_US(f,F) F_FUNC(f,F) -#endif - -#define CHECKARRAY(check,tcheck,name) \ - if (!(check)) {\ - PyErr_SetString(_cImageD11_error,"("tcheck") failed for "name);\ - /*goto capi_fail;*/\ - } else - -/************************ See f2py2e/cfuncs.py: cfuncs ************************/ -static int -double_from_pyobj(double* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - if (PyFloat_Check(obj)) { - *v = PyFloat_AsDouble(obj); - return !(*v == -1.0 && PyErr_Occurred()); - } - - tmp = PyNumber_Float(obj); - if (tmp) { - *v = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - return !(*v == -1.0 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (double_from_pyobj(v,tmp,errmess)) {Py_DECREF(tmp); return 1;} - Py_DECREF(tmp); - } - { - PyObject* err = PyErr_Occurred(); - if (err==NULL) err = _cImageD11_error; - PyErr_SetString(err,errmess); - } - return 0; -} - -static int -int_from_pyobj(int* v, PyObject *obj, const char *errmess) -{ - PyObject* tmp = NULL; - - if (PyLong_Check(obj)) { - *v = Npy__PyLong_AsInt(obj); - return !(*v == -1 && PyErr_Occurred()); - } - - tmp = PyNumber_Long(obj); - if (tmp) { - *v = Npy__PyLong_AsInt(tmp); - Py_DECREF(tmp); - return !(*v == -1 && PyErr_Occurred()); - } - - if (PyComplex_Check(obj)) { - PyErr_Clear(); - tmp = PyObject_GetAttrString(obj,"real"); - } - else if (PyBytes_Check(obj) || PyUnicode_Check(obj)) { - /*pass*/; - } - else if (PySequence_Check(obj)) { - PyErr_Clear(); - tmp = PySequence_GetItem(obj, 0); - } - - if (tmp) { - if (int_from_pyobj(v, tmp, errmess)) { - Py_DECREF(tmp); - return 1; - } - Py_DECREF(tmp); - } - - { - PyObject* err = PyErr_Occurred(); - if (err == NULL) { - err = _cImageD11_error; - } - PyErr_SetString(err, errmess); - } - return 0; -} - -static int -float_from_pyobj(float* v, PyObject *obj, const char *errmess) -{ - double d=0.0; - if (double_from_pyobj(&d,obj,errmess)) { - *v = (float)d; - return 1; - } - return 0; -} - - -/********************* See f2py2e/cfuncs.py: userincludes *********************/ -/*need_userincludes*/ - -/********************* See f2py2e/capi_rules.py: usercode *********************/ - /* start usercode multiline (0) */ - -#include "blobs.h" - - /* end multiline (0)*/ - -/* See f2py2e/rules.py */ -extern void compute_geometry(double*,double*,double,double,double,double,double*,double*,int); -extern void compute_gv(double*,double*,double,double,double,double,double*,double*,int); -extern void compute_xlylzl(double*,double*,double*,double*,double*,double*,int); -extern void quickorient(double*,double*); -extern void cimaged11_omp_set_num_threads(int); -extern int cimaged11_omp_get_max_threads(void); -extern void uint16_to_float_darksub(float*,float*,unsigned_short*,int); -extern void uint16_to_float_darkflm(float*,float*,float*,unsigned_short*,int); -extern void frelon_lines(float*,int,int,float); -extern void frelon_lines_sub(float*,float*,int,int,float); -extern void array_mean_var_cut(float*,int,float*,float*,int,float,int); -extern void array_mean_var_msk(float*,unsigned_char*,int,float*,float*,int,float,int); -extern void array_stats(float*,int,float*,float*,float*,float*); -extern void array_histogram(float*,int,float,float,int*,int); -extern void reorder_u16_a32(unsigned_short*,int*,unsigned_short*,int); -extern void reorder_f32_a32(float*,int*,float*,int); -extern void reorderlut_u16_a32(unsigned_short*,int*,unsigned_short*,int); -extern void reorderlut_f32_a32(float*,int*,float*,int); -extern void reorder_u16_a32_a16(unsigned_short*,int*,short*,unsigned_short*,int,int); -extern void bgcalc(float*,float*,signed_char*,int,int,float,float,float); -extern int verify_rounding(int); -extern void closest_vec(double*,int,int,int*); -extern void closest(double*,double*,int*,double*,int,int); -extern int score(double*,double*,double,int); -extern void score_and_refine(double*,double*,double,int*,double*,int); -extern int score_and_assign(double*,double*,double,double*,int*,int,int); -extern void refine_assigned(double*,double*,int*,int,int*,double*,int); -extern void put_incr64(float*,long_long*,float*,int,int,int); -extern void put_incr32(float*,int*,float*,int,int,int); -extern void cluster1d(double*,int,int*,double,int*,int*,double*); -extern void score_gvec_z(double*,double*,double*,double*,double*,double*,double*,int,int); -extern double misori_cubic(double*,double*); -extern double misori_orthorhombic(double*,double*); -extern double misori_tetragonal(double*,double*); -extern double misori_monoclinic(double*,double*); -extern void misori_cubic_pairs(double*,double*,int); -extern int count_shared(int*,int,int*,int); -extern int connectedpixels(float*,int*,float,int,int,int,int); -extern void blobproperties(float*,int*,int,float,int,int,int,double*); -extern int bloboverlaps(int*,int,double*,int*,int,double*,int,int,int); -extern void blob_moments(double*,int); -extern int clean_mask(signed_char*,signed_char*,int,int); -extern int make_clean_mask(float*,float,signed_char*,signed_char*,int,int); -extern int localmaxlabel(float*,int*,signed_char*,int,int); -extern int mask_to_coo(signed_char*,int,int,unsigned_short*,unsigned_short*,int,int*); -extern int sparse_is_sorted(unsigned_short*,unsigned_short*,int); -extern int sparse_connectedpixels(float*,unsigned_short*,unsigned_short*,int,float,int*); -extern int sparse_connectedpixels_splat(float*,unsigned_short*,unsigned_short*,int,float,int*,int*,int,int); -extern void sparse_blob2Dproperties(float*,unsigned_short*,unsigned_short*,int,int*,double*,int); -extern void sparse_smooth(float*,unsigned_short*,unsigned_short*,int,float*); -extern int sparse_localmaxlabel(float*,unsigned_short*,unsigned_short*,int,float*,int*,int*); -extern int sparse_overlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int); -extern int compress_duplicates(int*,int*,int*,int*,int*,int,int); -extern int coverlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int,int*,int,int,int*); -extern int tosparse_u16(unsigned_short*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned_short*,int,int,int); -extern int tosparse_u32(unsigned*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned*,float,int,int); -extern int tosparse_f32(float*,unsigned_char*,unsigned_short*,unsigned_short*,float*,float,int,int); -extern void splat(unsigned_char*,int,int,double*,int,double*,int); -/*eof externroutines*/ - -/******************** See f2py2e/capi_rules.py: usercode1 ********************/ - - -/******************* See f2py2e/cb_rules.py: buildcallback *******************/ -/*need_callbacks*/ - -/*********************** See f2py2e/rules.py: buildapi ***********************/ - -/****************************** compute_geometry ******************************/ -static char doc_f2py_rout__cImageD11_compute_geometry[] = "\ -compute_geometry(xlylzl,omega,omegasign,wvln,wedge,chi,t,out)\n\nWrapper for ``compute_geometry``.\ -\n\nParameters\n----------\n" -"xlylzl : input rank-2 array('d') with bounds (ng,3)\n" -"omega : input rank-1 array('d') with bounds (ng)\n" -"omegasign : input float\n" -"wvln : input float\n" -"wedge : input float\n" -"chi : input float\n" -"t : input rank-1 array('d') with bounds (3)\n" -"out : in/output rank-2 array('d') with bounds (ng,6)"; -/* extern void compute_geometry(double*,double*,double,double,double,double,double*,double*,int); */ -static PyObject *f2py_rout__cImageD11_compute_geometry(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double,double,double,double,double*,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *xlylzl = NULL; - npy_intp xlylzl_Dims[2] = {-1, -1}; - const int xlylzl_Rank = 2; - PyArrayObject *capi_xlylzl_as_array = NULL; - int capi_xlylzl_intent = 0; - PyObject *xlylzl_capi = Py_None; - double *omega = NULL; - npy_intp omega_Dims[1] = {-1}; - const int omega_Rank = 1; - PyArrayObject *capi_omega_as_array = NULL; - int capi_omega_intent = 0; - PyObject *omega_capi = Py_None; - double omegasign = 0; - PyObject *omegasign_capi = Py_None; - double wvln = 0; - PyObject *wvln_capi = Py_None; - double wedge = 0; - PyObject *wedge_capi = Py_None; - double chi = 0; - PyObject *chi_capi = Py_None; - double *t = NULL; - npy_intp t_Dims[1] = {-1}; - const int t_Rank = 1; - PyArrayObject *capi_t_as_array = NULL; - int capi_t_intent = 0; - PyObject *t_capi = Py_None; - double *out = NULL; - npy_intp out_Dims[2] = {-1, -1}; - const int out_Rank = 2; - PyArrayObject *capi_out_as_array = NULL; - int capi_out_intent = 0; - PyObject *out_capi = Py_None; - int ng = 0; - static char *capi_kwlist[] = {"xlylzl","omega","omegasign","wvln","wedge","chi","t","out",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|:_cImageD11.compute_geometry",\ - capi_kwlist,&xlylzl_capi,&omega_capi,&omegasign_capi,&wvln_capi,&wedge_capi,&chi_capi,&t_capi,&out_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable xlylzl */ - xlylzl_Dims[1]=3; - capi_xlylzl_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 1st argument `xlylzl`"; - capi_xlylzl_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xlylzl_Dims,xlylzl_Rank, capi_xlylzl_intent,xlylzl_capi,capi_errmess); - if (capi_xlylzl_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xlylzl = (double *)(PyArray_DATA(capi_xlylzl_as_array)); - - /* Processing variable omegasign */ - f2py_success = double_from_pyobj(&omegasign,omegasign_capi,"_cImageD11.compute_geometry() 3rd argument (omegasign) can't be converted to double"); - if (f2py_success) { - /* Processing variable wvln */ - f2py_success = double_from_pyobj(&wvln,wvln_capi,"_cImageD11.compute_geometry() 4th argument (wvln) can't be converted to double"); - if (f2py_success) { - /* Processing variable wedge */ - f2py_success = double_from_pyobj(&wedge,wedge_capi,"_cImageD11.compute_geometry() 5th argument (wedge) can't be converted to double"); - if (f2py_success) { - /* Processing variable chi */ - f2py_success = double_from_pyobj(&chi,chi_capi,"_cImageD11.compute_geometry() 6th argument (chi) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - t_Dims[0]=3; - capi_t_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 7th argument `t`"; - capi_t_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,t_Dims,t_Rank, capi_t_intent,t_capi,capi_errmess); - if (capi_t_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - t = (double *)(PyArray_DATA(capi_t_as_array)); - - /* Processing variable ng */ - ng = shape(xlylzl, 0); - CHECKSCALAR(shape(xlylzl, 0) == ng,"shape(xlylzl, 0) == ng","hidden ng","compute_geometry:ng=%d",ng) { - /* Processing variable omega */ - omega_Dims[0]=ng; - capi_omega_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 2nd argument `omega`"; - capi_omega_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,omega_Dims,omega_Rank, capi_omega_intent,omega_capi,capi_errmess); - if (capi_omega_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - omega = (double *)(PyArray_DATA(capi_omega_as_array)); - - /* Processing variable out */ - out_Dims[0]=ng,out_Dims[1]=6; - capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_geometry: failed to create array from the 8th argument `out`"; - capi_out_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); - if (capi_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - out = (double *)(PyArray_DATA(capi_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(xlylzl,omega,omegasign,wvln,wedge,chi,t,out,ng); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_out_as_array!=out_capi) { - Py_XDECREF(capi_out_as_array); } - } /* if (capi_out_as_array == NULL) ... else of out */ - /* End of cleaning variable out */ - if((PyObject *)capi_omega_as_array!=omega_capi) { - Py_XDECREF(capi_omega_as_array); } - } /* if (capi_omega_as_array == NULL) ... else of omega */ - /* End of cleaning variable omega */ - } /*CHECKSCALAR(shape(xlylzl, 0) == ng)*/ - /* End of cleaning variable ng */ - if((PyObject *)capi_t_as_array!=t_capi) { - Py_XDECREF(capi_t_as_array); } - } /* if (capi_t_as_array == NULL) ... else of t */ - /* End of cleaning variable t */ - } /*if (f2py_success) of chi*/ - /* End of cleaning variable chi */ - } /*if (f2py_success) of wedge*/ - /* End of cleaning variable wedge */ - } /*if (f2py_success) of wvln*/ - /* End of cleaning variable wvln */ - } /*if (f2py_success) of omegasign*/ - /* End of cleaning variable omegasign */ - if((PyObject *)capi_xlylzl_as_array!=xlylzl_capi) { - Py_XDECREF(capi_xlylzl_as_array); } - } /* if (capi_xlylzl_as_array == NULL) ... else of xlylzl */ - /* End of cleaning variable xlylzl */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of compute_geometry **************************/ - -/********************************* compute_gv *********************************/ -static char doc_f2py_rout__cImageD11_compute_gv[] = "\ -compute_gv(xlylzl,omega,omegasign,wvln,wedge,chi,t,gv)\n\nWrapper for ``compute_gv``.\ -\n\nParameters\n----------\n" -"xlylzl : input rank-2 array('d') with bounds (ng,3)\n" -"omega : input rank-1 array('d') with bounds (ng)\n" -"omegasign : input float\n" -"wvln : input float\n" -"wedge : input float\n" -"chi : input float\n" -"t : input rank-1 array('d') with bounds (3)\n" -"gv : in/output rank-2 array('d') with bounds (ng,3)"; -/* extern void compute_gv(double*,double*,double,double,double,double,double*,double*,int); */ -static PyObject *f2py_rout__cImageD11_compute_gv(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double,double,double,double,double*,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *xlylzl = NULL; - npy_intp xlylzl_Dims[2] = {-1, -1}; - const int xlylzl_Rank = 2; - PyArrayObject *capi_xlylzl_as_array = NULL; - int capi_xlylzl_intent = 0; - PyObject *xlylzl_capi = Py_None; - double *omega = NULL; - npy_intp omega_Dims[1] = {-1}; - const int omega_Rank = 1; - PyArrayObject *capi_omega_as_array = NULL; - int capi_omega_intent = 0; - PyObject *omega_capi = Py_None; - double omegasign = 0; - PyObject *omegasign_capi = Py_None; - double wvln = 0; - PyObject *wvln_capi = Py_None; - double wedge = 0; - PyObject *wedge_capi = Py_None; - double chi = 0; - PyObject *chi_capi = Py_None; - double *t = NULL; - npy_intp t_Dims[1] = {-1}; - const int t_Rank = 1; - PyArrayObject *capi_t_as_array = NULL; - int capi_t_intent = 0; - PyObject *t_capi = Py_None; - double *gv = NULL; - npy_intp gv_Dims[2] = {-1, -1}; - const int gv_Rank = 2; - PyArrayObject *capi_gv_as_array = NULL; - int capi_gv_intent = 0; - PyObject *gv_capi = Py_None; - int ng = 0; - static char *capi_kwlist[] = {"xlylzl","omega","omegasign","wvln","wedge","chi","t","gv",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|:_cImageD11.compute_gv",\ - capi_kwlist,&xlylzl_capi,&omega_capi,&omegasign_capi,&wvln_capi,&wedge_capi,&chi_capi,&t_capi,&gv_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable xlylzl */ - xlylzl_Dims[1]=3; - capi_xlylzl_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 1st argument `xlylzl`"; - capi_xlylzl_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xlylzl_Dims,xlylzl_Rank, capi_xlylzl_intent,xlylzl_capi,capi_errmess); - if (capi_xlylzl_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xlylzl = (double *)(PyArray_DATA(capi_xlylzl_as_array)); - - /* Processing variable omegasign */ - f2py_success = double_from_pyobj(&omegasign,omegasign_capi,"_cImageD11.compute_gv() 3rd argument (omegasign) can't be converted to double"); - if (f2py_success) { - /* Processing variable wvln */ - f2py_success = double_from_pyobj(&wvln,wvln_capi,"_cImageD11.compute_gv() 4th argument (wvln) can't be converted to double"); - if (f2py_success) { - /* Processing variable wedge */ - f2py_success = double_from_pyobj(&wedge,wedge_capi,"_cImageD11.compute_gv() 5th argument (wedge) can't be converted to double"); - if (f2py_success) { - /* Processing variable chi */ - f2py_success = double_from_pyobj(&chi,chi_capi,"_cImageD11.compute_gv() 6th argument (chi) can't be converted to double"); - if (f2py_success) { - /* Processing variable t */ - t_Dims[0]=3; - capi_t_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 7th argument `t`"; - capi_t_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,t_Dims,t_Rank, capi_t_intent,t_capi,capi_errmess); - if (capi_t_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - t = (double *)(PyArray_DATA(capi_t_as_array)); - - /* Processing variable ng */ - ng = shape(xlylzl, 0); - CHECKSCALAR(shape(xlylzl, 0) == ng,"shape(xlylzl, 0) == ng","hidden ng","compute_gv:ng=%d",ng) { - /* Processing variable omega */ - omega_Dims[0]=ng; - capi_omega_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 2nd argument `omega`"; - capi_omega_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,omega_Dims,omega_Rank, capi_omega_intent,omega_capi,capi_errmess); - if (capi_omega_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - omega = (double *)(PyArray_DATA(capi_omega_as_array)); - - /* Processing variable gv */ - gv_Dims[0]=ng,gv_Dims[1]=3; - capi_gv_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_gv: failed to create array from the 8th argument `gv`"; - capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); - if (capi_gv_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gv = (double *)(PyArray_DATA(capi_gv_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(xlylzl,omega,omegasign,wvln,wedge,chi,t,gv,ng); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_gv_as_array!=gv_capi) { - Py_XDECREF(capi_gv_as_array); } - } /* if (capi_gv_as_array == NULL) ... else of gv */ - /* End of cleaning variable gv */ - if((PyObject *)capi_omega_as_array!=omega_capi) { - Py_XDECREF(capi_omega_as_array); } - } /* if (capi_omega_as_array == NULL) ... else of omega */ - /* End of cleaning variable omega */ - } /*CHECKSCALAR(shape(xlylzl, 0) == ng)*/ - /* End of cleaning variable ng */ - if((PyObject *)capi_t_as_array!=t_capi) { - Py_XDECREF(capi_t_as_array); } - } /* if (capi_t_as_array == NULL) ... else of t */ - /* End of cleaning variable t */ - } /*if (f2py_success) of chi*/ - /* End of cleaning variable chi */ - } /*if (f2py_success) of wedge*/ - /* End of cleaning variable wedge */ - } /*if (f2py_success) of wvln*/ - /* End of cleaning variable wvln */ - } /*if (f2py_success) of omegasign*/ - /* End of cleaning variable omegasign */ - if((PyObject *)capi_xlylzl_as_array!=xlylzl_capi) { - Py_XDECREF(capi_xlylzl_as_array); } - } /* if (capi_xlylzl_as_array == NULL) ... else of xlylzl */ - /* End of cleaning variable xlylzl */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of compute_gv *****************************/ - -/******************************* compute_xlylzl *******************************/ -static char doc_f2py_rout__cImageD11_compute_xlylzl[] = "\ -compute_xlylzl(s,f,p,r,dist,xlylzl)\n\nWrapper for ``compute_xlylzl``.\ -\n\nParameters\n----------\n" -"s : input rank-1 array('d') with bounds (n)\n" -"f : input rank-1 array('d') with bounds (n)\n" -"p : input rank-1 array('d') with bounds (4)\n" -"r : input rank-1 array('d') with bounds (9)\n" -"dist : input rank-1 array('d') with bounds (3)\n" -"xlylzl : in/output rank-2 array('d') with bounds (n,3)"; -/* extern void compute_xlylzl(double*,double*,double*,double*,double*,double*,int); */ -static PyObject *f2py_rout__cImageD11_compute_xlylzl(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *s = NULL; - npy_intp s_Dims[1] = {-1}; - const int s_Rank = 1; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - double *f = NULL; - npy_intp f_Dims[1] = {-1}; - const int f_Rank = 1; - PyArrayObject *capi_f_as_array = NULL; - int capi_f_intent = 0; - PyObject *f_capi = Py_None; - double *p = NULL; - npy_intp p_Dims[1] = {-1}; - const int p_Rank = 1; - PyArrayObject *capi_p_as_array = NULL; - int capi_p_intent = 0; - PyObject *p_capi = Py_None; - double *r = NULL; - npy_intp r_Dims[1] = {-1}; - const int r_Rank = 1; - PyArrayObject *capi_r_as_array = NULL; - int capi_r_intent = 0; - PyObject *r_capi = Py_None; - double *dist = NULL; - npy_intp dist_Dims[1] = {-1}; - const int dist_Rank = 1; - PyArrayObject *capi_dist_as_array = NULL; - int capi_dist_intent = 0; - PyObject *dist_capi = Py_None; - double *xlylzl = NULL; - npy_intp xlylzl_Dims[2] = {-1, -1}; - const int xlylzl_Rank = 2; - PyArrayObject *capi_xlylzl_as_array = NULL; - int capi_xlylzl_intent = 0; - PyObject *xlylzl_capi = Py_None; - int n = 0; - static char *capi_kwlist[] = {"s","f","p","r","dist","xlylzl",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.compute_xlylzl",\ - capi_kwlist,&s_capi,&f_capi,&p_capi,&r_capi,&dist_capi,&xlylzl_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable s */ - ; - capi_s_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 1st argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (double *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable p */ - p_Dims[0]=4; - capi_p_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 3rd argument `p`"; - capi_p_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,p_Dims,p_Rank, capi_p_intent,p_capi,capi_errmess); - if (capi_p_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - p = (double *)(PyArray_DATA(capi_p_as_array)); - - /* Processing variable r */ - r_Dims[0]=9; - capi_r_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 4th argument `r`"; - capi_r_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,r_Dims,r_Rank, capi_r_intent,r_capi,capi_errmess); - if (capi_r_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - r = (double *)(PyArray_DATA(capi_r_as_array)); - - /* Processing variable dist */ - dist_Dims[0]=3; - capi_dist_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 5th argument `dist`"; - capi_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dist_Dims,dist_Rank, capi_dist_intent,dist_capi,capi_errmess); - if (capi_dist_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dist = (double *)(PyArray_DATA(capi_dist_as_array)); - - /* Processing variable n */ - n = shape(s, 0); - CHECKSCALAR(shape(s, 0) == n,"shape(s, 0) == n","hidden n","compute_xlylzl:n=%d",n) { - /* Processing variable f */ - f_Dims[0]=n; - capi_f_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 2nd argument `f`"; - capi_f_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,f_Dims,f_Rank, capi_f_intent,f_capi,capi_errmess); - if (capi_f_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - f = (double *)(PyArray_DATA(capi_f_as_array)); - - /* Processing variable xlylzl */ - xlylzl_Dims[0]=n,xlylzl_Dims[1]=3; - capi_xlylzl_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compute_xlylzl: failed to create array from the 6th argument `xlylzl`"; - capi_xlylzl_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,xlylzl_Dims,xlylzl_Rank, capi_xlylzl_intent,xlylzl_capi,capi_errmess); - if (capi_xlylzl_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - xlylzl = (double *)(PyArray_DATA(capi_xlylzl_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(s,f,p,r,dist,xlylzl,n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_xlylzl_as_array!=xlylzl_capi) { - Py_XDECREF(capi_xlylzl_as_array); } - } /* if (capi_xlylzl_as_array == NULL) ... else of xlylzl */ - /* End of cleaning variable xlylzl */ - if((PyObject *)capi_f_as_array!=f_capi) { - Py_XDECREF(capi_f_as_array); } - } /* if (capi_f_as_array == NULL) ... else of f */ - /* End of cleaning variable f */ - } /*CHECKSCALAR(shape(s, 0) == n)*/ - /* End of cleaning variable n */ - if((PyObject *)capi_dist_as_array!=dist_capi) { - Py_XDECREF(capi_dist_as_array); } - } /* if (capi_dist_as_array == NULL) ... else of dist */ - /* End of cleaning variable dist */ - if((PyObject *)capi_r_as_array!=r_capi) { - Py_XDECREF(capi_r_as_array); } - } /* if (capi_r_as_array == NULL) ... else of r */ - /* End of cleaning variable r */ - if((PyObject *)capi_p_as_array!=p_capi) { - Py_XDECREF(capi_p_as_array); } - } /* if (capi_p_as_array == NULL) ... else of p */ - /* End of cleaning variable p */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of compute_xlylzl ***************************/ - -/******************************** quickorient ********************************/ -static char doc_f2py_rout__cImageD11_quickorient[] = "\ -quickorient(ubi,bt)\n\nWrapper for ``quickorient``.\ -\n\nParameters\n----------\n" -"ubi : in/output rank-2 array('d') with bounds (3,3)\n" -"bt : input rank-2 array('d') with bounds (3,3)"; -/* extern void quickorient(double*,double*); */ -static PyObject *f2py_rout__cImageD11_quickorient(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ubi = NULL; - npy_intp ubi_Dims[2] = {-1, -1}; - const int ubi_Rank = 2; - PyArrayObject *capi_ubi_as_array = NULL; - int capi_ubi_intent = 0; - PyObject *ubi_capi = Py_None; - double *bt = NULL; - npy_intp bt_Dims[2] = {-1, -1}; - const int bt_Rank = 2; - PyArrayObject *capi_bt_as_array = NULL; - int capi_bt_intent = 0; - PyObject *bt_capi = Py_None; - static char *capi_kwlist[] = {"ubi","bt",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.quickorient",\ - capi_kwlist,&ubi_capi,&bt_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ubi */ - ubi_Dims[0]=3,ubi_Dims[1]=3; - capi_ubi_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.quickorient: failed to create array from the 1st argument `ubi`"; - capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); - if (capi_ubi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); - - /* Processing variable bt */ - bt_Dims[0]=3,bt_Dims[1]=3; - capi_bt_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.quickorient: failed to create array from the 2nd argument `bt`"; - capi_bt_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,bt_Dims,bt_Rank, capi_bt_intent,bt_capi,capi_errmess); - if (capi_bt_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bt = (double *)(PyArray_DATA(capi_bt_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ubi,bt); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_bt_as_array!=bt_capi) { - Py_XDECREF(capi_bt_as_array); } - } /* if (capi_bt_as_array == NULL) ... else of bt */ - /* End of cleaning variable bt */ - if((PyObject *)capi_ubi_as_array!=ubi_capi) { - Py_XDECREF(capi_ubi_as_array); } - } /* if (capi_ubi_as_array == NULL) ... else of ubi */ - /* End of cleaning variable ubi */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of quickorient *****************************/ - -/*********************** cimaged11_omp_set_num_threads ***********************/ -static char doc_f2py_rout__cImageD11_cimaged11_omp_set_num_threads[] = "\ -cimaged11_omp_set_num_threads(n)\n\nWrapper for ``cimaged11_omp_set_num_threads``.\ -\n\nParameters\n----------\n" -"n : input int"; -/* extern void cimaged11_omp_set_num_threads(int); */ -static PyObject *f2py_rout__cImageD11_cimaged11_omp_set_num_threads(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int n = 0; - PyObject *n_capi = Py_None; - static char *capi_kwlist[] = {"n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:_cImageD11.cimaged11_omp_set_num_threads",\ - capi_kwlist,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable n */ - f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.cimaged11_omp_set_num_threads() 1st argument (n) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************** end of cimaged11_omp_set_num_threads ********************/ - -/*********************** cimaged11_omp_get_max_threads ***********************/ -static char doc_f2py_rout__cImageD11_cimaged11_omp_get_max_threads[] = "\ -cimaged11_omp_get_max_threads = cimaged11_omp_get_max_threads()\n\nWrapper for ``cimaged11_omp_get_max_threads``.\ -\n\nReturns\n-------\n" -"cimaged11_omp_get_max_threads : int"; -/* extern int cimaged11_omp_get_max_threads(void); */ -static PyObject *f2py_rout__cImageD11_cimaged11_omp_get_max_threads(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(void)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int cimaged11_omp_get_max_threads_return_value=0; - static char *capi_kwlist[] = {NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "|:_cImageD11.cimaged11_omp_get_max_threads",\ - capi_kwlist)) - return NULL; -/*frompyobj*/ -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - cimaged11_omp_get_max_threads_return_value = (*f2py_func)(); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",cimaged11_omp_get_max_threads_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************** end of cimaged11_omp_get_max_threads ********************/ - -/************************** uint16_to_float_darksub **************************/ -static char doc_f2py_rout__cImageD11_uint16_to_float_darksub[] = "\ -uint16_to_float_darksub(img,drk,data)\n\nWrapper for ``uint16_to_float_darksub``.\ -\n\nParameters\n----------\n" -"img : in/output rank-1 array('f') with bounds (npx)\n" -"drk : input rank-1 array('f') with bounds (npx)\n" -"data : input rank-1 array('H') with bounds (npx)"; -/* extern void uint16_to_float_darksub(float*,float*,unsigned_short*,int); */ -static PyObject *f2py_rout__cImageD11_uint16_to_float_darksub(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,float*,unsigned_short*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[1] = {-1}; - const int img_Rank = 1; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - float *drk = NULL; - npy_intp drk_Dims[1] = {-1}; - const int drk_Rank = 1; - PyArrayObject *capi_drk_as_array = NULL; - int capi_drk_intent = 0; - PyObject *drk_capi = Py_None; - unsigned_short *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int npx = 0; - static char *capi_kwlist[] = {"img","drk","data",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.uint16_to_float_darksub",\ - capi_kwlist,&img_capi,&drk_capi,&data_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darksub: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable npx */ - npx = shape(img, 0); - CHECKSCALAR(shape(img, 0) == npx,"shape(img, 0) == npx","hidden npx","uint16_to_float_darksub:npx=%d",npx) { - /* Processing variable drk */ - drk_Dims[0]=npx; - capi_drk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darksub: failed to create array from the 2nd argument `drk`"; - capi_drk_as_array = ndarray_from_pyobj( NPY_FLOAT,1,drk_Dims,drk_Rank, capi_drk_intent,drk_capi,capi_errmess); - if (capi_drk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - drk = (float *)(PyArray_DATA(capi_drk_as_array)); - - /* Processing variable data */ - data_Dims[0]=npx; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darksub: failed to create array from the 3rd argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(img,drk,data,npx); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ - if((PyObject *)capi_drk_as_array!=drk_capi) { - Py_XDECREF(capi_drk_as_array); } - } /* if (capi_drk_as_array == NULL) ... else of drk */ - /* End of cleaning variable drk */ - } /*CHECKSCALAR(shape(img, 0) == npx)*/ - /* End of cleaning variable npx */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of uint16_to_float_darksub ***********************/ - -/************************** uint16_to_float_darkflm **************************/ -static char doc_f2py_rout__cImageD11_uint16_to_float_darkflm[] = "\ -uint16_to_float_darkflm(img,drk,flm,data)\n\nWrapper for ``uint16_to_float_darkflm``.\ -\n\nParameters\n----------\n" -"img : in/output rank-1 array('f') with bounds (npx)\n" -"drk : input rank-1 array('f') with bounds (npx)\n" -"flm : input rank-1 array('f') with bounds (npx)\n" -"data : input rank-1 array('H') with bounds (npx)"; -/* extern void uint16_to_float_darkflm(float*,float*,float*,unsigned_short*,int); */ -static PyObject *f2py_rout__cImageD11_uint16_to_float_darkflm(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,float*,float*,unsigned_short*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[1] = {-1}; - const int img_Rank = 1; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - float *drk = NULL; - npy_intp drk_Dims[1] = {-1}; - const int drk_Rank = 1; - PyArrayObject *capi_drk_as_array = NULL; - int capi_drk_intent = 0; - PyObject *drk_capi = Py_None; - float *flm = NULL; - npy_intp flm_Dims[1] = {-1}; - const int flm_Rank = 1; - PyArrayObject *capi_flm_as_array = NULL; - int capi_flm_intent = 0; - PyObject *flm_capi = Py_None; - unsigned_short *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int npx = 0; - static char *capi_kwlist[] = {"img","drk","flm","data",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.uint16_to_float_darkflm",\ - capi_kwlist,&img_capi,&drk_capi,&flm_capi,&data_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable npx */ - npx = shape(img, 0); - CHECKSCALAR(shape(img, 0) == npx,"shape(img, 0) == npx","hidden npx","uint16_to_float_darkflm:npx=%d",npx) { - /* Processing variable drk */ - drk_Dims[0]=npx; - capi_drk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 2nd argument `drk`"; - capi_drk_as_array = ndarray_from_pyobj( NPY_FLOAT,1,drk_Dims,drk_Rank, capi_drk_intent,drk_capi,capi_errmess); - if (capi_drk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - drk = (float *)(PyArray_DATA(capi_drk_as_array)); - - /* Processing variable flm */ - flm_Dims[0]=npx; - capi_flm_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 3rd argument `flm`"; - capi_flm_as_array = ndarray_from_pyobj( NPY_FLOAT,1,flm_Dims,flm_Rank, capi_flm_intent,flm_capi,capi_errmess); - if (capi_flm_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - flm = (float *)(PyArray_DATA(capi_flm_as_array)); - - /* Processing variable data */ - data_Dims[0]=npx; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.uint16_to_float_darkflm: failed to create array from the 4th argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(img,drk,flm,data,npx); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ - if((PyObject *)capi_flm_as_array!=flm_capi) { - Py_XDECREF(capi_flm_as_array); } - } /* if (capi_flm_as_array == NULL) ... else of flm */ - /* End of cleaning variable flm */ - if((PyObject *)capi_drk_as_array!=drk_capi) { - Py_XDECREF(capi_drk_as_array); } - } /* if (capi_drk_as_array == NULL) ... else of drk */ - /* End of cleaning variable drk */ - } /*CHECKSCALAR(shape(img, 0) == npx)*/ - /* End of cleaning variable npx */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of uint16_to_float_darkflm ***********************/ - -/******************************** frelon_lines ********************************/ -static char doc_f2py_rout__cImageD11_frelon_lines[] = "\ -frelon_lines(img,cut)\n\nWrapper for ``frelon_lines``.\ -\n\nParameters\n----------\n" -"img : in/output rank-2 array('f') with bounds (ns,nf)\n" -"cut : input float"; -/* extern void frelon_lines(float*,int,int,float); */ -static PyObject *f2py_rout__cImageD11_frelon_lines(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int,int,float)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[2] = {-1, -1}; - const int img_Rank = 2; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - int ns = 0; - int nf = 0; - float cut = 0; - PyObject *cut_capi = Py_None; - static char *capi_kwlist[] = {"img","cut",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.frelon_lines",\ - capi_kwlist,&img_capi,&cut_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.frelon_lines: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable cut */ - f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.frelon_lines() 2nd argument (cut) can't be converted to float"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(img,0); - /* Processing variable nf */ - nf = shape(img,1); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(img,ns,nf,cut); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of frelon_lines ****************************/ - -/****************************** frelon_lines_sub ******************************/ -static char doc_f2py_rout__cImageD11_frelon_lines_sub[] = "\ -frelon_lines_sub(img,drk,cut)\n\nWrapper for ``frelon_lines_sub``.\ -\n\nParameters\n----------\n" -"img : in/output rank-2 array('f') with bounds (ns,nf)\n" -"drk : in/output rank-2 array('f') with bounds (ns,nf)\n" -"cut : input float"; -/* extern void frelon_lines_sub(float*,float*,int,int,float); */ -static PyObject *f2py_rout__cImageD11_frelon_lines_sub(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,float*,int,int,float)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[2] = {-1, -1}; - const int img_Rank = 2; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - float *drk = NULL; - npy_intp drk_Dims[2] = {-1, -1}; - const int drk_Rank = 2; - PyArrayObject *capi_drk_as_array = NULL; - int capi_drk_intent = 0; - PyObject *drk_capi = Py_None; - int ns = 0; - int nf = 0; - float cut = 0; - PyObject *cut_capi = Py_None; - static char *capi_kwlist[] = {"img","drk","cut",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.frelon_lines_sub",\ - capi_kwlist,&img_capi,&drk_capi,&cut_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.frelon_lines_sub: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable cut */ - f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.frelon_lines_sub() 3rd argument (cut) can't be converted to float"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(img,0); - /* Processing variable nf */ - nf = shape(img,1); - /* Processing variable drk */ - drk_Dims[0]=ns,drk_Dims[1]=nf; - capi_drk_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.frelon_lines_sub: failed to create array from the 2nd argument `drk`"; - capi_drk_as_array = ndarray_from_pyobj( NPY_FLOAT,1,drk_Dims,drk_Rank, capi_drk_intent,drk_capi,capi_errmess); - if (capi_drk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - drk = (float *)(PyArray_DATA(capi_drk_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(img,drk,ns,nf,cut); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_drk_as_array!=drk_capi) { - Py_XDECREF(capi_drk_as_array); } - } /* if (capi_drk_as_array == NULL) ... else of drk */ - /* End of cleaning variable drk */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of frelon_lines_sub **************************/ - -/***************************** array_mean_var_cut *****************************/ -static char doc_f2py_rout__cImageD11_array_mean_var_cut[] = "\ -mean,var = array_mean_var_cut(img,[n,cut,verbose])\n\nWrapper for ``array_mean_var_cut``.\ -\n\nParameters\n----------\n" -"img : input rank-1 array('f') with bounds (npx)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: 3\n" -"cut : input float, optional\n Default: 3.0\n" -"verbose : input int, optional\n Default: 0\n" -"\nReturns\n-------\n" -"mean : float\n" -"var : float"; -/* extern void array_mean_var_cut(float*,int,float*,float*,int,float,int); */ -static PyObject *f2py_rout__cImageD11_array_mean_var_cut(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int,float*,float*,int,float,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[1] = {-1}; - const int img_Rank = 1; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - int npx = 0; - float mean = 0; - float var = 0; - int n = 0; - PyObject *n_capi = Py_None; - float cut = 0; - PyObject *cut_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - static char *capi_kwlist[] = {"img","n","cut","verbose",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|OOO:_cImageD11.array_mean_var_cut",\ - capi_kwlist,&img_capi,&n_capi,&cut_capi,&verbose_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.array_mean_var_cut: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable mean */ - /* Processing variable var */ - /* Processing variable n */ - if (n_capi == Py_None) n = 3; else - f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.array_mean_var_cut() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - /* Processing variable verbose */ - if (verbose_capi == Py_None) verbose = 0; else - f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.array_mean_var_cut() 3rd keyword (verbose) can't be converted to int"); - if (f2py_success) { - /* Processing variable cut */ - if (cut_capi == Py_None) cut = 3.0; else - f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.array_mean_var_cut() 2nd keyword (cut) can't be converted to float"); - if (f2py_success) { - /* Processing variable npx */ - npx = shape(img,0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(img,npx,&mean,&var,n,cut,verbose); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("ff",mean,var); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable npx */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - /* End of cleaning variable var */ - /* End of cleaning variable mean */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of array_mean_var_cut *************************/ - -/***************************** array_mean_var_msk *****************************/ -static char doc_f2py_rout__cImageD11_array_mean_var_msk[] = "\ -mean,var = array_mean_var_msk(img,msk,[n,cut,verbose])\n\nWrapper for ``array_mean_var_msk``.\ -\n\nParameters\n----------\n" -"img : input rank-1 array('f') with bounds (npx)\n" -"msk : input rank-1 array('B') with bounds (npx)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: 3\n" -"cut : input float, optional\n Default: 3.0\n" -"verbose : input int, optional\n Default: 0\n" -"\nReturns\n-------\n" -"mean : float\n" -"var : float"; -/* extern void array_mean_var_msk(float*,unsigned_char*,int,float*,float*,int,float,int); */ -static PyObject *f2py_rout__cImageD11_array_mean_var_msk(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,unsigned_char*,int,float*,float*,int,float,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[1] = {-1}; - const int img_Rank = 1; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - unsigned_char *msk = NULL; - npy_intp msk_Dims[1] = {-1}; - const int msk_Rank = 1; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - int npx = 0; - float mean = 0; - float var = 0; - int n = 0; - PyObject *n_capi = Py_None; - float cut = 0; - PyObject *cut_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - static char *capi_kwlist[] = {"img","msk","n","cut","verbose",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|OOO:_cImageD11.array_mean_var_msk",\ - capi_kwlist,&img_capi,&msk_capi,&n_capi,&cut_capi,&verbose_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.array_mean_var_msk: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable mean */ - /* Processing variable var */ - /* Processing variable n */ - if (n_capi == Py_None) n = 3; else - f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.array_mean_var_msk() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - /* Processing variable verbose */ - if (verbose_capi == Py_None) verbose = 0; else - f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.array_mean_var_msk() 3rd keyword (verbose) can't be converted to int"); - if (f2py_success) { - /* Processing variable cut */ - if (cut_capi == Py_None) cut = 3.0; else - f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.array_mean_var_msk() 2nd keyword (cut) can't be converted to float"); - if (f2py_success) { - /* Processing variable npx */ - npx = shape(img,0); - /* Processing variable msk */ - msk_Dims[0]=npx; - capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.array_mean_var_msk: failed to create array from the 2nd argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(img,msk,npx,&mean,&var,n,cut,verbose); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("ff",mean,var); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ - /* End of cleaning variable npx */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - /* End of cleaning variable var */ - /* End of cleaning variable mean */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of array_mean_var_msk *************************/ - -/******************************** array_stats ********************************/ -static char doc_f2py_rout__cImageD11_array_stats[] = "\ -minval,maxval,mean,var = array_stats(img)\n\nWrapper for ``array_stats``.\ -\n\nParameters\n----------\n" -"img : input rank-1 array('f') with bounds (npx)\n" -"\nReturns\n-------\n" -"minval : float\n" -"maxval : float\n" -"mean : float\n" -"var : float"; -/* extern void array_stats(float*,int,float*,float*,float*,float*); */ -static PyObject *f2py_rout__cImageD11_array_stats(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int,float*,float*,float*,float*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[1] = {-1}; - const int img_Rank = 1; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - int npx = 0; - float minval = 0; - float maxval = 0; - float mean = 0; - float var = 0; - static char *capi_kwlist[] = {"img",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:_cImageD11.array_stats",\ - capi_kwlist,&img_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.array_stats: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable minval */ - /* Processing variable maxval */ - /* Processing variable mean */ - /* Processing variable var */ - /* Processing variable npx */ - npx = shape(img,0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(img,npx,&minval,&maxval,&mean,&var); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("ffff",minval,maxval,mean,var); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable npx */ - /* End of cleaning variable var */ - /* End of cleaning variable mean */ - /* End of cleaning variable maxval */ - /* End of cleaning variable minval */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of array_stats *****************************/ - -/****************************** array_histogram ******************************/ -static char doc_f2py_rout__cImageD11_array_histogram[] = "\ -array_histogram(img,low,high,hist)\n\nWrapper for ``array_histogram``.\ -\n\nParameters\n----------\n" -"img : input rank-1 array('f') with bounds (npx)\n" -"low : input float\n" -"high : input float\n" -"hist : in/output rank-1 array('i') with bounds (nhist)"; -/* extern void array_histogram(float*,int,float,float,int*,int); */ -static PyObject *f2py_rout__cImageD11_array_histogram(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int,float,float,int*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[1] = {-1}; - const int img_Rank = 1; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - int npx = 0; - float low = 0; - PyObject *low_capi = Py_None; - float high = 0; - PyObject *high_capi = Py_None; - int *hist = NULL; - npy_intp hist_Dims[1] = {-1}; - const int hist_Rank = 1; - PyArrayObject *capi_hist_as_array = NULL; - int capi_hist_intent = 0; - PyObject *hist_capi = Py_None; - int nhist = 0; - static char *capi_kwlist[] = {"img","low","high","hist",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.array_histogram",\ - capi_kwlist,&img_capi,&low_capi,&high_capi,&hist_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.array_histogram: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable low */ - f2py_success = float_from_pyobj(&low,low_capi,"_cImageD11.array_histogram() 2nd argument (low) can't be converted to float"); - if (f2py_success) { - /* Processing variable high */ - f2py_success = float_from_pyobj(&high,high_capi,"_cImageD11.array_histogram() 3rd argument (high) can't be converted to float"); - if (f2py_success) { - /* Processing variable hist */ - ; - capi_hist_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.array_histogram: failed to create array from the 4th argument `hist`"; - capi_hist_as_array = ndarray_from_pyobj( NPY_INT,1,hist_Dims,hist_Rank, capi_hist_intent,hist_capi,capi_errmess); - if (capi_hist_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - hist = (int *)(PyArray_DATA(capi_hist_as_array)); - - /* Processing variable npx */ - npx = shape(img,0); - /* Processing variable nhist */ - nhist = shape(hist, 0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(img,npx,low,high,hist,nhist); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable nhist */ - /* End of cleaning variable npx */ - if((PyObject *)capi_hist_as_array!=hist_capi) { - Py_XDECREF(capi_hist_as_array); } - } /* if (capi_hist_as_array == NULL) ... else of hist */ - /* End of cleaning variable hist */ - } /*if (f2py_success) of high*/ - /* End of cleaning variable high */ - } /*if (f2py_success) of low*/ - /* End of cleaning variable low */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of array_histogram ***************************/ - -/****************************** reorder_u16_a32 ******************************/ -static char doc_f2py_rout__cImageD11_reorder_u16_a32[] = "\ -reorder_u16_a32(data,adr,out)\n\nWrapper for ``reorder_u16_a32``.\ -\n\nParameters\n----------\n" -"data : input rank-1 array('H') with bounds (N)\n" -"adr : input rank-1 array('i') with bounds (N)\n" -"out : in/output rank-1 array('H') with bounds (N)"; -/* extern void reorder_u16_a32(unsigned_short*,int*,unsigned_short*,int); */ -static PyObject *f2py_rout__cImageD11_reorder_u16_a32(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(unsigned_short*,int*,unsigned_short*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - unsigned_short *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *adr = NULL; - npy_intp adr_Dims[1] = {-1}; - const int adr_Rank = 1; - PyArrayObject *capi_adr_as_array = NULL; - int capi_adr_intent = 0; - PyObject *adr_capi = Py_None; - unsigned_short *out = NULL; - npy_intp out_Dims[1] = {-1}; - const int out_Rank = 1; - PyArrayObject *capi_out_as_array = NULL; - int capi_out_intent = 0; - PyObject *out_capi = Py_None; - int N = 0; - static char *capi_kwlist[] = {"data","adr","out",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.reorder_u16_a32",\ - capi_kwlist,&data_capi,&adr_capi,&out_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable N */ - N = shape(data, 0); - CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorder_u16_a32:N=%d",N) { - /* Processing variable adr */ - adr_Dims[0]=N; - capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32: failed to create array from the 2nd argument `adr`"; - capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); - if (capi_adr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - adr = (int *)(PyArray_DATA(capi_adr_as_array)); - - /* Processing variable out */ - out_Dims[0]=N; - capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32: failed to create array from the 3rd argument `out`"; - capi_out_as_array = ndarray_from_pyobj( NPY_USHORT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); - if (capi_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - out = (unsigned_short *)(PyArray_DATA(capi_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(data,adr,out,N); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_out_as_array!=out_capi) { - Py_XDECREF(capi_out_as_array); } - } /* if (capi_out_as_array == NULL) ... else of out */ - /* End of cleaning variable out */ - if((PyObject *)capi_adr_as_array!=adr_capi) { - Py_XDECREF(capi_adr_as_array); } - } /* if (capi_adr_as_array == NULL) ... else of adr */ - /* End of cleaning variable adr */ - } /*CHECKSCALAR(shape(data, 0) == N)*/ - /* End of cleaning variable N */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of reorder_u16_a32 ***************************/ - -/****************************** reorder_f32_a32 ******************************/ -static char doc_f2py_rout__cImageD11_reorder_f32_a32[] = "\ -reorder_f32_a32(data,adr,out)\n\nWrapper for ``reorder_f32_a32``.\ -\n\nParameters\n----------\n" -"data : input rank-1 array('f') with bounds (N)\n" -"adr : input rank-1 array('i') with bounds (N)\n" -"out : in/output rank-1 array('f') with bounds (N)"; -/* extern void reorder_f32_a32(float*,int*,float*,int); */ -static PyObject *f2py_rout__cImageD11_reorder_f32_a32(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int*,float*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *adr = NULL; - npy_intp adr_Dims[1] = {-1}; - const int adr_Rank = 1; - PyArrayObject *capi_adr_as_array = NULL; - int capi_adr_intent = 0; - PyObject *adr_capi = Py_None; - float *out = NULL; - npy_intp out_Dims[1] = {-1}; - const int out_Rank = 1; - PyArrayObject *capi_out_as_array = NULL; - int capi_out_intent = 0; - PyObject *out_capi = Py_None; - int N = 0; - static char *capi_kwlist[] = {"data","adr","out",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.reorder_f32_a32",\ - capi_kwlist,&data_capi,&adr_capi,&out_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_f32_a32: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (float *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable N */ - N = shape(data, 0); - CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorder_f32_a32:N=%d",N) { - /* Processing variable adr */ - adr_Dims[0]=N; - capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_f32_a32: failed to create array from the 2nd argument `adr`"; - capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); - if (capi_adr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - adr = (int *)(PyArray_DATA(capi_adr_as_array)); - - /* Processing variable out */ - out_Dims[0]=N; - capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_f32_a32: failed to create array from the 3rd argument `out`"; - capi_out_as_array = ndarray_from_pyobj( NPY_FLOAT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); - if (capi_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - out = (float *)(PyArray_DATA(capi_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(data,adr,out,N); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_out_as_array!=out_capi) { - Py_XDECREF(capi_out_as_array); } - } /* if (capi_out_as_array == NULL) ... else of out */ - /* End of cleaning variable out */ - if((PyObject *)capi_adr_as_array!=adr_capi) { - Py_XDECREF(capi_adr_as_array); } - } /* if (capi_adr_as_array == NULL) ... else of adr */ - /* End of cleaning variable adr */ - } /*CHECKSCALAR(shape(data, 0) == N)*/ - /* End of cleaning variable N */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of reorder_f32_a32 ***************************/ - -/***************************** reorderlut_u16_a32 *****************************/ -static char doc_f2py_rout__cImageD11_reorderlut_u16_a32[] = "\ -reorderlut_u16_a32(data,adr,out)\n\nWrapper for ``reorderlut_u16_a32``.\ -\n\nParameters\n----------\n" -"data : input rank-1 array('H') with bounds (N)\n" -"adr : input rank-1 array('i') with bounds (N)\n" -"out : in/output rank-1 array('H') with bounds (N)"; -/* extern void reorderlut_u16_a32(unsigned_short*,int*,unsigned_short*,int); */ -static PyObject *f2py_rout__cImageD11_reorderlut_u16_a32(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(unsigned_short*,int*,unsigned_short*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - unsigned_short *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *adr = NULL; - npy_intp adr_Dims[1] = {-1}; - const int adr_Rank = 1; - PyArrayObject *capi_adr_as_array = NULL; - int capi_adr_intent = 0; - PyObject *adr_capi = Py_None; - unsigned_short *out = NULL; - npy_intp out_Dims[1] = {-1}; - const int out_Rank = 1; - PyArrayObject *capi_out_as_array = NULL; - int capi_out_intent = 0; - PyObject *out_capi = Py_None; - int N = 0; - static char *capi_kwlist[] = {"data","adr","out",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.reorderlut_u16_a32",\ - capi_kwlist,&data_capi,&adr_capi,&out_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_u16_a32: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable N */ - N = shape(data, 0); - CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorderlut_u16_a32:N=%d",N) { - /* Processing variable adr */ - adr_Dims[0]=N; - capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_u16_a32: failed to create array from the 2nd argument `adr`"; - capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); - if (capi_adr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - adr = (int *)(PyArray_DATA(capi_adr_as_array)); - - /* Processing variable out */ - out_Dims[0]=N; - capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_u16_a32: failed to create array from the 3rd argument `out`"; - capi_out_as_array = ndarray_from_pyobj( NPY_USHORT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); - if (capi_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - out = (unsigned_short *)(PyArray_DATA(capi_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(data,adr,out,N); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_out_as_array!=out_capi) { - Py_XDECREF(capi_out_as_array); } - } /* if (capi_out_as_array == NULL) ... else of out */ - /* End of cleaning variable out */ - if((PyObject *)capi_adr_as_array!=adr_capi) { - Py_XDECREF(capi_adr_as_array); } - } /* if (capi_adr_as_array == NULL) ... else of adr */ - /* End of cleaning variable adr */ - } /*CHECKSCALAR(shape(data, 0) == N)*/ - /* End of cleaning variable N */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of reorderlut_u16_a32 *************************/ - -/***************************** reorderlut_f32_a32 *****************************/ -static char doc_f2py_rout__cImageD11_reorderlut_f32_a32[] = "\ -reorderlut_f32_a32(data,adr,out)\n\nWrapper for ``reorderlut_f32_a32``.\ -\n\nParameters\n----------\n" -"data : input rank-1 array('f') with bounds (N)\n" -"adr : input rank-1 array('i') with bounds (N)\n" -"out : in/output rank-1 array('f') with bounds (N)"; -/* extern void reorderlut_f32_a32(float*,int*,float*,int); */ -static PyObject *f2py_rout__cImageD11_reorderlut_f32_a32(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int*,float*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *adr = NULL; - npy_intp adr_Dims[1] = {-1}; - const int adr_Rank = 1; - PyArrayObject *capi_adr_as_array = NULL; - int capi_adr_intent = 0; - PyObject *adr_capi = Py_None; - float *out = NULL; - npy_intp out_Dims[1] = {-1}; - const int out_Rank = 1; - PyArrayObject *capi_out_as_array = NULL; - int capi_out_intent = 0; - PyObject *out_capi = Py_None; - int N = 0; - static char *capi_kwlist[] = {"data","adr","out",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.reorderlut_f32_a32",\ - capi_kwlist,&data_capi,&adr_capi,&out_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_f32_a32: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (float *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable N */ - N = shape(data, 0); - CHECKSCALAR(shape(data, 0) == N,"shape(data, 0) == N","hidden N","reorderlut_f32_a32:N=%d",N) { - /* Processing variable adr */ - adr_Dims[0]=N; - capi_adr_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_f32_a32: failed to create array from the 2nd argument `adr`"; - capi_adr_as_array = ndarray_from_pyobj( NPY_INT,1,adr_Dims,adr_Rank, capi_adr_intent,adr_capi,capi_errmess); - if (capi_adr_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - adr = (int *)(PyArray_DATA(capi_adr_as_array)); - - /* Processing variable out */ - out_Dims[0]=N; - capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorderlut_f32_a32: failed to create array from the 3rd argument `out`"; - capi_out_as_array = ndarray_from_pyobj( NPY_FLOAT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); - if (capi_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - out = (float *)(PyArray_DATA(capi_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(data,adr,out,N); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_out_as_array!=out_capi) { - Py_XDECREF(capi_out_as_array); } - } /* if (capi_out_as_array == NULL) ... else of out */ - /* End of cleaning variable out */ - if((PyObject *)capi_adr_as_array!=adr_capi) { - Py_XDECREF(capi_adr_as_array); } - } /* if (capi_adr_as_array == NULL) ... else of adr */ - /* End of cleaning variable adr */ - } /*CHECKSCALAR(shape(data, 0) == N)*/ - /* End of cleaning variable N */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of reorderlut_f32_a32 *************************/ - -/**************************** reorder_u16_a32_a16 ****************************/ -static char doc_f2py_rout__cImageD11_reorder_u16_a32_a16[] = "\ -reorder_u16_a32_a16(data,adr0,adr1,out)\n\nWrapper for ``reorder_u16_a32_a16``.\ -\n\nParameters\n----------\n" -"data : input rank-2 array('H') with bounds (ns,nf)\n" -"adr0 : input rank-1 array('i') with bounds (ns)\n" -"adr1 : input rank-2 array('h') with bounds (ns,nf)\n" -"out : in/output rank-2 array('H') with bounds (ns,nf)"; -/* extern void reorder_u16_a32_a16(unsigned_short*,int*,short*,unsigned_short*,int,int); */ -static PyObject *f2py_rout__cImageD11_reorder_u16_a32_a16(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(unsigned_short*,int*,short*,unsigned_short*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - unsigned_short *data = NULL; - npy_intp data_Dims[2] = {-1, -1}; - const int data_Rank = 2; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *adr0 = NULL; - npy_intp adr0_Dims[1] = {-1}; - const int adr0_Rank = 1; - PyArrayObject *capi_adr0_as_array = NULL; - int capi_adr0_intent = 0; - PyObject *adr0_capi = Py_None; - short *adr1 = NULL; - npy_intp adr1_Dims[2] = {-1, -1}; - const int adr1_Rank = 2; - PyArrayObject *capi_adr1_as_array = NULL; - int capi_adr1_intent = 0; - PyObject *adr1_capi = Py_None; - unsigned_short *out = NULL; - npy_intp out_Dims[2] = {-1, -1}; - const int out_Rank = 2; - PyArrayObject *capi_out_as_array = NULL; - int capi_out_intent = 0; - PyObject *out_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"data","adr0","adr1","out",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.reorder_u16_a32_a16",\ - capi_kwlist,&data_capi,&adr0_capi,&adr1_capi,&out_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable adr1 */ - ; - capi_adr1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 3rd argument `adr1`"; - capi_adr1_as_array = ndarray_from_pyobj( NPY_SHORT,1,adr1_Dims,adr1_Rank, capi_adr1_intent,adr1_capi,capi_errmess); - if (capi_adr1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - adr1 = (short *)(PyArray_DATA(capi_adr1_as_array)); - - /* Processing variable ns */ - ns = shape(adr1,0); - /* Processing variable nf */ - nf = shape(adr1,1); - /* Processing variable data */ - data_Dims[0]=ns,data_Dims[1]=nf; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_USHORT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (unsigned_short *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable adr0 */ - adr0_Dims[0]=ns; - capi_adr0_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 2nd argument `adr0`"; - capi_adr0_as_array = ndarray_from_pyobj( NPY_INT,1,adr0_Dims,adr0_Rank, capi_adr0_intent,adr0_capi,capi_errmess); - if (capi_adr0_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - adr0 = (int *)(PyArray_DATA(capi_adr0_as_array)); - - /* Processing variable out */ - out_Dims[0]=ns,out_Dims[1]=nf; - capi_out_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.reorder_u16_a32_a16: failed to create array from the 4th argument `out`"; - capi_out_as_array = ndarray_from_pyobj( NPY_USHORT,1,out_Dims,out_Rank, capi_out_intent,out_capi,capi_errmess); - if (capi_out_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - out = (unsigned_short *)(PyArray_DATA(capi_out_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(data,adr0,adr1,out,ns,nf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_out_as_array!=out_capi) { - Py_XDECREF(capi_out_as_array); } - } /* if (capi_out_as_array == NULL) ... else of out */ - /* End of cleaning variable out */ - if((PyObject *)capi_adr0_as_array!=adr0_capi) { - Py_XDECREF(capi_adr0_as_array); } - } /* if (capi_adr0_as_array == NULL) ... else of adr0 */ - /* End of cleaning variable adr0 */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - if((PyObject *)capi_adr1_as_array!=adr1_capi) { - Py_XDECREF(capi_adr1_as_array); } - } /* if (capi_adr1_as_array == NULL) ... else of adr1 */ - /* End of cleaning variable adr1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of reorder_u16_a32_a16 *************************/ - -/*********************************** bgcalc ***********************************/ -static char doc_f2py_rout__cImageD11_bgcalc[] = "\ -bgcalc(img,bg,msk,gain,sp,st)\n\nWrapper for ``bgcalc``.\ -\n\nParameters\n----------\n" -"img : input rank-2 array('f') with bounds (ns,nf)\n" -"bg : in/output rank-2 array('f') with bounds (ns,nf)\n" -"msk : in/output rank-2 array('b') with bounds (ns,nf)\n" -"gain : input float\n" -"sp : input float\n" -"st : input float"; -/* extern void bgcalc(float*,float*,signed_char*,int,int,float,float,float); */ -static PyObject *f2py_rout__cImageD11_bgcalc(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,float*,signed_char*,int,int,float,float,float)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *img = NULL; - npy_intp img_Dims[2] = {-1, -1}; - const int img_Rank = 2; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - float *bg = NULL; - npy_intp bg_Dims[2] = {-1, -1}; - const int bg_Rank = 2; - PyArrayObject *capi_bg_as_array = NULL; - int capi_bg_intent = 0; - PyObject *bg_capi = Py_None; - signed_char *msk = NULL; - npy_intp msk_Dims[2] = {-1, -1}; - const int msk_Rank = 2; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - int ns = 0; - int nf = 0; - float gain = 0; - PyObject *gain_capi = Py_None; - float sp = 0; - PyObject *sp_capi = Py_None; - float st = 0; - PyObject *st_capi = Py_None; - static char *capi_kwlist[] = {"img","bg","msk","gain","sp","st",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.bgcalc",\ - capi_kwlist,&img_capi,&bg_capi,&msk_capi,&gain_capi,&sp_capi,&st_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.bgcalc: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable gain */ - f2py_success = float_from_pyobj(&gain,gain_capi,"_cImageD11.bgcalc() 4th argument (gain) can't be converted to float"); - if (f2py_success) { - /* Processing variable sp */ - f2py_success = float_from_pyobj(&sp,sp_capi,"_cImageD11.bgcalc() 5th argument (sp) can't be converted to float"); - if (f2py_success) { - /* Processing variable st */ - f2py_success = float_from_pyobj(&st,st_capi,"_cImageD11.bgcalc() 6th argument (st) can't be converted to float"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(img,0); - /* Processing variable nf */ - nf = shape(img,1); - /* Processing variable bg */ - bg_Dims[0]=ns,bg_Dims[1]=nf; - capi_bg_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.bgcalc: failed to create array from the 2nd argument `bg`"; - capi_bg_as_array = ndarray_from_pyobj( NPY_FLOAT,1,bg_Dims,bg_Rank, capi_bg_intent,bg_capi,capi_errmess); - if (capi_bg_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - bg = (float *)(PyArray_DATA(capi_bg_as_array)); - - /* Processing variable msk */ - msk_Dims[0]=ns,msk_Dims[1]=nf; - capi_msk_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.bgcalc: failed to create array from the 3rd argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(img,bg,msk,ns,nf,gain,sp,st); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ - if((PyObject *)capi_bg_as_array!=bg_capi) { - Py_XDECREF(capi_bg_as_array); } - } /* if (capi_bg_as_array == NULL) ... else of bg */ - /* End of cleaning variable bg */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of st*/ - /* End of cleaning variable st */ - } /*if (f2py_success) of sp*/ - /* End of cleaning variable sp */ - } /*if (f2py_success) of gain*/ - /* End of cleaning variable gain */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of bgcalc *******************************/ - -/****************************** verify_rounding ******************************/ -static char doc_f2py_rout__cImageD11_verify_rounding[] = "\ -verify_rounding = verify_rounding(n)\n\nWrapper for ``verify_rounding``.\ -\n\nParameters\n----------\n" -"n : input int\n" -"\nReturns\n-------\n" -"verify_rounding : int"; -/* extern int verify_rounding(int); */ -static PyObject *f2py_rout__cImageD11_verify_rounding(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int verify_rounding_return_value=0; - int n = 0; - PyObject *n_capi = Py_None; - static char *capi_kwlist[] = {"n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:_cImageD11.verify_rounding",\ - capi_kwlist,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable n */ - f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.verify_rounding() 1st argument (n) can't be converted to int"); - if (f2py_success) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - verify_rounding_return_value = (*f2py_func)(n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",verify_rounding_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of verify_rounding ***************************/ - -/******************************** closest_vec ********************************/ -static char doc_f2py_rout__cImageD11_closest_vec[] = "\ -closest_vec(x,ic)\n\nWrapper for ``closest_vec``.\ -\n\nParameters\n----------\n" -"x : input rank-2 array('d') with bounds (nv,dim)\n" -"ic : in/output rank-1 array('i') with bounds (nv)"; -/* extern void closest_vec(double*,int,int,int*); */ -static PyObject *f2py_rout__cImageD11_closest_vec(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int,int,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *x = NULL; - npy_intp x_Dims[2] = {-1, -1}; - const int x_Rank = 2; - PyArrayObject *capi_x_as_array = NULL; - int capi_x_intent = 0; - PyObject *x_capi = Py_None; - int dim = 0; - int nv = 0; - int *ic = NULL; - npy_intp ic_Dims[1] = {-1}; - const int ic_Rank = 1; - PyArrayObject *capi_ic_as_array = NULL; - int capi_ic_intent = 0; - PyObject *ic_capi = Py_None; - static char *capi_kwlist[] = {"x","ic",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.closest_vec",\ - capi_kwlist,&x_capi,&ic_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable x */ - ; - capi_x_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.closest_vec: failed to create array from the 1st argument `x`"; - capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); - if (capi_x_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x = (double *)(PyArray_DATA(capi_x_as_array)); - - /* Processing variable dim */ - dim = shape(x,1); - /* Processing variable nv */ - nv = shape(x,0); - /* Processing variable ic */ - ic_Dims[0]=nv; - capi_ic_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.closest_vec: failed to create array from the 2nd argument `ic`"; - capi_ic_as_array = ndarray_from_pyobj( NPY_INT,1,ic_Dims,ic_Rank, capi_ic_intent,ic_capi,capi_errmess); - if (capi_ic_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ic = (int *)(PyArray_DATA(capi_ic_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(x,dim,nv,ic); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_ic_as_array!=ic_capi) { - Py_XDECREF(capi_ic_as_array); } - } /* if (capi_ic_as_array == NULL) ... else of ic */ - /* End of cleaning variable ic */ - /* End of cleaning variable nv */ - /* End of cleaning variable dim */ - if((PyObject *)capi_x_as_array!=x_capi) { - Py_XDECREF(capi_x_as_array); } - } /* if (capi_x_as_array == NULL) ... else of x */ - /* End of cleaning variable x */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of closest_vec *****************************/ - -/********************************** closest **********************************/ -static char doc_f2py_rout__cImageD11_closest[] = "\ -ibest,best = closest(x,v)\n\nWrapper for ``closest``.\ -\n\nParameters\n----------\n" -"x : input rank-1 array('d') with bounds (nx)\n" -"v : input rank-1 array('d') with bounds (nv)\n" -"\nReturns\n-------\n" -"ibest : int\n" -"best : float"; -/* extern void closest(double*,double*,int*,double*,int,int); */ -static PyObject *f2py_rout__cImageD11_closest(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,double*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *x = NULL; - npy_intp x_Dims[1] = {-1}; - const int x_Rank = 1; - PyArrayObject *capi_x_as_array = NULL; - int capi_x_intent = 0; - PyObject *x_capi = Py_None; - double *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - int ibest = 0; - double best = 0; - int nx = 0; - int nv = 0; - static char *capi_kwlist[] = {"x","v",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.closest",\ - capi_kwlist,&x_capi,&v_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable x */ - ; - capi_x_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "_cImageD11._cImageD11.closest: failed to create array from the 1st argument `x`"; - capi_x_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,x_Dims,x_Rank, capi_x_intent,x_capi,capi_errmess); - if (capi_x_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - x = (double *)(PyArray_DATA(capi_x_as_array)); - - /* Processing variable v */ - ; - capi_v_intent |= F2PY_INTENT_IN; - const char * capi_errmess = "_cImageD11._cImageD11.closest: failed to create array from the 2nd argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (double *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable ibest */ - /* Processing variable best */ - /* Processing variable nx */ - nx = shape(x,0); - /* Processing variable nv */ - nv = shape(v,0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(x,v,&ibest,&best,nx,nv); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("id",ibest,best); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable nv */ - /* End of cleaning variable nx */ - /* End of cleaning variable best */ - /* End of cleaning variable ibest */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ - if((PyObject *)capi_x_as_array!=x_capi) { - Py_XDECREF(capi_x_as_array); } - } /* if (capi_x_as_array == NULL) ... else of x */ - /* End of cleaning variable x */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************* end of closest *******************************/ - -/*********************************** score ***********************************/ -static char doc_f2py_rout__cImageD11_score[] = "\ -score = score(ubi,gv,tol)\n\nWrapper for ``score``.\ -\n\nParameters\n----------\n" -"ubi : input rank-2 array('d') with bounds (3,3)\n" -"gv : input rank-2 array('d') with bounds (ng,3)\n" -"tol : input float\n" -"\nReturns\n-------\n" -"score : int"; -/* extern int score(double*,double*,double,int); */ -static PyObject *f2py_rout__cImageD11_score(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(double*,double*,double,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int score_return_value=0; - double *ubi = NULL; - npy_intp ubi_Dims[2] = {-1, -1}; - const int ubi_Rank = 2; - PyArrayObject *capi_ubi_as_array = NULL; - int capi_ubi_intent = 0; - PyObject *ubi_capi = Py_None; - double *gv = NULL; - npy_intp gv_Dims[2] = {-1, -1}; - const int gv_Rank = 2; - PyArrayObject *capi_gv_as_array = NULL; - int capi_gv_intent = 0; - PyObject *gv_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - int ng = 0; - static char *capi_kwlist[] = {"ubi","gv","tol",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.score",\ - capi_kwlist,&ubi_capi,&gv_capi,&tol_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ubi */ - ubi_Dims[0]=3,ubi_Dims[1]=3; - capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score: failed to create array from the 1st argument `ubi`"; - capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); - if (capi_ubi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); - - /* Processing variable gv */ - gv_Dims[1]=3; - capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score: failed to create array from the 2nd argument `gv`"; - capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); - if (capi_gv_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gv = (double *)(PyArray_DATA(capi_gv_as_array)); - - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.score() 3rd argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable ng */ - ng = shape(gv, 0); - CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","score:ng=%d",ng) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - score_return_value = (*f2py_func)(ubi,gv,tol,ng); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",score_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(gv, 0) == ng)*/ - /* End of cleaning variable ng */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - if((PyObject *)capi_gv_as_array!=gv_capi) { - Py_XDECREF(capi_gv_as_array); } - } /* if (capi_gv_as_array == NULL) ... else of gv */ - /* End of cleaning variable gv */ - if((PyObject *)capi_ubi_as_array!=ubi_capi) { - Py_XDECREF(capi_ubi_as_array); } - } /* if (capi_ubi_as_array == NULL) ... else of ubi */ - /* End of cleaning variable ubi */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of score ********************************/ - -/****************************** score_and_refine ******************************/ -static char doc_f2py_rout__cImageD11_score_and_refine[] = "\ -n,sumdrlv2 = score_and_refine(ubi,gv,tol)\n\nWrapper for ``score_and_refine``.\ -\n\nParameters\n----------\n" -"ubi : in/output rank-2 array('d') with bounds (3,3)\n" -"gv : input rank-2 array('d') with bounds (ng,3)\n" -"tol : input float\n" -"\nReturns\n-------\n" -"n : int\n" -"sumdrlv2 : float"; -/* extern void score_and_refine(double*,double*,double,int*,double*,int); */ -static PyObject *f2py_rout__cImageD11_score_and_refine(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double,int*,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ubi = NULL; - npy_intp ubi_Dims[2] = {-1, -1}; - const int ubi_Rank = 2; - PyArrayObject *capi_ubi_as_array = NULL; - int capi_ubi_intent = 0; - PyObject *ubi_capi = Py_None; - double *gv = NULL; - npy_intp gv_Dims[2] = {-1, -1}; - const int gv_Rank = 2; - PyArrayObject *capi_gv_as_array = NULL; - int capi_gv_intent = 0; - PyObject *gv_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - int n = 0; - double sumdrlv2 = 0; - int ng = 0; - static char *capi_kwlist[] = {"ubi","gv","tol",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.score_and_refine",\ - capi_kwlist,&ubi_capi,&gv_capi,&tol_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable n */ - /* Processing variable sumdrlv2 */ - /* Processing variable ubi */ - ubi_Dims[0]=3,ubi_Dims[1]=3; - capi_ubi_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_and_refine: failed to create array from the 1st argument `ubi`"; - capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); - if (capi_ubi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); - - /* Processing variable gv */ - gv_Dims[1]=3; - capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_and_refine: failed to create array from the 2nd argument `gv`"; - capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); - if (capi_gv_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gv = (double *)(PyArray_DATA(capi_gv_as_array)); - - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.score_and_refine() 3rd argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable ng */ - ng = shape(gv, 0); - CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","score_and_refine:ng=%d",ng) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(ubi,gv,tol,&n,&sumdrlv2,ng); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("id",n,sumdrlv2); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(gv, 0) == ng)*/ - /* End of cleaning variable ng */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - if((PyObject *)capi_gv_as_array!=gv_capi) { - Py_XDECREF(capi_gv_as_array); } - } /* if (capi_gv_as_array == NULL) ... else of gv */ - /* End of cleaning variable gv */ - if((PyObject *)capi_ubi_as_array!=ubi_capi) { - Py_XDECREF(capi_ubi_as_array); } - } /* if (capi_ubi_as_array == NULL) ... else of ubi */ - /* End of cleaning variable ubi */ - /* End of cleaning variable sumdrlv2 */ - /* End of cleaning variable n */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of score_and_refine **************************/ - -/****************************** score_and_assign ******************************/ -static char doc_f2py_rout__cImageD11_score_and_assign[] = "\ -score_and_assign = score_and_assign(ubi,gv,tol,drlv2,labels,label)\n\nWrapper for ``score_and_assign``.\ -\n\nParameters\n----------\n" -"ubi : input rank-2 array('d') with bounds (3,3)\n" -"gv : input rank-2 array('d') with bounds (ng,3)\n" -"tol : input float\n" -"drlv2 : in/output rank-1 array('d') with bounds (ng)\n" -"labels : in/output rank-1 array('i') with bounds (ng)\n" -"label : input int\n" -"\nReturns\n-------\n" -"score_and_assign : int"; -/* extern int score_and_assign(double*,double*,double,double*,int*,int,int); */ -static PyObject *f2py_rout__cImageD11_score_and_assign(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(double*,double*,double,double*,int*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int score_and_assign_return_value=0; - double *ubi = NULL; - npy_intp ubi_Dims[2] = {-1, -1}; - const int ubi_Rank = 2; - PyArrayObject *capi_ubi_as_array = NULL; - int capi_ubi_intent = 0; - PyObject *ubi_capi = Py_None; - double *gv = NULL; - npy_intp gv_Dims[2] = {-1, -1}; - const int gv_Rank = 2; - PyArrayObject *capi_gv_as_array = NULL; - int capi_gv_intent = 0; - PyObject *gv_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - double *drlv2 = NULL; - npy_intp drlv2_Dims[1] = {-1}; - const int drlv2_Rank = 1; - PyArrayObject *capi_drlv2_as_array = NULL; - int capi_drlv2_intent = 0; - PyObject *drlv2_capi = Py_None; - int *labels = NULL; - npy_intp labels_Dims[1] = {-1}; - const int labels_Rank = 1; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - int label = 0; - PyObject *label_capi = Py_None; - int ng = 0; - static char *capi_kwlist[] = {"ubi","gv","tol","drlv2","labels","label",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.score_and_assign",\ - capi_kwlist,&ubi_capi,&gv_capi,&tol_capi,&drlv2_capi,&labels_capi,&label_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ubi */ - ubi_Dims[0]=3,ubi_Dims[1]=3; - capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 1st argument `ubi`"; - capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); - if (capi_ubi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); - - /* Processing variable gv */ - gv_Dims[1]=3; - capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 2nd argument `gv`"; - capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); - if (capi_gv_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gv = (double *)(PyArray_DATA(capi_gv_as_array)); - - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.score_and_assign() 3rd argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable label */ - f2py_success = int_from_pyobj(&label,label_capi,"_cImageD11.score_and_assign() 6th argument (label) can't be converted to int"); - if (f2py_success) { - /* Processing variable ng */ - ng = shape(gv, 0); - CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","score_and_assign:ng=%d",ng) { - /* Processing variable drlv2 */ - drlv2_Dims[0]=ng; - capi_drlv2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 4th argument `drlv2`"; - capi_drlv2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,drlv2_Dims,drlv2_Rank, capi_drlv2_intent,drlv2_capi,capi_errmess); - if (capi_drlv2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - drlv2 = (double *)(PyArray_DATA(capi_drlv2_as_array)); - - /* Processing variable labels */ - labels_Dims[0]=ng; - capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_and_assign: failed to create array from the 5th argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - score_and_assign_return_value = (*f2py_func)(ubi,gv,tol,drlv2,labels,label,ng); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",score_and_assign_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - if((PyObject *)capi_drlv2_as_array!=drlv2_capi) { - Py_XDECREF(capi_drlv2_as_array); } - } /* if (capi_drlv2_as_array == NULL) ... else of drlv2 */ - /* End of cleaning variable drlv2 */ - } /*CHECKSCALAR(shape(gv, 0) == ng)*/ - /* End of cleaning variable ng */ - } /*if (f2py_success) of label*/ - /* End of cleaning variable label */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - if((PyObject *)capi_gv_as_array!=gv_capi) { - Py_XDECREF(capi_gv_as_array); } - } /* if (capi_gv_as_array == NULL) ... else of gv */ - /* End of cleaning variable gv */ - if((PyObject *)capi_ubi_as_array!=ubi_capi) { - Py_XDECREF(capi_ubi_as_array); } - } /* if (capi_ubi_as_array == NULL) ... else of ubi */ - /* End of cleaning variable ubi */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of score_and_assign **************************/ - -/****************************** refine_assigned ******************************/ -static char doc_f2py_rout__cImageD11_refine_assigned[] = "\ -npk,drlv2 = refine_assigned(ubi,gv,labels,label)\n\nWrapper for ``refine_assigned``.\ -\n\nParameters\n----------\n" -"ubi : input rank-2 array('d') with bounds (3,3)\n" -"gv : input rank-2 array('d') with bounds (ng,3)\n" -"labels : input rank-1 array('i') with bounds (ng)\n" -"label : input int\n" -"\nReturns\n-------\n" -"npk : int\n" -"drlv2 : float"; -/* extern void refine_assigned(double*,double*,int*,int,int*,double*,int); */ -static PyObject *f2py_rout__cImageD11_refine_assigned(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int*,int,int*,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ubi = NULL; - npy_intp ubi_Dims[2] = {-1, -1}; - const int ubi_Rank = 2; - PyArrayObject *capi_ubi_as_array = NULL; - int capi_ubi_intent = 0; - PyObject *ubi_capi = Py_None; - double *gv = NULL; - npy_intp gv_Dims[2] = {-1, -1}; - const int gv_Rank = 2; - PyArrayObject *capi_gv_as_array = NULL; - int capi_gv_intent = 0; - PyObject *gv_capi = Py_None; - int *labels = NULL; - npy_intp labels_Dims[1] = {-1}; - const int labels_Rank = 1; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - int label = 0; - PyObject *label_capi = Py_None; - int npk = 0; - double drlv2 = 0; - int ng = 0; - static char *capi_kwlist[] = {"ubi","gv","labels","label",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.refine_assigned",\ - capi_kwlist,&ubi_capi,&gv_capi,&labels_capi,&label_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ubi */ - ubi_Dims[0]=3,ubi_Dims[1]=3; - capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.refine_assigned: failed to create array from the 1st argument `ubi`"; - capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); - if (capi_ubi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); - - /* Processing variable gv */ - gv_Dims[1]=3; - capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.refine_assigned: failed to create array from the 2nd argument `gv`"; - capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); - if (capi_gv_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gv = (double *)(PyArray_DATA(capi_gv_as_array)); - - /* Processing variable label */ - f2py_success = int_from_pyobj(&label,label_capi,"_cImageD11.refine_assigned() 4th argument (label) can't be converted to int"); - if (f2py_success) { - /* Processing variable npk */ - /* Processing variable drlv2 */ - /* Processing variable ng */ - ng = shape(gv, 0); - CHECKSCALAR(shape(gv, 0) == ng,"shape(gv, 0) == ng","hidden ng","refine_assigned:ng=%d",ng) { - /* Processing variable labels */ - labels_Dims[0]=ng; - capi_labels_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.refine_assigned: failed to create array from the 3rd argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(ubi,gv,labels,label,&npk,&drlv2,ng); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("id",npk,drlv2); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - } /*CHECKSCALAR(shape(gv, 0) == ng)*/ - /* End of cleaning variable ng */ - /* End of cleaning variable drlv2 */ - /* End of cleaning variable npk */ - } /*if (f2py_success) of label*/ - /* End of cleaning variable label */ - if((PyObject *)capi_gv_as_array!=gv_capi) { - Py_XDECREF(capi_gv_as_array); } - } /* if (capi_gv_as_array == NULL) ... else of gv */ - /* End of cleaning variable gv */ - if((PyObject *)capi_ubi_as_array!=ubi_capi) { - Py_XDECREF(capi_ubi_as_array); } - } /* if (capi_ubi_as_array == NULL) ... else of ubi */ - /* End of cleaning variable ubi */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of refine_assigned ***************************/ - -/********************************* put_incr64 *********************************/ -static char doc_f2py_rout__cImageD11_put_incr64[] = "\ -put_incr64(data,ind,vals,[boundscheck])\n\nWrapper for ``put_incr64``.\ -\n\nParameters\n----------\n" -"data : in/output rank-1 array('f') with bounds (m)\n" -"ind : input rank-1 array('q') with bounds (n)\n" -"vals : input rank-1 array('f') with bounds (n)\n" -"\nOther Parameters\n----------------\n" -"boundscheck : input int, optional\n Default: 0"; -/* extern void put_incr64(float*,long_long*,float*,int,int,int); */ -static PyObject *f2py_rout__cImageD11_put_incr64(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,long_long*,float*,int,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - long_long *ind = NULL; - npy_intp ind_Dims[1] = {-1}; - const int ind_Rank = 1; - PyArrayObject *capi_ind_as_array = NULL; - int capi_ind_intent = 0; - PyObject *ind_capi = Py_None; - float *vals = NULL; - npy_intp vals_Dims[1] = {-1}; - const int vals_Rank = 1; - PyArrayObject *capi_vals_as_array = NULL; - int capi_vals_intent = 0; - PyObject *vals_capi = Py_None; - int boundscheck = 0; - PyObject *boundscheck_capi = Py_None; - int n = 0; - int m = 0; - static char *capi_kwlist[] = {"data","ind","vals","boundscheck",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:_cImageD11.put_incr64",\ - capi_kwlist,&data_capi,&ind_capi,&vals_capi,&boundscheck_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.put_incr64: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (float *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable ind */ - ; - capi_ind_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.put_incr64: failed to create array from the 2nd argument `ind`"; - capi_ind_as_array = ndarray_from_pyobj( NPY_LONGLONG,1,ind_Dims,ind_Rank, capi_ind_intent,ind_capi,capi_errmess); - if (capi_ind_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ind = (long_long *)(PyArray_DATA(capi_ind_as_array)); - - /* Processing variable boundscheck */ - if (boundscheck_capi == Py_None) boundscheck = 0; else - f2py_success = int_from_pyobj(&boundscheck,boundscheck_capi,"_cImageD11.put_incr64() 1st keyword (boundscheck) can't be converted to int"); - if (f2py_success) { - /* Processing variable n */ - n = shape(ind, 0); - CHECKSCALAR(shape(ind, 0) == n,"shape(ind, 0) == n","hidden n","put_incr64:n=%d",n) { - /* Processing variable m */ - m = shape(data, 0); - CHECKSCALAR(shape(data, 0) == m,"shape(data, 0) == m","hidden m","put_incr64:m=%d",m) { - /* Processing variable vals */ - vals_Dims[0]=n; - capi_vals_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.put_incr64: failed to create array from the 3rd argument `vals`"; - capi_vals_as_array = ndarray_from_pyobj( NPY_FLOAT,1,vals_Dims,vals_Rank, capi_vals_intent,vals_capi,capi_errmess); - if (capi_vals_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - vals = (float *)(PyArray_DATA(capi_vals_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(data,ind,vals,boundscheck,n,m); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_vals_as_array!=vals_capi) { - Py_XDECREF(capi_vals_as_array); } - } /* if (capi_vals_as_array == NULL) ... else of vals */ - /* End of cleaning variable vals */ - } /*CHECKSCALAR(shape(data, 0) == m)*/ - /* End of cleaning variable m */ - } /*CHECKSCALAR(shape(ind, 0) == n)*/ - /* End of cleaning variable n */ - } /*if (f2py_success) of boundscheck*/ - /* End of cleaning variable boundscheck */ - if((PyObject *)capi_ind_as_array!=ind_capi) { - Py_XDECREF(capi_ind_as_array); } - } /* if (capi_ind_as_array == NULL) ... else of ind */ - /* End of cleaning variable ind */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of put_incr64 *****************************/ - -/********************************* put_incr32 *********************************/ -static char doc_f2py_rout__cImageD11_put_incr32[] = "\ -put_incr32(data,ind,vals,[boundscheck])\n\nWrapper for ``put_incr32``.\ -\n\nParameters\n----------\n" -"data : in/output rank-1 array('f') with bounds (m)\n" -"ind : input rank-1 array('i') with bounds (n)\n" -"vals : input rank-1 array('f') with bounds (n)\n" -"\nOther Parameters\n----------------\n" -"boundscheck : input int, optional\n Default: 0"; -/* extern void put_incr32(float*,int*,float*,int,int,int); */ -static PyObject *f2py_rout__cImageD11_put_incr32(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int*,float*,int,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *data = NULL; - npy_intp data_Dims[1] = {-1}; - const int data_Rank = 1; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *ind = NULL; - npy_intp ind_Dims[1] = {-1}; - const int ind_Rank = 1; - PyArrayObject *capi_ind_as_array = NULL; - int capi_ind_intent = 0; - PyObject *ind_capi = Py_None; - float *vals = NULL; - npy_intp vals_Dims[1] = {-1}; - const int vals_Rank = 1; - PyArrayObject *capi_vals_as_array = NULL; - int capi_vals_intent = 0; - PyObject *vals_capi = Py_None; - int boundscheck = 0; - PyObject *boundscheck_capi = Py_None; - int n = 0; - int m = 0; - static char *capi_kwlist[] = {"data","ind","vals","boundscheck",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|O:_cImageD11.put_incr32",\ - capi_kwlist,&data_capi,&ind_capi,&vals_capi,&boundscheck_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.put_incr32: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (float *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable ind */ - ; - capi_ind_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.put_incr32: failed to create array from the 2nd argument `ind`"; - capi_ind_as_array = ndarray_from_pyobj( NPY_INT,1,ind_Dims,ind_Rank, capi_ind_intent,ind_capi,capi_errmess); - if (capi_ind_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ind = (int *)(PyArray_DATA(capi_ind_as_array)); - - /* Processing variable boundscheck */ - if (boundscheck_capi == Py_None) boundscheck = 0; else - f2py_success = int_from_pyobj(&boundscheck,boundscheck_capi,"_cImageD11.put_incr32() 1st keyword (boundscheck) can't be converted to int"); - if (f2py_success) { - /* Processing variable n */ - n = shape(ind, 0); - CHECKSCALAR(shape(ind, 0) == n,"shape(ind, 0) == n","hidden n","put_incr32:n=%d",n) { - /* Processing variable m */ - m = shape(data, 0); - CHECKSCALAR(shape(data, 0) == m,"shape(data, 0) == m","hidden m","put_incr32:m=%d",m) { - /* Processing variable vals */ - vals_Dims[0]=n; - capi_vals_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.put_incr32: failed to create array from the 3rd argument `vals`"; - capi_vals_as_array = ndarray_from_pyobj( NPY_FLOAT,1,vals_Dims,vals_Rank, capi_vals_intent,vals_capi,capi_errmess); - if (capi_vals_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - vals = (float *)(PyArray_DATA(capi_vals_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(data,ind,vals,boundscheck,n,m); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_vals_as_array!=vals_capi) { - Py_XDECREF(capi_vals_as_array); } - } /* if (capi_vals_as_array == NULL) ... else of vals */ - /* End of cleaning variable vals */ - } /*CHECKSCALAR(shape(data, 0) == m)*/ - /* End of cleaning variable m */ - } /*CHECKSCALAR(shape(ind, 0) == n)*/ - /* End of cleaning variable n */ - } /*if (f2py_success) of boundscheck*/ - /* End of cleaning variable boundscheck */ - if((PyObject *)capi_ind_as_array!=ind_capi) { - Py_XDECREF(capi_ind_as_array); } - } /* if (capi_ind_as_array == NULL) ... else of ind */ - /* End of cleaning variable ind */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of put_incr32 *****************************/ - -/********************************* cluster1d *********************************/ -static char doc_f2py_rout__cImageD11_cluster1d[] = "\ -nclusters = cluster1d(ar,order,tol,ids,avgs)\n\nWrapper for ``cluster1d``.\ -\n\nParameters\n----------\n" -"ar : input rank-1 array('d') with bounds (n)\n" -"order : input rank-1 array('i') with bounds (n)\n" -"tol : input float\n" -"ids : in/output rank-1 array('i') with bounds (n)\n" -"avgs : in/output rank-1 array('d') with bounds (n)\n" -"\nReturns\n-------\n" -"nclusters : int"; -/* extern void cluster1d(double*,int,int*,double,int*,int*,double*); */ -static PyObject *f2py_rout__cImageD11_cluster1d(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int,int*,double,int*,int*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ar = NULL; - npy_intp ar_Dims[1] = {-1}; - const int ar_Rank = 1; - PyArrayObject *capi_ar_as_array = NULL; - int capi_ar_intent = 0; - PyObject *ar_capi = Py_None; - int n = 0; - int *order = NULL; - npy_intp order_Dims[1] = {-1}; - const int order_Rank = 1; - PyArrayObject *capi_order_as_array = NULL; - int capi_order_intent = 0; - PyObject *order_capi = Py_None; - double tol = 0; - PyObject *tol_capi = Py_None; - int nclusters = 0; - int *ids = NULL; - npy_intp ids_Dims[1] = {-1}; - const int ids_Rank = 1; - PyArrayObject *capi_ids_as_array = NULL; - int capi_ids_intent = 0; - PyObject *ids_capi = Py_None; - double *avgs = NULL; - npy_intp avgs_Dims[1] = {-1}; - const int avgs_Rank = 1; - PyArrayObject *capi_avgs_as_array = NULL; - int capi_avgs_intent = 0; - PyObject *avgs_capi = Py_None; - static char *capi_kwlist[] = {"ar","order","tol","ids","avgs",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|:_cImageD11.cluster1d",\ - capi_kwlist,&ar_capi,&order_capi,&tol_capi,&ids_capi,&avgs_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ar */ - ; - capi_ar_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 1st argument `ar`"; - capi_ar_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ar_Dims,ar_Rank, capi_ar_intent,ar_capi,capi_errmess); - if (capi_ar_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ar = (double *)(PyArray_DATA(capi_ar_as_array)); - - /* Processing variable tol */ - f2py_success = double_from_pyobj(&tol,tol_capi,"_cImageD11.cluster1d() 3rd argument (tol) can't be converted to double"); - if (f2py_success) { - /* Processing variable nclusters */ - /* Processing variable n */ - n = shape(ar, 0); - CHECKSCALAR(shape(ar, 0) == n,"shape(ar, 0) == n","hidden n","cluster1d:n=%d",n) { - /* Processing variable order */ - order_Dims[0]=n; - capi_order_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 2nd argument `order`"; - capi_order_as_array = ndarray_from_pyobj( NPY_INT,1,order_Dims,order_Rank, capi_order_intent,order_capi,capi_errmess); - if (capi_order_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - order = (int *)(PyArray_DATA(capi_order_as_array)); - - /* Processing variable ids */ - ids_Dims[0]=n; - capi_ids_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 4th argument `ids`"; - capi_ids_as_array = ndarray_from_pyobj( NPY_INT,1,ids_Dims,ids_Rank, capi_ids_intent,ids_capi,capi_errmess); - if (capi_ids_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ids = (int *)(PyArray_DATA(capi_ids_as_array)); - - /* Processing variable avgs */ - avgs_Dims[0]=n; - capi_avgs_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.cluster1d: failed to create array from the 5th argument `avgs`"; - capi_avgs_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,avgs_Dims,avgs_Rank, capi_avgs_intent,avgs_capi,capi_errmess); - if (capi_avgs_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - avgs = (double *)(PyArray_DATA(capi_avgs_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ar,n,order,tol,&nclusters,ids,avgs); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",nclusters); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_avgs_as_array!=avgs_capi) { - Py_XDECREF(capi_avgs_as_array); } - } /* if (capi_avgs_as_array == NULL) ... else of avgs */ - /* End of cleaning variable avgs */ - if((PyObject *)capi_ids_as_array!=ids_capi) { - Py_XDECREF(capi_ids_as_array); } - } /* if (capi_ids_as_array == NULL) ... else of ids */ - /* End of cleaning variable ids */ - if((PyObject *)capi_order_as_array!=order_capi) { - Py_XDECREF(capi_order_as_array); } - } /* if (capi_order_as_array == NULL) ... else of order */ - /* End of cleaning variable order */ - } /*CHECKSCALAR(shape(ar, 0) == n)*/ - /* End of cleaning variable n */ - /* End of cleaning variable nclusters */ - } /*if (f2py_success) of tol*/ - /* End of cleaning variable tol */ - if((PyObject *)capi_ar_as_array!=ar_capi) { - Py_XDECREF(capi_ar_as_array); } - } /* if (capi_ar_as_array == NULL) ... else of ar */ - /* End of cleaning variable ar */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of cluster1d ******************************/ - -/******************************** score_gvec_z ********************************/ -static char doc_f2py_rout__cImageD11_score_gvec_z[] = "\ -score_gvec_z(ubi,ub,gv,g0,g1,g2,e,recompute)\n\nWrapper for ``score_gvec_z``.\ -\n\nParameters\n----------\n" -"ubi : input rank-2 array('d') with bounds (3,3)\n" -"ub : input rank-2 array('d') with bounds (3,3)\n" -"gv : input rank-2 array('d') with bounds (n,3)\n" -"g0 : in/output rank-2 array('d') with bounds (n,3)\n" -"g1 : in/output rank-2 array('d') with bounds (n,3)\n" -"g2 : in/output rank-2 array('d') with bounds (n,3)\n" -"e : in/output rank-2 array('d') with bounds (n,3)\n" -"recompute : input int"; -/* extern void score_gvec_z(double*,double*,double*,double*,double*,double*,double*,int,int); */ -static PyObject *f2py_rout__cImageD11_score_gvec_z(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *ubi = NULL; - npy_intp ubi_Dims[2] = {-1, -1}; - const int ubi_Rank = 2; - PyArrayObject *capi_ubi_as_array = NULL; - int capi_ubi_intent = 0; - PyObject *ubi_capi = Py_None; - double *ub = NULL; - npy_intp ub_Dims[2] = {-1, -1}; - const int ub_Rank = 2; - PyArrayObject *capi_ub_as_array = NULL; - int capi_ub_intent = 0; - PyObject *ub_capi = Py_None; - double *gv = NULL; - npy_intp gv_Dims[2] = {-1, -1}; - const int gv_Rank = 2; - PyArrayObject *capi_gv_as_array = NULL; - int capi_gv_intent = 0; - PyObject *gv_capi = Py_None; - double *g0 = NULL; - npy_intp g0_Dims[2] = {-1, -1}; - const int g0_Rank = 2; - PyArrayObject *capi_g0_as_array = NULL; - int capi_g0_intent = 0; - PyObject *g0_capi = Py_None; - double *g1 = NULL; - npy_intp g1_Dims[2] = {-1, -1}; - const int g1_Rank = 2; - PyArrayObject *capi_g1_as_array = NULL; - int capi_g1_intent = 0; - PyObject *g1_capi = Py_None; - double *g2 = NULL; - npy_intp g2_Dims[2] = {-1, -1}; - const int g2_Rank = 2; - PyArrayObject *capi_g2_as_array = NULL; - int capi_g2_intent = 0; - PyObject *g2_capi = Py_None; - double *e = NULL; - npy_intp e_Dims[2] = {-1, -1}; - const int e_Rank = 2; - PyArrayObject *capi_e_as_array = NULL; - int capi_e_intent = 0; - PyObject *e_capi = Py_None; - int recompute = 0; - PyObject *recompute_capi = Py_None; - int n = 0; - static char *capi_kwlist[] = {"ubi","ub","gv","g0","g1","g2","e","recompute",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|:_cImageD11.score_gvec_z",\ - capi_kwlist,&ubi_capi,&ub_capi,&gv_capi,&g0_capi,&g1_capi,&g2_capi,&e_capi,&recompute_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable ubi */ - ubi_Dims[0]=3,ubi_Dims[1]=3; - capi_ubi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 1st argument `ubi`"; - capi_ubi_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ubi_Dims,ubi_Rank, capi_ubi_intent,ubi_capi,capi_errmess); - if (capi_ubi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ubi = (double *)(PyArray_DATA(capi_ubi_as_array)); - - /* Processing variable ub */ - ub_Dims[0]=3,ub_Dims[1]=3; - capi_ub_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 2nd argument `ub`"; - capi_ub_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,ub_Dims,ub_Rank, capi_ub_intent,ub_capi,capi_errmess); - if (capi_ub_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ub = (double *)(PyArray_DATA(capi_ub_as_array)); - - /* Processing variable gv */ - gv_Dims[1]=3; - capi_gv_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 3rd argument `gv`"; - capi_gv_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gv_Dims,gv_Rank, capi_gv_intent,gv_capi,capi_errmess); - if (capi_gv_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gv = (double *)(PyArray_DATA(capi_gv_as_array)); - - /* Processing variable recompute */ - f2py_success = int_from_pyobj(&recompute,recompute_capi,"_cImageD11.score_gvec_z() 8th argument (recompute) can't be converted to int"); - if (f2py_success) { - /* Processing variable n */ - n = shape(gv, 0); - CHECKSCALAR(shape(gv, 0) == n,"shape(gv, 0) == n","hidden n","score_gvec_z:n=%d",n) { - /* Processing variable g0 */ - g0_Dims[0]=n,g0_Dims[1]=3; - capi_g0_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 4th argument `g0`"; - capi_g0_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,g0_Dims,g0_Rank, capi_g0_intent,g0_capi,capi_errmess); - if (capi_g0_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - g0 = (double *)(PyArray_DATA(capi_g0_as_array)); - - /* Processing variable g1 */ - g1_Dims[0]=n,g1_Dims[1]=3; - capi_g1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 5th argument `g1`"; - capi_g1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,g1_Dims,g1_Rank, capi_g1_intent,g1_capi,capi_errmess); - if (capi_g1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - g1 = (double *)(PyArray_DATA(capi_g1_as_array)); - - /* Processing variable g2 */ - g2_Dims[0]=n,g2_Dims[1]=3; - capi_g2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 6th argument `g2`"; - capi_g2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,g2_Dims,g2_Rank, capi_g2_intent,g2_capi,capi_errmess); - if (capi_g2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - g2 = (double *)(PyArray_DATA(capi_g2_as_array)); - - /* Processing variable e */ - e_Dims[0]=n,e_Dims[1]=3; - capi_e_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.score_gvec_z: failed to create array from the 7th argument `e`"; - capi_e_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,e_Dims,e_Rank, capi_e_intent,e_capi,capi_errmess); - if (capi_e_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - e = (double *)(PyArray_DATA(capi_e_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(ubi,ub,gv,g0,g1,g2,e,recompute,n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_e_as_array!=e_capi) { - Py_XDECREF(capi_e_as_array); } - } /* if (capi_e_as_array == NULL) ... else of e */ - /* End of cleaning variable e */ - if((PyObject *)capi_g2_as_array!=g2_capi) { - Py_XDECREF(capi_g2_as_array); } - } /* if (capi_g2_as_array == NULL) ... else of g2 */ - /* End of cleaning variable g2 */ - if((PyObject *)capi_g1_as_array!=g1_capi) { - Py_XDECREF(capi_g1_as_array); } - } /* if (capi_g1_as_array == NULL) ... else of g1 */ - /* End of cleaning variable g1 */ - if((PyObject *)capi_g0_as_array!=g0_capi) { - Py_XDECREF(capi_g0_as_array); } - } /* if (capi_g0_as_array == NULL) ... else of g0 */ - /* End of cleaning variable g0 */ - } /*CHECKSCALAR(shape(gv, 0) == n)*/ - /* End of cleaning variable n */ - } /*if (f2py_success) of recompute*/ - /* End of cleaning variable recompute */ - if((PyObject *)capi_gv_as_array!=gv_capi) { - Py_XDECREF(capi_gv_as_array); } - } /* if (capi_gv_as_array == NULL) ... else of gv */ - /* End of cleaning variable gv */ - if((PyObject *)capi_ub_as_array!=ub_capi) { - Py_XDECREF(capi_ub_as_array); } - } /* if (capi_ub_as_array == NULL) ... else of ub */ - /* End of cleaning variable ub */ - if((PyObject *)capi_ubi_as_array!=ubi_capi) { - Py_XDECREF(capi_ubi_as_array); } - } /* if (capi_ubi_as_array == NULL) ... else of ubi */ - /* End of cleaning variable ubi */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of score_gvec_z ****************************/ - -/******************************** misori_cubic ********************************/ -static char doc_f2py_rout__cImageD11_misori_cubic[] = "\ -misori_cubic = misori_cubic(u1,u2)\n\nWrapper for ``misori_cubic``.\ -\n\nParameters\n----------\n" -"u1 : input rank-2 array('d') with bounds (3,3)\n" -"u2 : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"misori_cubic : float"; -/* extern double misori_cubic(double*,double*); */ -static PyObject *f2py_rout__cImageD11_misori_cubic(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - double (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double misori_cubic_return_value=0; - double *u1 = NULL; - npy_intp u1_Dims[2] = {-1, -1}; - const int u1_Rank = 2; - PyArrayObject *capi_u1_as_array = NULL; - int capi_u1_intent = 0; - PyObject *u1_capi = Py_None; - double *u2 = NULL; - npy_intp u2_Dims[2] = {-1, -1}; - const int u2_Rank = 2; - PyArrayObject *capi_u2_as_array = NULL; - int capi_u2_intent = 0; - PyObject *u2_capi = Py_None; - static char *capi_kwlist[] = {"u1","u2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.misori_cubic",\ - capi_kwlist,&u1_capi,&u2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable u1 */ - u1_Dims[0]=3,u1_Dims[1]=3; - capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic: failed to create array from the 1st argument `u1`"; - capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); - if (capi_u1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u1 = (double *)(PyArray_DATA(capi_u1_as_array)); - - /* Processing variable u2 */ - u2_Dims[0]=3,u2_Dims[1]=3; - capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic: failed to create array from the 2nd argument `u2`"; - capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); - if (capi_u2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u2 = (double *)(PyArray_DATA(capi_u2_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - misori_cubic_return_value = (*f2py_func)(u1,u2); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",misori_cubic_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_u2_as_array!=u2_capi) { - Py_XDECREF(capi_u2_as_array); } - } /* if (capi_u2_as_array == NULL) ... else of u2 */ - /* End of cleaning variable u2 */ - if((PyObject *)capi_u1_as_array!=u1_capi) { - Py_XDECREF(capi_u1_as_array); } - } /* if (capi_u1_as_array == NULL) ... else of u1 */ - /* End of cleaning variable u1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of misori_cubic ****************************/ - -/**************************** misori_orthorhombic ****************************/ -static char doc_f2py_rout__cImageD11_misori_orthorhombic[] = "\ -misori_orthorhombic = misori_orthorhombic(u1,u2)\n\nWrapper for ``misori_orthorhombic``.\ -\n\nParameters\n----------\n" -"u1 : input rank-2 array('d') with bounds (3,3)\n" -"u2 : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"misori_orthorhombic : float"; -/* extern double misori_orthorhombic(double*,double*); */ -static PyObject *f2py_rout__cImageD11_misori_orthorhombic(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - double (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double misori_orthorhombic_return_value=0; - double *u1 = NULL; - npy_intp u1_Dims[2] = {-1, -1}; - const int u1_Rank = 2; - PyArrayObject *capi_u1_as_array = NULL; - int capi_u1_intent = 0; - PyObject *u1_capi = Py_None; - double *u2 = NULL; - npy_intp u2_Dims[2] = {-1, -1}; - const int u2_Rank = 2; - PyArrayObject *capi_u2_as_array = NULL; - int capi_u2_intent = 0; - PyObject *u2_capi = Py_None; - static char *capi_kwlist[] = {"u1","u2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.misori_orthorhombic",\ - capi_kwlist,&u1_capi,&u2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable u1 */ - u1_Dims[0]=3,u1_Dims[1]=3; - capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_orthorhombic: failed to create array from the 1st argument `u1`"; - capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); - if (capi_u1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u1 = (double *)(PyArray_DATA(capi_u1_as_array)); - - /* Processing variable u2 */ - u2_Dims[0]=3,u2_Dims[1]=3; - capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_orthorhombic: failed to create array from the 2nd argument `u2`"; - capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); - if (capi_u2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u2 = (double *)(PyArray_DATA(capi_u2_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - misori_orthorhombic_return_value = (*f2py_func)(u1,u2); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",misori_orthorhombic_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_u2_as_array!=u2_capi) { - Py_XDECREF(capi_u2_as_array); } - } /* if (capi_u2_as_array == NULL) ... else of u2 */ - /* End of cleaning variable u2 */ - if((PyObject *)capi_u1_as_array!=u1_capi) { - Py_XDECREF(capi_u1_as_array); } - } /* if (capi_u1_as_array == NULL) ... else of u1 */ - /* End of cleaning variable u1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of misori_orthorhombic *************************/ - -/***************************** misori_tetragonal *****************************/ -static char doc_f2py_rout__cImageD11_misori_tetragonal[] = "\ -misori_tetragonal = misori_tetragonal(u1,u2)\n\nWrapper for ``misori_tetragonal``.\ -\n\nParameters\n----------\n" -"u1 : input rank-2 array('d') with bounds (3,3)\n" -"u2 : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"misori_tetragonal : float"; -/* extern double misori_tetragonal(double*,double*); */ -static PyObject *f2py_rout__cImageD11_misori_tetragonal(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - double (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double misori_tetragonal_return_value=0; - double *u1 = NULL; - npy_intp u1_Dims[2] = {-1, -1}; - const int u1_Rank = 2; - PyArrayObject *capi_u1_as_array = NULL; - int capi_u1_intent = 0; - PyObject *u1_capi = Py_None; - double *u2 = NULL; - npy_intp u2_Dims[2] = {-1, -1}; - const int u2_Rank = 2; - PyArrayObject *capi_u2_as_array = NULL; - int capi_u2_intent = 0; - PyObject *u2_capi = Py_None; - static char *capi_kwlist[] = {"u1","u2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.misori_tetragonal",\ - capi_kwlist,&u1_capi,&u2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable u1 */ - u1_Dims[0]=3,u1_Dims[1]=3; - capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_tetragonal: failed to create array from the 1st argument `u1`"; - capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); - if (capi_u1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u1 = (double *)(PyArray_DATA(capi_u1_as_array)); - - /* Processing variable u2 */ - u2_Dims[0]=3,u2_Dims[1]=3; - capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_tetragonal: failed to create array from the 2nd argument `u2`"; - capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); - if (capi_u2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u2 = (double *)(PyArray_DATA(capi_u2_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - misori_tetragonal_return_value = (*f2py_func)(u1,u2); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",misori_tetragonal_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_u2_as_array!=u2_capi) { - Py_XDECREF(capi_u2_as_array); } - } /* if (capi_u2_as_array == NULL) ... else of u2 */ - /* End of cleaning variable u2 */ - if((PyObject *)capi_u1_as_array!=u1_capi) { - Py_XDECREF(capi_u1_as_array); } - } /* if (capi_u1_as_array == NULL) ... else of u1 */ - /* End of cleaning variable u1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of misori_tetragonal **************************/ - -/***************************** misori_monoclinic *****************************/ -static char doc_f2py_rout__cImageD11_misori_monoclinic[] = "\ -misori_monoclinic = misori_monoclinic(u1,u2)\n\nWrapper for ``misori_monoclinic``.\ -\n\nParameters\n----------\n" -"u1 : input rank-2 array('d') with bounds (3,3)\n" -"u2 : input rank-2 array('d') with bounds (3,3)\n" -"\nReturns\n-------\n" -"misori_monoclinic : float"; -/* extern double misori_monoclinic(double*,double*); */ -static PyObject *f2py_rout__cImageD11_misori_monoclinic(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - double (*f2py_func)(double*,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double misori_monoclinic_return_value=0; - double *u1 = NULL; - npy_intp u1_Dims[2] = {-1, -1}; - const int u1_Rank = 2; - PyArrayObject *capi_u1_as_array = NULL; - int capi_u1_intent = 0; - PyObject *u1_capi = Py_None; - double *u2 = NULL; - npy_intp u2_Dims[2] = {-1, -1}; - const int u2_Rank = 2; - PyArrayObject *capi_u2_as_array = NULL; - int capi_u2_intent = 0; - PyObject *u2_capi = Py_None; - static char *capi_kwlist[] = {"u1","u2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.misori_monoclinic",\ - capi_kwlist,&u1_capi,&u2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable u1 */ - u1_Dims[0]=3,u1_Dims[1]=3; - capi_u1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_monoclinic: failed to create array from the 1st argument `u1`"; - capi_u1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u1_Dims,u1_Rank, capi_u1_intent,u1_capi,capi_errmess); - if (capi_u1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u1 = (double *)(PyArray_DATA(capi_u1_as_array)); - - /* Processing variable u2 */ - u2_Dims[0]=3,u2_Dims[1]=3; - capi_u2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_monoclinic: failed to create array from the 2nd argument `u2`"; - capi_u2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u2_Dims,u2_Rank, capi_u2_intent,u2_capi,capi_errmess); - if (capi_u2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u2 = (double *)(PyArray_DATA(capi_u2_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - misori_monoclinic_return_value = (*f2py_func)(u1,u2); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("d",misori_monoclinic_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_u2_as_array!=u2_capi) { - Py_XDECREF(capi_u2_as_array); } - } /* if (capi_u2_as_array == NULL) ... else of u2 */ - /* End of cleaning variable u2 */ - if((PyObject *)capi_u1_as_array!=u1_capi) { - Py_XDECREF(capi_u1_as_array); } - } /* if (capi_u1_as_array == NULL) ... else of u1 */ - /* End of cleaning variable u1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of misori_monoclinic **************************/ - -/***************************** misori_cubic_pairs *****************************/ -static char doc_f2py_rout__cImageD11_misori_cubic_pairs[] = "\ -misori_cubic_pairs(u,dist,[n])\n\nWrapper for ``misori_cubic_pairs``.\ -\n\nParameters\n----------\n" -"u : input rank-3 array('d') with bounds (n,3,3)\n" -"dist : in/output rank-1 array('d') with bounds ((-n + n * n) / 2)\n" -"\nOther Parameters\n----------------\n" -"n : input int, optional\n Default: shape(u, 0)"; -/* extern void misori_cubic_pairs(double*,double*,int); */ -static PyObject *f2py_rout__cImageD11_misori_cubic_pairs(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *u = NULL; - npy_intp u_Dims[3] = {-1, -1, -1}; - const int u_Rank = 3; - PyArrayObject *capi_u_as_array = NULL; - int capi_u_intent = 0; - PyObject *u_capi = Py_None; - double *dist = NULL; - npy_intp dist_Dims[1] = {-1}; - const int dist_Rank = 1; - PyArrayObject *capi_dist_as_array = NULL; - int capi_dist_intent = 0; - PyObject *dist_capi = Py_None; - int n = 0; - PyObject *n_capi = Py_None; - static char *capi_kwlist[] = {"u","dist","n",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|O:_cImageD11.misori_cubic_pairs",\ - capi_kwlist,&u_capi,&dist_capi,&n_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable u */ - u_Dims[1]=3,u_Dims[2]=3; - capi_u_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic_pairs: failed to create array from the 1st argument `u`"; - capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); - if (capi_u_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u = (double *)(PyArray_DATA(capi_u_as_array)); - - /* Processing variable n */ - if (n_capi == Py_None) n = shape(u, 0); else - f2py_success = int_from_pyobj(&n,n_capi,"_cImageD11.misori_cubic_pairs() 1st keyword (n) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(u, 0) == n,"shape(u, 0) == n","1st keyword n","misori_cubic_pairs:n=%d",n) { - /* Processing variable dist */ - dist_Dims[0]=(-n + n * n) / 2; - capi_dist_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.misori_cubic_pairs: failed to create array from the 2nd argument `dist`"; - capi_dist_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,dist_Dims,dist_Rank, capi_dist_intent,dist_capi,capi_errmess); - if (capi_dist_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - dist = (double *)(PyArray_DATA(capi_dist_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(u,dist,n); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_dist_as_array!=dist_capi) { - Py_XDECREF(capi_dist_as_array); } - } /* if (capi_dist_as_array == NULL) ... else of dist */ - /* End of cleaning variable dist */ - } /*CHECKSCALAR(shape(u, 0) == n)*/ - } /*if (f2py_success) of n*/ - /* End of cleaning variable n */ - if((PyObject *)capi_u_as_array!=u_capi) { - Py_XDECREF(capi_u_as_array); } - } /* if (capi_u_as_array == NULL) ... else of u */ - /* End of cleaning variable u */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of misori_cubic_pairs *************************/ - -/******************************** count_shared ********************************/ -static char doc_f2py_rout__cImageD11_count_shared[] = "\ -count_shared = count_shared(pi,pj,[ni,nj])\n\nWrapper for ``count_shared``.\ -\n\nParameters\n----------\n" -"pi : input rank-1 array('i') with bounds (ni)\n" -"pj : input rank-1 array('i') with bounds (nj)\n" -"\nOther Parameters\n----------------\n" -"ni : input int, optional\n Default: shape(pi, 0)\n" -"nj : input int, optional\n Default: shape(pj, 0)\n" -"\nReturns\n-------\n" -"count_shared : int"; -/* extern int count_shared(int*,int,int*,int); */ -static PyObject *f2py_rout__cImageD11_count_shared(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(int*,int,int*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int count_shared_return_value=0; - int *pi = NULL; - npy_intp pi_Dims[1] = {-1}; - const int pi_Rank = 1; - PyArrayObject *capi_pi_as_array = NULL; - int capi_pi_intent = 0; - PyObject *pi_capi = Py_None; - int ni = 0; - PyObject *ni_capi = Py_None; - int *pj = NULL; - npy_intp pj_Dims[1] = {-1}; - const int pj_Rank = 1; - PyArrayObject *capi_pj_as_array = NULL; - int capi_pj_intent = 0; - PyObject *pj_capi = Py_None; - int nj = 0; - PyObject *nj_capi = Py_None; - static char *capi_kwlist[] = {"pi","pj","ni","nj",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|OO:_cImageD11.count_shared",\ - capi_kwlist,&pi_capi,&pj_capi,&ni_capi,&nj_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable pi */ - ; - capi_pi_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.count_shared: failed to create array from the 1st argument `pi`"; - capi_pi_as_array = ndarray_from_pyobj( NPY_INT,1,pi_Dims,pi_Rank, capi_pi_intent,pi_capi,capi_errmess); - if (capi_pi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pi = (int *)(PyArray_DATA(capi_pi_as_array)); - - /* Processing variable pj */ - ; - capi_pj_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.count_shared: failed to create array from the 2nd argument `pj`"; - capi_pj_as_array = ndarray_from_pyobj( NPY_INT,1,pj_Dims,pj_Rank, capi_pj_intent,pj_capi,capi_errmess); - if (capi_pj_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - pj = (int *)(PyArray_DATA(capi_pj_as_array)); - - /* Processing variable ni */ - if (ni_capi == Py_None) ni = shape(pi, 0); else - f2py_success = int_from_pyobj(&ni,ni_capi,"_cImageD11.count_shared() 1st keyword (ni) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(pi, 0) == ni,"shape(pi, 0) == ni","1st keyword ni","count_shared:ni=%d",ni) { - /* Processing variable nj */ - if (nj_capi == Py_None) nj = shape(pj, 0); else - f2py_success = int_from_pyobj(&nj,nj_capi,"_cImageD11.count_shared() 2nd keyword (nj) can't be converted to int"); - if (f2py_success) { - CHECKSCALAR(shape(pj, 0) == nj,"shape(pj, 0) == nj","2nd keyword nj","count_shared:nj=%d",nj) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - count_shared_return_value = (*f2py_func)(pi,ni,pj,nj); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",count_shared_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(pj, 0) == nj)*/ - } /*if (f2py_success) of nj*/ - /* End of cleaning variable nj */ - } /*CHECKSCALAR(shape(pi, 0) == ni)*/ - } /*if (f2py_success) of ni*/ - /* End of cleaning variable ni */ - if((PyObject *)capi_pj_as_array!=pj_capi) { - Py_XDECREF(capi_pj_as_array); } - } /* if (capi_pj_as_array == NULL) ... else of pj */ - /* End of cleaning variable pj */ - if((PyObject *)capi_pi_as_array!=pi_capi) { - Py_XDECREF(capi_pi_as_array); } - } /* if (capi_pi_as_array == NULL) ... else of pi */ - /* End of cleaning variable pi */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of count_shared ****************************/ - -/****************************** connectedpixels ******************************/ -static char doc_f2py_rout__cImageD11_connectedpixels[] = "\ -connectedpixels = connectedpixels(data,labels,threshold,[verbose,con8])\n\nWrapper for ``connectedpixels``.\ -\n\nParameters\n----------\n" -"data : input rank-2 array('f') with bounds (ns,nf)\n" -"labels : in/output rank-2 array('i') with bounds (ns,nf)\n" -"threshold : input float\n" -"\nOther Parameters\n----------------\n" -"verbose : input int, optional\n Default: 0\n" -"con8 : input int, optional\n Default: 1\n" -"\nReturns\n-------\n" -"connectedpixels : int"; -/* extern int connectedpixels(float*,int*,float,int,int,int,int); */ -static PyObject *f2py_rout__cImageD11_connectedpixels(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(float*,int*,float,int,int,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int connectedpixels_return_value=0; - float *data = NULL; - npy_intp data_Dims[2] = {-1, -1}; - const int data_Rank = 2; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *labels = NULL; - npy_intp labels_Dims[2] = {-1, -1}; - const int labels_Rank = 2; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - float threshold = 0; - PyObject *threshold_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - int con8 = 0; - PyObject *con8_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"data","labels","threshold","verbose","con8",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:_cImageD11.connectedpixels",\ - capi_kwlist,&data_capi,&labels_capi,&threshold_capi,&verbose_capi,&con8_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.connectedpixels: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (float *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable threshold */ - f2py_success = float_from_pyobj(&threshold,threshold_capi,"_cImageD11.connectedpixels() 3rd argument (threshold) can't be converted to float"); - if (f2py_success) { - /* Processing variable verbose */ - if (verbose_capi == Py_None) verbose = 0; else - f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.connectedpixels() 1st keyword (verbose) can't be converted to int"); - if (f2py_success) { - /* Processing variable con8 */ - if (con8_capi == Py_None) con8 = 1; else - f2py_success = int_from_pyobj(&con8,con8_capi,"_cImageD11.connectedpixels() 2nd keyword (con8) can't be converted to int"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(data,0); - /* Processing variable nf */ - nf = shape(data,1); - /* Processing variable labels */ - labels_Dims[0]=ns,labels_Dims[1]=nf; - capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.connectedpixels: failed to create array from the 2nd argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - connectedpixels_return_value = (*f2py_func)(data,labels,threshold,verbose,con8,ns,nf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",connectedpixels_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of con8*/ - /* End of cleaning variable con8 */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of threshold*/ - /* End of cleaning variable threshold */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of connectedpixels ***************************/ - -/******************************* blobproperties *******************************/ -static char doc_f2py_rout__cImageD11_blobproperties[] = "\ -results = blobproperties(data,labels,np,[omega,verbose])\n\nWrapper for ``blobproperties``.\ -\n\nParameters\n----------\n" -"data : input rank-2 array('f') with bounds (ns,nf)\n" -"labels : input rank-2 array('i') with bounds (ns,nf)\n" -"np : input int\n" -"\nOther Parameters\n----------------\n" -"omega : input float, optional\n Default: 0\n" -"verbose : input int, optional\n Default: 0\n" -"\nReturns\n-------\n" -"results : rank-2 array('d') with bounds (np,NPROPERTY)"; -/* extern void blobproperties(float*,int*,int,float,int,int,int,double*); */ -static PyObject *f2py_rout__cImageD11_blobproperties(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,int*,int,float,int,int,int,double*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *data = NULL; - npy_intp data_Dims[2] = {-1, -1}; - const int data_Rank = 2; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *labels = NULL; - npy_intp labels_Dims[2] = {-1, -1}; - const int labels_Rank = 2; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - int np = 0; - PyObject *np_capi = Py_None; - float omega = 0; - PyObject *omega_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - int ns = 0; - int nf = 0; - double *results = NULL; - npy_intp results_Dims[2] = {-1, -1}; - const int results_Rank = 2; - PyArrayObject *capi_results_as_array = NULL; - int capi_results_intent = 0; - static char *capi_kwlist[] = {"data","labels","np","omega","verbose",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|OO:_cImageD11.blobproperties",\ - capi_kwlist,&data_capi,&labels_capi,&np_capi,&omega_capi,&verbose_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.blobproperties: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (float *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable np */ - f2py_success = int_from_pyobj(&np,np_capi,"_cImageD11.blobproperties() 3rd argument (np) can't be converted to int"); - if (f2py_success) { - /* Processing variable omega */ - if (omega_capi == Py_None) omega = 0; else - f2py_success = float_from_pyobj(&omega,omega_capi,"_cImageD11.blobproperties() 1st keyword (omega) can't be converted to float"); - if (f2py_success) { - /* Processing variable verbose */ - if (verbose_capi == Py_None) verbose = 0; else - f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.blobproperties() 2nd keyword (verbose) can't be converted to int"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(data,0); - /* Processing variable nf */ - nf = shape(data,1); - /* Processing variable results */ - results_Dims[0]=np,results_Dims[1]=NPROPERTY; - capi_results_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.blobproperties: failed to create array from the hidden `results`"; - capi_results_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results_Dims,results_Rank, capi_results_intent,Py_None,capi_errmess); - if (capi_results_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - results = (double *)(PyArray_DATA(capi_results_as_array)); - - /* Processing variable labels */ - labels_Dims[0]=ns,labels_Dims[1]=nf; - capi_labels_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.blobproperties: failed to create array from the 2nd argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(data,labels,np,omega,verbose,ns,nf,results); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_results_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - } /* if (capi_results_as_array == NULL) ... else of results */ - /* End of cleaning variable results */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - } /*if (f2py_success) of omega*/ - /* End of cleaning variable omega */ - } /*if (f2py_success) of np*/ - /* End of cleaning variable np */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of blobproperties ***************************/ - -/******************************** bloboverlaps ********************************/ -static char doc_f2py_rout__cImageD11_bloboverlaps[] = "\ -bloboverlaps = bloboverlaps(labels1,npk1,results1,labels2,npk2,results2,[verbose])\n\nWrapper for ``bloboverlaps``.\ -\n\nParameters\n----------\n" -"labels1 : in/output rank-2 array('i') with bounds (ns,nf)\n" -"npk1 : input int\n" -"results1 : in/output rank-2 array('d') with bounds (:,NPROPERTY)\n" -"labels2 : in/output rank-2 array('i') with bounds (ns,nf)\n" -"npk2 : input int\n" -"results2 : in/output rank-2 array('d') with bounds (:,NPROPERTY)\n" -"\nOther Parameters\n----------------\n" -"verbose : input int, optional\n Default: 0\n" -"\nReturns\n-------\n" -"bloboverlaps : int"; -/* extern int bloboverlaps(int*,int,double*,int*,int,double*,int,int,int); */ -static PyObject *f2py_rout__cImageD11_bloboverlaps(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(int*,int,double*,int*,int,double*,int,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int bloboverlaps_return_value=0; - int *labels1 = NULL; - npy_intp labels1_Dims[2] = {-1, -1}; - const int labels1_Rank = 2; - PyArrayObject *capi_labels1_as_array = NULL; - int capi_labels1_intent = 0; - PyObject *labels1_capi = Py_None; - int npk1 = 0; - PyObject *npk1_capi = Py_None; - double *results1 = NULL; - npy_intp results1_Dims[2] = {-1, -1}; - const int results1_Rank = 2; - PyArrayObject *capi_results1_as_array = NULL; - int capi_results1_intent = 0; - PyObject *results1_capi = Py_None; - int *labels2 = NULL; - npy_intp labels2_Dims[2] = {-1, -1}; - const int labels2_Rank = 2; - PyArrayObject *capi_labels2_as_array = NULL; - int capi_labels2_intent = 0; - PyObject *labels2_capi = Py_None; - int npk2 = 0; - PyObject *npk2_capi = Py_None; - double *results2 = NULL; - npy_intp results2_Dims[2] = {-1, -1}; - const int results2_Rank = 2; - PyArrayObject *capi_results2_as_array = NULL; - int capi_results2_intent = 0; - PyObject *results2_capi = Py_None; - int verbose = 0; - PyObject *verbose_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"labels1","npk1","results1","labels2","npk2","results2","verbose",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|O:_cImageD11.bloboverlaps",\ - capi_kwlist,&labels1_capi,&npk1_capi,&results1_capi,&labels2_capi,&npk2_capi,&results2_capi,&verbose_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable labels1 */ - ; - capi_labels1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 1st argument `labels1`"; - capi_labels1_as_array = ndarray_from_pyobj( NPY_INT,1,labels1_Dims,labels1_Rank, capi_labels1_intent,labels1_capi,capi_errmess); - if (capi_labels1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels1 = (int *)(PyArray_DATA(capi_labels1_as_array)); - - /* Processing variable npk1 */ - f2py_success = int_from_pyobj(&npk1,npk1_capi,"_cImageD11.bloboverlaps() 2nd argument (npk1) can't be converted to int"); - if (f2py_success) { - /* Processing variable results1 */ - results1_Dims[1]=NPROPERTY; - capi_results1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 3rd argument `results1`"; - capi_results1_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results1_Dims,results1_Rank, capi_results1_intent,results1_capi,capi_errmess); - if (capi_results1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - results1 = (double *)(PyArray_DATA(capi_results1_as_array)); - - /* Processing variable npk2 */ - f2py_success = int_from_pyobj(&npk2,npk2_capi,"_cImageD11.bloboverlaps() 5th argument (npk2) can't be converted to int"); - if (f2py_success) { - /* Processing variable results2 */ - results2_Dims[1]=NPROPERTY; - capi_results2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 6th argument `results2`"; - capi_results2_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results2_Dims,results2_Rank, capi_results2_intent,results2_capi,capi_errmess); - if (capi_results2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - results2 = (double *)(PyArray_DATA(capi_results2_as_array)); - - /* Processing variable verbose */ - if (verbose_capi == Py_None) verbose = 0; else - f2py_success = int_from_pyobj(&verbose,verbose_capi,"_cImageD11.bloboverlaps() 1st keyword (verbose) can't be converted to int"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(labels1,0); - /* Processing variable nf */ - nf = shape(labels1,1); - /* Processing variable labels2 */ - labels2_Dims[0]=ns,labels2_Dims[1]=nf; - capi_labels2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.bloboverlaps: failed to create array from the 4th argument `labels2`"; - capi_labels2_as_array = ndarray_from_pyobj( NPY_INT,1,labels2_Dims,labels2_Rank, capi_labels2_intent,labels2_capi,capi_errmess); - if (capi_labels2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels2 = (int *)(PyArray_DATA(capi_labels2_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - bloboverlaps_return_value = (*f2py_func)(labels1,npk1,results1,labels2,npk2,results2,verbose,ns,nf); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",bloboverlaps_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_labels2_as_array!=labels2_capi) { - Py_XDECREF(capi_labels2_as_array); } - } /* if (capi_labels2_as_array == NULL) ... else of labels2 */ - /* End of cleaning variable labels2 */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of verbose*/ - /* End of cleaning variable verbose */ - if((PyObject *)capi_results2_as_array!=results2_capi) { - Py_XDECREF(capi_results2_as_array); } - } /* if (capi_results2_as_array == NULL) ... else of results2 */ - /* End of cleaning variable results2 */ - } /*if (f2py_success) of npk2*/ - /* End of cleaning variable npk2 */ - if((PyObject *)capi_results1_as_array!=results1_capi) { - Py_XDECREF(capi_results1_as_array); } - } /* if (capi_results1_as_array == NULL) ... else of results1 */ - /* End of cleaning variable results1 */ - } /*if (f2py_success) of npk1*/ - /* End of cleaning variable npk1 */ - if((PyObject *)capi_labels1_as_array!=labels1_capi) { - Py_XDECREF(capi_labels1_as_array); } - } /* if (capi_labels1_as_array == NULL) ... else of labels1 */ - /* End of cleaning variable labels1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of bloboverlaps ****************************/ - -/******************************** blob_moments ********************************/ -static char doc_f2py_rout__cImageD11_blob_moments[] = "\ -blob_moments(results)\n\nWrapper for ``blob_moments``.\ -\n\nParameters\n----------\n" -"results : in/output rank-2 array('d') with bounds (np,NPROPERTY)"; -/* extern void blob_moments(double*,int); */ -static PyObject *f2py_rout__cImageD11_blob_moments(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - double *results = NULL; - npy_intp results_Dims[2] = {-1, -1}; - const int results_Rank = 2; - PyArrayObject *capi_results_as_array = NULL; - int capi_results_intent = 0; - PyObject *results_capi = Py_None; - int np = 0; - static char *capi_kwlist[] = {"results",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "O|:_cImageD11.blob_moments",\ - capi_kwlist,&results_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable results */ - results_Dims[1]=NPROPERTY; - capi_results_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.blob_moments: failed to create array from the 1st argument `results`"; - capi_results_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results_Dims,results_Rank, capi_results_intent,results_capi,capi_errmess); - if (capi_results_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - results = (double *)(PyArray_DATA(capi_results_as_array)); - - /* Processing variable np */ - np = shape(results,0); -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(results,np); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - /* End of cleaning variable np */ - if((PyObject *)capi_results_as_array!=results_capi) { - Py_XDECREF(capi_results_as_array); } - } /* if (capi_results_as_array == NULL) ... else of results */ - /* End of cleaning variable results */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of blob_moments ****************************/ - -/********************************* clean_mask *********************************/ -static char doc_f2py_rout__cImageD11_clean_mask[] = "\ -clean_mask = clean_mask(msk,ret)\n\nWrapper for ``clean_mask``.\ -\n\nParameters\n----------\n" -"msk : input rank-2 array('b') with bounds (ns,nf)\n" -"ret : in/output rank-2 array('b') with bounds (ns,nf)\n" -"\nReturns\n-------\n" -"clean_mask : int"; -/* extern int clean_mask(signed_char*,signed_char*,int,int); */ -static PyObject *f2py_rout__cImageD11_clean_mask(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(signed_char*,signed_char*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int clean_mask_return_value=0; - signed_char *msk = NULL; - npy_intp msk_Dims[2] = {-1, -1}; - const int msk_Rank = 2; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - signed_char *ret = NULL; - npy_intp ret_Dims[2] = {-1, -1}; - const int ret_Rank = 2; - PyArrayObject *capi_ret_as_array = NULL; - int capi_ret_intent = 0; - PyObject *ret_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"msk","ret",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.clean_mask",\ - capi_kwlist,&msk_capi,&ret_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable msk */ - ; - capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.clean_mask: failed to create array from the 1st argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); - - /* Processing variable ns */ - ns = shape(msk,0); - /* Processing variable nf */ - nf = shape(msk,1); - /* Processing variable ret */ - ret_Dims[0]=ns,ret_Dims[1]=nf; - capi_ret_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.clean_mask: failed to create array from the 2nd argument `ret`"; - capi_ret_as_array = ndarray_from_pyobj( NPY_BYTE,1,ret_Dims,ret_Rank, capi_ret_intent,ret_capi,capi_errmess); - if (capi_ret_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ret = (signed_char *)(PyArray_DATA(capi_ret_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - clean_mask_return_value = (*f2py_func)(msk,ret,ns,nf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",clean_mask_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_ret_as_array!=ret_capi) { - Py_XDECREF(capi_ret_as_array); } - } /* if (capi_ret_as_array == NULL) ... else of ret */ - /* End of cleaning variable ret */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of clean_mask *****************************/ - -/****************************** make_clean_mask ******************************/ -static char doc_f2py_rout__cImageD11_make_clean_mask[] = "\ -make_clean_mask = make_clean_mask(img,cut,msk,ret)\n\nWrapper for ``make_clean_mask``.\ -\n\nParameters\n----------\n" -"img : input rank-2 array('f') with bounds (ns,nf)\n" -"cut : input float\n" -"msk : input rank-2 array('b') with bounds (ns,nf)\n" -"ret : in/output rank-2 array('b') with bounds (ns,nf)\n" -"\nReturns\n-------\n" -"make_clean_mask : int"; -/* extern int make_clean_mask(float*,float,signed_char*,signed_char*,int,int); */ -static PyObject *f2py_rout__cImageD11_make_clean_mask(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(float*,float,signed_char*,signed_char*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int make_clean_mask_return_value=0; - float *img = NULL; - npy_intp img_Dims[2] = {-1, -1}; - const int img_Rank = 2; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - float cut = 0; - PyObject *cut_capi = Py_None; - signed_char *msk = NULL; - npy_intp msk_Dims[2] = {-1, -1}; - const int msk_Rank = 2; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - signed_char *ret = NULL; - npy_intp ret_Dims[2] = {-1, -1}; - const int ret_Rank = 2; - PyArrayObject *capi_ret_as_array = NULL; - int capi_ret_intent = 0; - PyObject *ret_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"img","cut","msk","ret",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.make_clean_mask",\ - capi_kwlist,&img_capi,&cut_capi,&msk_capi,&ret_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable cut */ - f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.make_clean_mask() 2nd argument (cut) can't be converted to float"); - if (f2py_success) { - /* Processing variable msk */ - ; - capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.make_clean_mask: failed to create array from the 3rd argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); - - /* Processing variable ns */ - ns = shape(msk,0); - /* Processing variable nf */ - nf = shape(msk,1); - /* Processing variable img */ - img_Dims[0]=ns,img_Dims[1]=nf; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.make_clean_mask: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable ret */ - ret_Dims[0]=ns,ret_Dims[1]=nf; - capi_ret_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.make_clean_mask: failed to create array from the 4th argument `ret`"; - capi_ret_as_array = ndarray_from_pyobj( NPY_BYTE,1,ret_Dims,ret_Rank, capi_ret_intent,ret_capi,capi_errmess); - if (capi_ret_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - ret = (signed_char *)(PyArray_DATA(capi_ret_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - make_clean_mask_return_value = (*f2py_func)(img,cut,msk,ret,ns,nf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",make_clean_mask_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_ret_as_array!=ret_capi) { - Py_XDECREF(capi_ret_as_array); } - } /* if (capi_ret_as_array == NULL) ... else of ret */ - /* End of cleaning variable ret */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of make_clean_mask ***************************/ - -/******************************* localmaxlabel *******************************/ -static char doc_f2py_rout__cImageD11_localmaxlabel[] = "\ -localmaxlabel = localmaxlabel(data,labels,wrk)\n\nWrapper for ``localmaxlabel``.\ -\n\nParameters\n----------\n" -"data : input rank-2 array('f') with bounds (ns,nf)\n" -"labels : in/output rank-2 array('i') with bounds (ns,nf)\n" -"wrk : in/output rank-2 array('b') with bounds (ns,nf)\n" -"\nReturns\n-------\n" -"localmaxlabel : int"; -/* extern int localmaxlabel(float*,int*,signed_char*,int,int); */ -static PyObject *f2py_rout__cImageD11_localmaxlabel(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(float*,int*,signed_char*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int localmaxlabel_return_value=0; - float *data = NULL; - npy_intp data_Dims[2] = {-1, -1}; - const int data_Rank = 2; - PyArrayObject *capi_data_as_array = NULL; - int capi_data_intent = 0; - PyObject *data_capi = Py_None; - int *labels = NULL; - npy_intp labels_Dims[2] = {-1, -1}; - const int labels_Rank = 2; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - signed_char *wrk = NULL; - npy_intp wrk_Dims[2] = {-1, -1}; - const int wrk_Rank = 2; - PyArrayObject *capi_wrk_as_array = NULL; - int capi_wrk_intent = 0; - PyObject *wrk_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"data","labels","wrk",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOO|:_cImageD11.localmaxlabel",\ - capi_kwlist,&data_capi,&labels_capi,&wrk_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable data */ - ; - capi_data_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.localmaxlabel: failed to create array from the 1st argument `data`"; - capi_data_as_array = ndarray_from_pyobj( NPY_FLOAT,1,data_Dims,data_Rank, capi_data_intent,data_capi,capi_errmess); - if (capi_data_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - data = (float *)(PyArray_DATA(capi_data_as_array)); - - /* Processing variable ns */ - ns = shape(data,0); - /* Processing variable nf */ - nf = shape(data,1); - /* Processing variable labels */ - labels_Dims[0]=ns,labels_Dims[1]=nf; - capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.localmaxlabel: failed to create array from the 2nd argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - - /* Processing variable wrk */ - wrk_Dims[0]=ns,wrk_Dims[1]=nf; - capi_wrk_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.localmaxlabel: failed to create array from the 3rd argument `wrk`"; - capi_wrk_as_array = ndarray_from_pyobj( NPY_BYTE,1,wrk_Dims,wrk_Rank, capi_wrk_intent,wrk_capi,capi_errmess); - if (capi_wrk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - wrk = (signed_char *)(PyArray_DATA(capi_wrk_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - localmaxlabel_return_value = (*f2py_func)(data,labels,wrk,ns,nf); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",localmaxlabel_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_wrk_as_array!=wrk_capi) { - Py_XDECREF(capi_wrk_as_array); } - } /* if (capi_wrk_as_array == NULL) ... else of wrk */ - /* End of cleaning variable wrk */ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - if((PyObject *)capi_data_as_array!=data_capi) { - Py_XDECREF(capi_data_as_array); } - } /* if (capi_data_as_array == NULL) ... else of data */ - /* End of cleaning variable data */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of localmaxlabel ****************************/ - -/******************************** mask_to_coo ********************************/ -static char doc_f2py_rout__cImageD11_mask_to_coo[] = "\ -mask_to_coo = mask_to_coo(msk,i,j,w)\n\nWrapper for ``mask_to_coo``.\ -\n\nParameters\n----------\n" -"msk : input rank-2 array('b') with bounds (ns,nf)\n" -"i : in/output rank-1 array('H') with bounds (nnz)\n" -"j : in/output rank-1 array('H') with bounds (nnz)\n" -"w : in/output rank-1 array('i') with bounds (ns)\n" -"\nReturns\n-------\n" -"mask_to_coo : int"; -/* extern int mask_to_coo(signed_char*,int,int,unsigned_short*,unsigned_short*,int,int*); */ -static PyObject *f2py_rout__cImageD11_mask_to_coo(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(signed_char*,int,int,unsigned_short*,unsigned_short*,int,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int mask_to_coo_return_value=0; - signed_char *msk = NULL; - npy_intp msk_Dims[2] = {-1, -1}; - const int msk_Rank = 2; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - int ns = 0; - int nf = 0; - unsigned_short *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - unsigned_short *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int nnz = 0; - int *w = NULL; - npy_intp w_Dims[1] = {-1}; - const int w_Rank = 1; - PyArrayObject *capi_w_as_array = NULL; - int capi_w_intent = 0; - PyObject *w_capi = Py_None; - static char *capi_kwlist[] = {"msk","i","j","w",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.mask_to_coo",\ - capi_kwlist,&msk_capi,&i_capi,&j_capi,&w_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable msk */ - ; - capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 1st argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_BYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (signed_char *)(PyArray_DATA(capi_msk_as_array)); - - /* Processing variable i */ - ; - capi_i_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 2nd argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable ns */ - ns = shape(msk,0); - /* Processing variable nf */ - nf = shape(msk,1); - /* Processing variable nnz */ - nnz = shape(i,0); - /* Processing variable w */ - w_Dims[0]=ns; - capi_w_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 4th argument `w`"; - capi_w_as_array = ndarray_from_pyobj( NPY_INT,1,w_Dims,w_Rank, capi_w_intent,w_capi,capi_errmess); - if (capi_w_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - w = (int *)(PyArray_DATA(capi_w_as_array)); - - /* Processing variable j */ - j_Dims[0]=nnz; - capi_j_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.mask_to_coo: failed to create array from the 3rd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - mask_to_coo_return_value = (*f2py_func)(msk,ns,nf,i,j,nnz,w); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",mask_to_coo_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - if((PyObject *)capi_w_as_array!=w_capi) { - Py_XDECREF(capi_w_as_array); } - } /* if (capi_w_as_array == NULL) ... else of w */ - /* End of cleaning variable w */ - /* End of cleaning variable nnz */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/***************************** end of mask_to_coo *****************************/ - -/****************************** sparse_is_sorted ******************************/ -static char doc_f2py_rout__cImageD11_sparse_is_sorted[] = "\ -sparse_is_sorted = sparse_is_sorted(i,j)\n\nWrapper for ``sparse_is_sorted``.\ -\n\nParameters\n----------\n" -"i : input rank-1 array('H') with bounds (nnz)\n" -"j : input rank-1 array('H') with bounds (nnz)\n" -"\nReturns\n-------\n" -"sparse_is_sorted : int"; -/* extern int sparse_is_sorted(unsigned_short*,unsigned_short*,int); */ -static PyObject *f2py_rout__cImageD11_sparse_is_sorted(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(unsigned_short*,unsigned_short*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int sparse_is_sorted_return_value=0; - unsigned_short *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - unsigned_short *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int nnz = 0; - static char *capi_kwlist[] = {"i","j",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OO|:_cImageD11.sparse_is_sorted",\ - capi_kwlist,&i_capi,&j_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable i */ - ; - capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_is_sorted: failed to create array from the 1st argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable nnz */ - nnz = shape(i, 0); - /* Processing variable j */ - j_Dims[0]=nnz; - capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_is_sorted: failed to create array from the 2nd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - sparse_is_sorted_return_value = (*f2py_func)(i,j,nnz); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",sparse_is_sorted_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - /* End of cleaning variable nnz */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************** end of sparse_is_sorted **************************/ - -/*************************** sparse_connectedpixels ***************************/ -static char doc_f2py_rout__cImageD11_sparse_connectedpixels[] = "\ -sparse_connectedpixels = sparse_connectedpixels(v,i,j,threshold,labels)\n\nWrapper for ``sparse_connectedpixels``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('f') with bounds (nnz)\n" -"i : input rank-1 array('H') with bounds (nnz)\n" -"j : input rank-1 array('H') with bounds (nnz)\n" -"threshold : input float\n" -"labels : in/output rank-1 array('i') with bounds (nnz)\n" -"\nReturns\n-------\n" -"sparse_connectedpixels : int"; -/* extern int sparse_connectedpixels(float*,unsigned_short*,unsigned_short*,int,float,int*); */ -static PyObject *f2py_rout__cImageD11_sparse_connectedpixels(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int sparse_connectedpixels_return_value=0; - float *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - unsigned_short *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - unsigned_short *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int nnz = 0; - float threshold = 0; - PyObject *threshold_capi = Py_None; - int *labels = NULL; - npy_intp labels_Dims[1] = {-1}; - const int labels_Rank = 1; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - static char *capi_kwlist[] = {"v","i","j","threshold","labels",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|:_cImageD11.sparse_connectedpixels",\ - capi_kwlist,&v_capi,&i_capi,&j_capi,&threshold_capi,&labels_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable i */ - ; - capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 2nd argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable threshold */ - f2py_success = float_from_pyobj(&threshold,threshold_capi,"_cImageD11.sparse_connectedpixels() 4th argument (threshold) can't be converted to float"); - if (f2py_success) { - /* Processing variable nnz */ - nnz = shape(i, 0); - /* Processing variable labels */ - labels_Dims[0]=nnz; - capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 5th argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - - /* Processing variable v */ - v_Dims[0]=nnz; - capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (float *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable j */ - j_Dims[0]=nnz; - capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels: failed to create array from the 3rd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - sparse_connectedpixels_return_value = (*f2py_func)(v,i,j,nnz,threshold,labels); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",sparse_connectedpixels_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - /* End of cleaning variable nnz */ - } /*if (f2py_success) of threshold*/ - /* End of cleaning variable threshold */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of sparse_connectedpixels ***********************/ - -/************************ sparse_connectedpixels_splat ************************/ -static char doc_f2py_rout__cImageD11_sparse_connectedpixels_splat[] = "\ -sparse_connectedpixels_splat = sparse_connectedpixels_splat(v,i,j,th,lbl,Z,ni,nj)\n\nWrapper for ``sparse_connectedpixels_splat``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('f') with bounds (nnz)\n" -"i : input rank-1 array('H') with bounds (nnz)\n" -"j : input rank-1 array('H') with bounds (nnz)\n" -"th : input float\n" -"lbl : in/output rank-1 array('i') with bounds (nnz)\n" -"Z : in/output rank-1 array('i') with bounds (4 + 2 * ni + 2 * nj + ni * nj)\n" -"ni : input int\n" -"nj : input int\n" -"\nReturns\n-------\n" -"sparse_connectedpixels_splat : int"; -/* extern int sparse_connectedpixels_splat(float*,unsigned_short*,unsigned_short*,int,float,int*,int*,int,int); */ -static PyObject *f2py_rout__cImageD11_sparse_connectedpixels_splat(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float,int*,int*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int sparse_connectedpixels_splat_return_value=0; - float *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - unsigned_short *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - unsigned_short *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int nnz = 0; - float th = 0; - PyObject *th_capi = Py_None; - int *lbl = NULL; - npy_intp lbl_Dims[1] = {-1}; - const int lbl_Rank = 1; - PyArrayObject *capi_lbl_as_array = NULL; - int capi_lbl_intent = 0; - PyObject *lbl_capi = Py_None; - int *Z = NULL; - npy_intp Z_Dims[1] = {-1}; - const int Z_Rank = 1; - PyArrayObject *capi_Z_as_array = NULL; - int capi_Z_intent = 0; - PyObject *Z_capi = Py_None; - int ni = 0; - PyObject *ni_capi = Py_None; - int nj = 0; - PyObject *nj_capi = Py_None; - static char *capi_kwlist[] = {"v","i","j","th","lbl","Z","ni","nj",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|:_cImageD11.sparse_connectedpixels_splat",\ - capi_kwlist,&v_capi,&i_capi,&j_capi,&th_capi,&lbl_capi,&Z_capi,&ni_capi,&nj_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable i */ - ; - capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 2nd argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable th */ - f2py_success = float_from_pyobj(&th,th_capi,"_cImageD11.sparse_connectedpixels_splat() 4th argument (th) can't be converted to float"); - if (f2py_success) { - /* Processing variable ni */ - f2py_success = int_from_pyobj(&ni,ni_capi,"_cImageD11.sparse_connectedpixels_splat() 7th argument (ni) can't be converted to int"); - if (f2py_success) { - /* Processing variable nj */ - f2py_success = int_from_pyobj(&nj,nj_capi,"_cImageD11.sparse_connectedpixels_splat() 8th argument (nj) can't be converted to int"); - if (f2py_success) { - /* Processing variable nnz */ - nnz = shape(i, 0); - /* Processing variable lbl */ - lbl_Dims[0]=nnz; - capi_lbl_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 5th argument `lbl`"; - capi_lbl_as_array = ndarray_from_pyobj( NPY_INT,1,lbl_Dims,lbl_Rank, capi_lbl_intent,lbl_capi,capi_errmess); - if (capi_lbl_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - lbl = (int *)(PyArray_DATA(capi_lbl_as_array)); - - /* Processing variable Z */ - Z_Dims[0]=4 + 2 * ni + 2 * nj + ni * nj; - capi_Z_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 6th argument `Z`"; - capi_Z_as_array = ndarray_from_pyobj( NPY_INT,1,Z_Dims,Z_Rank, capi_Z_intent,Z_capi,capi_errmess); - if (capi_Z_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - Z = (int *)(PyArray_DATA(capi_Z_as_array)); - - CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj,"shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj","6th argument Z") { - CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj,"shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj","6th argument Z") { - /* Processing variable v */ - v_Dims[0]=nnz; - capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (float *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable j */ - j_Dims[0]=nnz; - capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_connectedpixels_splat: failed to create array from the 3rd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - sparse_connectedpixels_splat_return_value = (*f2py_func)(v,i,j,nnz,th,lbl,Z,ni,nj); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",sparse_connectedpixels_splat_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ - } /*CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj)*/ - } /*CHECKARRAY(shape(Z, 0) == 4 + 2 * ni + 2 * nj + ni * nj)*/ - if((PyObject *)capi_Z_as_array!=Z_capi) { - Py_XDECREF(capi_Z_as_array); } - } /* if (capi_Z_as_array == NULL) ... else of Z */ - /* End of cleaning variable Z */ - if((PyObject *)capi_lbl_as_array!=lbl_capi) { - Py_XDECREF(capi_lbl_as_array); } - } /* if (capi_lbl_as_array == NULL) ... else of lbl */ - /* End of cleaning variable lbl */ - /* End of cleaning variable nnz */ - } /*if (f2py_success) of nj*/ - /* End of cleaning variable nj */ - } /*if (f2py_success) of ni*/ - /* End of cleaning variable ni */ - } /*if (f2py_success) of th*/ - /* End of cleaning variable th */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************** end of sparse_connectedpixels_splat ********************/ - -/************************** sparse_blob2Dproperties **************************/ -static char doc_f2py_rout__cImageD11_sparse_blob2Dproperties[] = "\ -results = sparse_blob2Dproperties(v,i,j,labels,npk)\n\nWrapper for ``sparse_blob2Dproperties``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('f') with bounds (nnz)\n" -"i : input rank-1 array('H') with bounds (nnz)\n" -"j : input rank-1 array('H') with bounds (nnz)\n" -"labels : input rank-1 array('i') with bounds (nnz)\n" -"npk : input int\n" -"\nReturns\n-------\n" -"results : rank-2 array('d') with bounds (npk,NPROPERTY2D)"; -/* extern void sparse_blob2Dproperties(float*,unsigned_short*,unsigned_short*,int,int*,double*,int); */ -static PyObject *f2py_rout__cImageD11_sparse_blob2Dproperties(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,int*,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - unsigned_short *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - unsigned_short *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int nnz = 0; - int *labels = NULL; - npy_intp labels_Dims[1] = {-1}; - const int labels_Rank = 1; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - double *results = NULL; - npy_intp results_Dims[2] = {-1, -1}; - const int results_Rank = 2; - PyArrayObject *capi_results_as_array = NULL; - int capi_results_intent = 0; - int npk = 0; - PyObject *npk_capi = Py_None; - static char *capi_kwlist[] = {"v","i","j","labels","npk",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|:_cImageD11.sparse_blob2Dproperties",\ - capi_kwlist,&v_capi,&i_capi,&j_capi,&labels_capi,&npk_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - ; - capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (float *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable npk */ - f2py_success = int_from_pyobj(&npk,npk_capi,"_cImageD11.sparse_blob2Dproperties() 5th argument (npk) can't be converted to int"); - if (f2py_success) { - /* Processing variable nnz */ - nnz = shape(v, 0); - /* Processing variable labels */ - labels_Dims[0]=nnz; - capi_labels_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 4th argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - - /* Processing variable results */ - results_Dims[0]=npk,results_Dims[1]=NPROPERTY2D; - capi_results_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the hidden `results`"; - capi_results_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,results_Dims,results_Rank, capi_results_intent,Py_None,capi_errmess); - if (capi_results_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - results = (double *)(PyArray_DATA(capi_results_as_array)); - - /* Processing variable i */ - i_Dims[0]=nnz; - capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 2nd argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable j */ - j_Dims[0]=nnz; - capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_blob2Dproperties: failed to create array from the 3rd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(v,i,j,nnz,labels,results,npk); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("N",capi_results_as_array); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ - } /* if (capi_results_as_array == NULL) ... else of results */ - /* End of cleaning variable results */ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - /* End of cleaning variable nnz */ - } /*if (f2py_success) of npk*/ - /* End of cleaning variable npk */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*********************** end of sparse_blob2Dproperties ***********************/ - -/******************************* sparse_smooth *******************************/ -static char doc_f2py_rout__cImageD11_sparse_smooth[] = "\ -sparse_smooth(v,i,j,s)\n\nWrapper for ``sparse_smooth``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('f') with bounds (nnz)\n" -"i : input rank-1 array('H') with bounds (nnz)\n" -"j : input rank-1 array('H') with bounds (nnz)\n" -"s : in/output rank-1 array('f') with bounds (nnz)"; -/* extern void sparse_smooth(float*,unsigned_short*,unsigned_short*,int,float*); */ -static PyObject *f2py_rout__cImageD11_sparse_smooth(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - float *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - unsigned_short *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - unsigned_short *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int nnz = 0; - float *s = NULL; - npy_intp s_Dims[1] = {-1}; - const int s_Rank = 1; - PyArrayObject *capi_s_as_array = NULL; - int capi_s_intent = 0; - PyObject *s_capi = Py_None; - static char *capi_kwlist[] = {"v","i","j","s",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.sparse_smooth",\ - capi_kwlist,&v_capi,&i_capi,&j_capi,&s_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - ; - capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (float *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable nnz */ - nnz = shape(v, 0); - /* Processing variable s */ - s_Dims[0]=nnz; - capi_s_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 4th argument `s`"; - capi_s_as_array = ndarray_from_pyobj( NPY_FLOAT,1,s_Dims,s_Rank, capi_s_intent,s_capi,capi_errmess); - if (capi_s_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - s = (float *)(PyArray_DATA(capi_s_as_array)); - - /* Processing variable i */ - i_Dims[0]=nnz; - capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 2nd argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable j */ - j_Dims[0]=nnz; - capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_smooth: failed to create array from the 3rd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - (*f2py_func)(v,i,j,nnz,s); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ - if((PyObject *)capi_s_as_array!=s_capi) { - Py_XDECREF(capi_s_as_array); } - } /* if (capi_s_as_array == NULL) ... else of s */ - /* End of cleaning variable s */ - /* End of cleaning variable nnz */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of sparse_smooth ****************************/ - -/**************************** sparse_localmaxlabel ****************************/ -static char doc_f2py_rout__cImageD11_sparse_localmaxlabel[] = "\ -sparse_localmaxlabel = sparse_localmaxlabel(v,i,j,MV,iMV,labels)\n\nWrapper for ``sparse_localmaxlabel``.\ -\n\nParameters\n----------\n" -"v : input rank-1 array('f') with bounds (nnz)\n" -"i : input rank-1 array('H') with bounds (nnz)\n" -"j : input rank-1 array('H') with bounds (nnz)\n" -"MV : in/output rank-1 array('f') with bounds (nnz)\n" -"iMV : in/output rank-1 array('i') with bounds (nnz)\n" -"labels : in/output rank-1 array('i') with bounds (nnz)\n" -"\nReturns\n-------\n" -"sparse_localmaxlabel : int"; -/* extern int sparse_localmaxlabel(float*,unsigned_short*,unsigned_short*,int,float*,int*,int*); */ -static PyObject *f2py_rout__cImageD11_sparse_localmaxlabel(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(float*,unsigned_short*,unsigned_short*,int,float*,int*,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int sparse_localmaxlabel_return_value=0; - float *v = NULL; - npy_intp v_Dims[1] = {-1}; - const int v_Rank = 1; - PyArrayObject *capi_v_as_array = NULL; - int capi_v_intent = 0; - PyObject *v_capi = Py_None; - unsigned_short *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - unsigned_short *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int nnz = 0; - float *MV = NULL; - npy_intp MV_Dims[1] = {-1}; - const int MV_Rank = 1; - PyArrayObject *capi_MV_as_array = NULL; - int capi_MV_intent = 0; - PyObject *MV_capi = Py_None; - int *iMV = NULL; - npy_intp iMV_Dims[1] = {-1}; - const int iMV_Rank = 1; - PyArrayObject *capi_iMV_as_array = NULL; - int capi_iMV_intent = 0; - PyObject *iMV_capi = Py_None; - int *labels = NULL; - npy_intp labels_Dims[1] = {-1}; - const int labels_Rank = 1; - PyArrayObject *capi_labels_as_array = NULL; - int capi_labels_intent = 0; - PyObject *labels_capi = Py_None; - static char *capi_kwlist[] = {"v","i","j","MV","iMV","labels",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.sparse_localmaxlabel",\ - capi_kwlist,&v_capi,&i_capi,&j_capi,&MV_capi,&iMV_capi,&labels_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable v */ - ; - capi_v_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 1st argument `v`"; - capi_v_as_array = ndarray_from_pyobj( NPY_FLOAT,1,v_Dims,v_Rank, capi_v_intent,v_capi,capi_errmess); - if (capi_v_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - v = (float *)(PyArray_DATA(capi_v_as_array)); - - /* Processing variable nnz */ - nnz = shape(v, 0); - /* Processing variable MV */ - MV_Dims[0]=nnz; - capi_MV_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 4th argument `MV`"; - capi_MV_as_array = ndarray_from_pyobj( NPY_FLOAT,1,MV_Dims,MV_Rank, capi_MV_intent,MV_capi,capi_errmess); - if (capi_MV_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - MV = (float *)(PyArray_DATA(capi_MV_as_array)); - - /* Processing variable iMV */ - iMV_Dims[0]=nnz; - capi_iMV_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 5th argument `iMV`"; - capi_iMV_as_array = ndarray_from_pyobj( NPY_INT,1,iMV_Dims,iMV_Rank, capi_iMV_intent,iMV_capi,capi_errmess); - if (capi_iMV_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - iMV = (int *)(PyArray_DATA(capi_iMV_as_array)); - - /* Processing variable labels */ - labels_Dims[0]=nnz; - capi_labels_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 6th argument `labels`"; - capi_labels_as_array = ndarray_from_pyobj( NPY_INT,1,labels_Dims,labels_Rank, capi_labels_intent,labels_capi,capi_errmess); - if (capi_labels_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels = (int *)(PyArray_DATA(capi_labels_as_array)); - - /* Processing variable i */ - i_Dims[0]=nnz; - capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 2nd argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_USHORT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (unsigned_short *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable j */ - j_Dims[0]=nnz; - capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_localmaxlabel: failed to create array from the 3rd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_USHORT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (unsigned_short *)(PyArray_DATA(capi_j_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - sparse_localmaxlabel_return_value = (*f2py_func)(v,i,j,nnz,MV,iMV,labels); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",sparse_localmaxlabel_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ - if((PyObject *)capi_labels_as_array!=labels_capi) { - Py_XDECREF(capi_labels_as_array); } - } /* if (capi_labels_as_array == NULL) ... else of labels */ - /* End of cleaning variable labels */ - if((PyObject *)capi_iMV_as_array!=iMV_capi) { - Py_XDECREF(capi_iMV_as_array); } - } /* if (capi_iMV_as_array == NULL) ... else of iMV */ - /* End of cleaning variable iMV */ - if((PyObject *)capi_MV_as_array!=MV_capi) { - Py_XDECREF(capi_MV_as_array); } - } /* if (capi_MV_as_array == NULL) ... else of MV */ - /* End of cleaning variable MV */ - /* End of cleaning variable nnz */ - if((PyObject *)capi_v_as_array!=v_capi) { - Py_XDECREF(capi_v_as_array); } - } /* if (capi_v_as_array == NULL) ... else of v */ - /* End of cleaning variable v */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************ end of sparse_localmaxlabel ************************/ - -/****************************** sparse_overlaps ******************************/ -static char doc_f2py_rout__cImageD11_sparse_overlaps[] = "\ -sparse_overlaps = sparse_overlaps(i1,j1,k1,i2,j2,k2)\n\nWrapper for ``sparse_overlaps``.\ -\n\nParameters\n----------\n" -"i1 : input rank-1 array('H') with bounds (nnz1)\n" -"j1 : input rank-1 array('H') with bounds (nnz1)\n" -"k1 : in/output rank-1 array('i') with bounds (nnz1)\n" -"i2 : input rank-1 array('H') with bounds (nnz2)\n" -"j2 : input rank-1 array('H') with bounds (nnz2)\n" -"k2 : in/output rank-1 array('i') with bounds (nnz2)\n" -"\nReturns\n-------\n" -"sparse_overlaps : int"; -/* extern int sparse_overlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int); */ -static PyObject *f2py_rout__cImageD11_sparse_overlaps(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int sparse_overlaps_return_value=0; - unsigned_short *i1 = NULL; - npy_intp i1_Dims[1] = {-1}; - const int i1_Rank = 1; - PyArrayObject *capi_i1_as_array = NULL; - int capi_i1_intent = 0; - PyObject *i1_capi = Py_None; - unsigned_short *j1 = NULL; - npy_intp j1_Dims[1] = {-1}; - const int j1_Rank = 1; - PyArrayObject *capi_j1_as_array = NULL; - int capi_j1_intent = 0; - PyObject *j1_capi = Py_None; - int *k1 = NULL; - npy_intp k1_Dims[1] = {-1}; - const int k1_Rank = 1; - PyArrayObject *capi_k1_as_array = NULL; - int capi_k1_intent = 0; - PyObject *k1_capi = Py_None; - int nnz1 = 0; - unsigned_short *i2 = NULL; - npy_intp i2_Dims[1] = {-1}; - const int i2_Rank = 1; - PyArrayObject *capi_i2_as_array = NULL; - int capi_i2_intent = 0; - PyObject *i2_capi = Py_None; - unsigned_short *j2 = NULL; - npy_intp j2_Dims[1] = {-1}; - const int j2_Rank = 1; - PyArrayObject *capi_j2_as_array = NULL; - int capi_j2_intent = 0; - PyObject *j2_capi = Py_None; - int *k2 = NULL; - npy_intp k2_Dims[1] = {-1}; - const int k2_Rank = 1; - PyArrayObject *capi_k2_as_array = NULL; - int capi_k2_intent = 0; - PyObject *k2_capi = Py_None; - int nnz2 = 0; - static char *capi_kwlist[] = {"i1","j1","k1","i2","j2","k2",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.sparse_overlaps",\ - capi_kwlist,&i1_capi,&j1_capi,&k1_capi,&i2_capi,&j2_capi,&k2_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable i1 */ - ; - capi_i1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 1st argument `i1`"; - capi_i1_as_array = ndarray_from_pyobj( NPY_USHORT,1,i1_Dims,i1_Rank, capi_i1_intent,i1_capi,capi_errmess); - if (capi_i1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i1 = (unsigned_short *)(PyArray_DATA(capi_i1_as_array)); - - /* Processing variable i2 */ - ; - capi_i2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 4th argument `i2`"; - capi_i2_as_array = ndarray_from_pyobj( NPY_USHORT,1,i2_Dims,i2_Rank, capi_i2_intent,i2_capi,capi_errmess); - if (capi_i2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i2 = (unsigned_short *)(PyArray_DATA(capi_i2_as_array)); - - /* Processing variable nnz1 */ - nnz1 = shape(i1,0); - /* Processing variable nnz2 */ - nnz2 = shape(i2,0); - /* Processing variable j1 */ - j1_Dims[0]=nnz1; - capi_j1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 2nd argument `j1`"; - capi_j1_as_array = ndarray_from_pyobj( NPY_USHORT,1,j1_Dims,j1_Rank, capi_j1_intent,j1_capi,capi_errmess); - if (capi_j1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j1 = (unsigned_short *)(PyArray_DATA(capi_j1_as_array)); - - /* Processing variable k1 */ - k1_Dims[0]=nnz1; - capi_k1_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 3rd argument `k1`"; - capi_k1_as_array = ndarray_from_pyobj( NPY_INT,1,k1_Dims,k1_Rank, capi_k1_intent,k1_capi,capi_errmess); - if (capi_k1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - k1 = (int *)(PyArray_DATA(capi_k1_as_array)); - - /* Processing variable j2 */ - j2_Dims[0]=nnz2; - capi_j2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 5th argument `j2`"; - capi_j2_as_array = ndarray_from_pyobj( NPY_USHORT,1,j2_Dims,j2_Rank, capi_j2_intent,j2_capi,capi_errmess); - if (capi_j2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j2 = (unsigned_short *)(PyArray_DATA(capi_j2_as_array)); - - /* Processing variable k2 */ - k2_Dims[0]=nnz2; - capi_k2_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.sparse_overlaps: failed to create array from the 6th argument `k2`"; - capi_k2_as_array = ndarray_from_pyobj( NPY_INT,1,k2_Dims,k2_Rank, capi_k2_intent,k2_capi,capi_errmess); - if (capi_k2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - k2 = (int *)(PyArray_DATA(capi_k2_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - sparse_overlaps_return_value = (*f2py_func)(i1,j1,k1,nnz1,i2,j2,k2,nnz2); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",sparse_overlaps_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_k2_as_array!=k2_capi) { - Py_XDECREF(capi_k2_as_array); } - } /* if (capi_k2_as_array == NULL) ... else of k2 */ - /* End of cleaning variable k2 */ - if((PyObject *)capi_j2_as_array!=j2_capi) { - Py_XDECREF(capi_j2_as_array); } - } /* if (capi_j2_as_array == NULL) ... else of j2 */ - /* End of cleaning variable j2 */ - if((PyObject *)capi_k1_as_array!=k1_capi) { - Py_XDECREF(capi_k1_as_array); } - } /* if (capi_k1_as_array == NULL) ... else of k1 */ - /* End of cleaning variable k1 */ - if((PyObject *)capi_j1_as_array!=j1_capi) { - Py_XDECREF(capi_j1_as_array); } - } /* if (capi_j1_as_array == NULL) ... else of j1 */ - /* End of cleaning variable j1 */ - /* End of cleaning variable nnz2 */ - /* End of cleaning variable nnz1 */ - if((PyObject *)capi_i2_as_array!=i2_capi) { - Py_XDECREF(capi_i2_as_array); } - } /* if (capi_i2_as_array == NULL) ... else of i2 */ - /* End of cleaning variable i2 */ - if((PyObject *)capi_i1_as_array!=i1_capi) { - Py_XDECREF(capi_i1_as_array); } - } /* if (capi_i1_as_array == NULL) ... else of i1 */ - /* End of cleaning variable i1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/*************************** end of sparse_overlaps ***************************/ - -/**************************** compress_duplicates ****************************/ -static char doc_f2py_rout__cImageD11_compress_duplicates[] = "\ -compress_duplicates = compress_duplicates(i,j,oi,oj,tmp)\n\nWrapper for ``compress_duplicates``.\ -\n\nParameters\n----------\n" -"i : input rank-1 array('i') with bounds (n)\n" -"j : input rank-1 array('i') with bounds (n)\n" -"oi : in/output rank-1 array('i') with bounds (n)\n" -"oj : in/output rank-1 array('i') with bounds (n)\n" -"tmp : in/output rank-1 array('i') with bounds (nt)\n" -"\nReturns\n-------\n" -"compress_duplicates : int"; -/* extern int compress_duplicates(int*,int*,int*,int*,int*,int,int); */ -static PyObject *f2py_rout__cImageD11_compress_duplicates(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(int*,int*,int*,int*,int*,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int compress_duplicates_return_value=0; - int *i = NULL; - npy_intp i_Dims[1] = {-1}; - const int i_Rank = 1; - PyArrayObject *capi_i_as_array = NULL; - int capi_i_intent = 0; - PyObject *i_capi = Py_None; - int *j = NULL; - npy_intp j_Dims[1] = {-1}; - const int j_Rank = 1; - PyArrayObject *capi_j_as_array = NULL; - int capi_j_intent = 0; - PyObject *j_capi = Py_None; - int *oi = NULL; - npy_intp oi_Dims[1] = {-1}; - const int oi_Rank = 1; - PyArrayObject *capi_oi_as_array = NULL; - int capi_oi_intent = 0; - PyObject *oi_capi = Py_None; - int *oj = NULL; - npy_intp oj_Dims[1] = {-1}; - const int oj_Rank = 1; - PyArrayObject *capi_oj_as_array = NULL; - int capi_oj_intent = 0; - PyObject *oj_capi = Py_None; - int *tmp = NULL; - npy_intp tmp_Dims[1] = {-1}; - const int tmp_Rank = 1; - PyArrayObject *capi_tmp_as_array = NULL; - int capi_tmp_intent = 0; - PyObject *tmp_capi = Py_None; - int n = 0; - int nt = 0; - static char *capi_kwlist[] = {"i","j","oi","oj","tmp",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOO|:_cImageD11.compress_duplicates",\ - capi_kwlist,&i_capi,&j_capi,&oi_capi,&oj_capi,&tmp_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable i */ - ; - capi_i_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 1st argument `i`"; - capi_i_as_array = ndarray_from_pyobj( NPY_INT,1,i_Dims,i_Rank, capi_i_intent,i_capi,capi_errmess); - if (capi_i_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - i = (int *)(PyArray_DATA(capi_i_as_array)); - - /* Processing variable tmp */ - ; - capi_tmp_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 5th argument `tmp`"; - capi_tmp_as_array = ndarray_from_pyobj( NPY_INT,1,tmp_Dims,tmp_Rank, capi_tmp_intent,tmp_capi,capi_errmess); - if (capi_tmp_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - tmp = (int *)(PyArray_DATA(capi_tmp_as_array)); - - /* Processing variable n */ - n = shape(i,0); - /* Processing variable nt */ - nt = shape(tmp,0); - /* Processing variable j */ - j_Dims[0]=n; - capi_j_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 2nd argument `j`"; - capi_j_as_array = ndarray_from_pyobj( NPY_INT,1,j_Dims,j_Rank, capi_j_intent,j_capi,capi_errmess); - if (capi_j_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - j = (int *)(PyArray_DATA(capi_j_as_array)); - - /* Processing variable oi */ - oi_Dims[0]=n; - capi_oi_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 3rd argument `oi`"; - capi_oi_as_array = ndarray_from_pyobj( NPY_INT,1,oi_Dims,oi_Rank, capi_oi_intent,oi_capi,capi_errmess); - if (capi_oi_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - oi = (int *)(PyArray_DATA(capi_oi_as_array)); - - /* Processing variable oj */ - oj_Dims[0]=n; - capi_oj_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.compress_duplicates: failed to create array from the 4th argument `oj`"; - capi_oj_as_array = ndarray_from_pyobj( NPY_INT,1,oj_Dims,oj_Rank, capi_oj_intent,oj_capi,capi_errmess); - if (capi_oj_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - oj = (int *)(PyArray_DATA(capi_oj_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - compress_duplicates_return_value = (*f2py_func)(i,j,oi,oj,tmp,n,nt); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",compress_duplicates_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_oj_as_array!=oj_capi) { - Py_XDECREF(capi_oj_as_array); } - } /* if (capi_oj_as_array == NULL) ... else of oj */ - /* End of cleaning variable oj */ - if((PyObject *)capi_oi_as_array!=oi_capi) { - Py_XDECREF(capi_oi_as_array); } - } /* if (capi_oi_as_array == NULL) ... else of oi */ - /* End of cleaning variable oi */ - if((PyObject *)capi_j_as_array!=j_capi) { - Py_XDECREF(capi_j_as_array); } - } /* if (capi_j_as_array == NULL) ... else of j */ - /* End of cleaning variable j */ - /* End of cleaning variable nt */ - /* End of cleaning variable n */ - if((PyObject *)capi_tmp_as_array!=tmp_capi) { - Py_XDECREF(capi_tmp_as_array); } - } /* if (capi_tmp_as_array == NULL) ... else of tmp */ - /* End of cleaning variable tmp */ - if((PyObject *)capi_i_as_array!=i_capi) { - Py_XDECREF(capi_i_as_array); } - } /* if (capi_i_as_array == NULL) ... else of i */ - /* End of cleaning variable i */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/************************* end of compress_duplicates *************************/ - -/********************************* coverlaps *********************************/ -static char doc_f2py_rout__cImageD11_coverlaps[] = "\ -coverlaps = coverlaps(row1,col1,labels1,row2,col2,labels2,mat,results)\n\nWrapper for ``coverlaps``.\ -\n\nParameters\n----------\n" -"row1 : input rank-1 array('H') with bounds (nnz1)\n" -"col1 : input rank-1 array('H') with bounds (nnz1)\n" -"labels1 : input rank-1 array('i') with bounds (nnz1)\n" -"row2 : input rank-1 array('H') with bounds (nnz2)\n" -"col2 : input rank-1 array('H') with bounds (nnz2)\n" -"labels2 : input rank-1 array('i') with bounds (nnz2)\n" -"mat : input rank-2 array('i') with bounds (npk1,npk2)\n" -"results : in/output rank-1 array('i') with bounds (*)\n" -"\nReturns\n-------\n" -"coverlaps : int"; -/* extern int coverlaps(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int,int*,int,int,int*); */ -static PyObject *f2py_rout__cImageD11_coverlaps(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(unsigned_short*,unsigned_short*,int*,int,unsigned_short*,unsigned_short*,int*,int,int*,int,int,int*)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int coverlaps_return_value=0; - unsigned_short *row1 = NULL; - npy_intp row1_Dims[1] = {-1}; - const int row1_Rank = 1; - PyArrayObject *capi_row1_as_array = NULL; - int capi_row1_intent = 0; - PyObject *row1_capi = Py_None; - unsigned_short *col1 = NULL; - npy_intp col1_Dims[1] = {-1}; - const int col1_Rank = 1; - PyArrayObject *capi_col1_as_array = NULL; - int capi_col1_intent = 0; - PyObject *col1_capi = Py_None; - int *labels1 = NULL; - npy_intp labels1_Dims[1] = {-1}; - const int labels1_Rank = 1; - PyArrayObject *capi_labels1_as_array = NULL; - int capi_labels1_intent = 0; - PyObject *labels1_capi = Py_None; - int nnz1 = 0; - unsigned_short *row2 = NULL; - npy_intp row2_Dims[1] = {-1}; - const int row2_Rank = 1; - PyArrayObject *capi_row2_as_array = NULL; - int capi_row2_intent = 0; - PyObject *row2_capi = Py_None; - unsigned_short *col2 = NULL; - npy_intp col2_Dims[1] = {-1}; - const int col2_Rank = 1; - PyArrayObject *capi_col2_as_array = NULL; - int capi_col2_intent = 0; - PyObject *col2_capi = Py_None; - int *labels2 = NULL; - npy_intp labels2_Dims[1] = {-1}; - const int labels2_Rank = 1; - PyArrayObject *capi_labels2_as_array = NULL; - int capi_labels2_intent = 0; - PyObject *labels2_capi = Py_None; - int nnz2 = 0; - int *mat = NULL; - npy_intp mat_Dims[2] = {-1, -1}; - const int mat_Rank = 2; - PyArrayObject *capi_mat_as_array = NULL; - int capi_mat_intent = 0; - PyObject *mat_capi = Py_None; - int npk1 = 0; - int npk2 = 0; - int *results = NULL; - npy_intp results_Dims[1] = {-1}; - const int results_Rank = 1; - PyArrayObject *capi_results_as_array = NULL; - int capi_results_intent = 0; - PyObject *results_capi = Py_None; - static char *capi_kwlist[] = {"row1","col1","labels1","row2","col2","labels2","mat","results",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOOOO|:_cImageD11.coverlaps",\ - capi_kwlist,&row1_capi,&col1_capi,&labels1_capi,&row2_capi,&col2_capi,&labels2_capi,&mat_capi,&results_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable row1 */ - ; - capi_row1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 1st argument `row1`"; - capi_row1_as_array = ndarray_from_pyobj( NPY_USHORT,1,row1_Dims,row1_Rank, capi_row1_intent,row1_capi,capi_errmess); - if (capi_row1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - row1 = (unsigned_short *)(PyArray_DATA(capi_row1_as_array)); - - /* Processing variable row2 */ - ; - capi_row2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 4th argument `row2`"; - capi_row2_as_array = ndarray_from_pyobj( NPY_USHORT,1,row2_Dims,row2_Rank, capi_row2_intent,row2_capi,capi_errmess); - if (capi_row2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - row2 = (unsigned_short *)(PyArray_DATA(capi_row2_as_array)); - - /* Processing variable mat */ - ; - capi_mat_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 7th argument `mat`"; - capi_mat_as_array = ndarray_from_pyobj( NPY_INT,1,mat_Dims,mat_Rank, capi_mat_intent,mat_capi,capi_errmess); - if (capi_mat_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - mat = (int *)(PyArray_DATA(capi_mat_as_array)); - - /* Processing variable results */ - ; - capi_results_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 8th argument `results`"; - capi_results_as_array = ndarray_from_pyobj( NPY_INT,1,results_Dims,results_Rank, capi_results_intent,results_capi,capi_errmess); - if (capi_results_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - results = (int *)(PyArray_DATA(capi_results_as_array)); - - /* Processing variable nnz1 */ - nnz1 = shape(row1,0); - /* Processing variable nnz2 */ - nnz2 = shape(row2,0); - /* Processing variable npk1 */ - npk1 = shape(mat, 0); - /* Processing variable npk2 */ - npk2 = shape(mat, 1); - /* Processing variable col1 */ - col1_Dims[0]=nnz1; - capi_col1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 2nd argument `col1`"; - capi_col1_as_array = ndarray_from_pyobj( NPY_USHORT,1,col1_Dims,col1_Rank, capi_col1_intent,col1_capi,capi_errmess); - if (capi_col1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - col1 = (unsigned_short *)(PyArray_DATA(capi_col1_as_array)); - - /* Processing variable labels1 */ - labels1_Dims[0]=nnz1; - capi_labels1_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 3rd argument `labels1`"; - capi_labels1_as_array = ndarray_from_pyobj( NPY_INT,1,labels1_Dims,labels1_Rank, capi_labels1_intent,labels1_capi,capi_errmess); - if (capi_labels1_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels1 = (int *)(PyArray_DATA(capi_labels1_as_array)); - - /* Processing variable col2 */ - col2_Dims[0]=nnz2; - capi_col2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 5th argument `col2`"; - capi_col2_as_array = ndarray_from_pyobj( NPY_USHORT,1,col2_Dims,col2_Rank, capi_col2_intent,col2_capi,capi_errmess); - if (capi_col2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - col2 = (unsigned_short *)(PyArray_DATA(capi_col2_as_array)); - - /* Processing variable labels2 */ - labels2_Dims[0]=nnz2; - capi_labels2_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.coverlaps: failed to create array from the 6th argument `labels2`"; - capi_labels2_as_array = ndarray_from_pyobj( NPY_INT,1,labels2_Dims,labels2_Rank, capi_labels2_intent,labels2_capi,capi_errmess); - if (capi_labels2_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - labels2 = (int *)(PyArray_DATA(capi_labels2_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - coverlaps_return_value = (*f2py_func)(row1,col1,labels1,nnz1,row2,col2,labels2,nnz2,mat,npk1,npk2,results); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",coverlaps_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_labels2_as_array!=labels2_capi) { - Py_XDECREF(capi_labels2_as_array); } - } /* if (capi_labels2_as_array == NULL) ... else of labels2 */ - /* End of cleaning variable labels2 */ - if((PyObject *)capi_col2_as_array!=col2_capi) { - Py_XDECREF(capi_col2_as_array); } - } /* if (capi_col2_as_array == NULL) ... else of col2 */ - /* End of cleaning variable col2 */ - if((PyObject *)capi_labels1_as_array!=labels1_capi) { - Py_XDECREF(capi_labels1_as_array); } - } /* if (capi_labels1_as_array == NULL) ... else of labels1 */ - /* End of cleaning variable labels1 */ - if((PyObject *)capi_col1_as_array!=col1_capi) { - Py_XDECREF(capi_col1_as_array); } - } /* if (capi_col1_as_array == NULL) ... else of col1 */ - /* End of cleaning variable col1 */ - /* End of cleaning variable npk2 */ - /* End of cleaning variable npk1 */ - /* End of cleaning variable nnz2 */ - /* End of cleaning variable nnz1 */ - if((PyObject *)capi_results_as_array!=results_capi) { - Py_XDECREF(capi_results_as_array); } - } /* if (capi_results_as_array == NULL) ... else of results */ - /* End of cleaning variable results */ - if((PyObject *)capi_mat_as_array!=mat_capi) { - Py_XDECREF(capi_mat_as_array); } - } /* if (capi_mat_as_array == NULL) ... else of mat */ - /* End of cleaning variable mat */ - if((PyObject *)capi_row2_as_array!=row2_capi) { - Py_XDECREF(capi_row2_as_array); } - } /* if (capi_row2_as_array == NULL) ... else of row2 */ - /* End of cleaning variable row2 */ - if((PyObject *)capi_row1_as_array!=row1_capi) { - Py_XDECREF(capi_row1_as_array); } - } /* if (capi_row1_as_array == NULL) ... else of row1 */ - /* End of cleaning variable row1 */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/****************************** end of coverlaps ******************************/ - -/******************************** tosparse_u16 ********************************/ -static char doc_f2py_rout__cImageD11_tosparse_u16[] = "\ -tosparse_u16 = tosparse_u16(img,msk,row,col,val,cut)\n\nWrapper for ``tosparse_u16``.\ -\n\nParameters\n----------\n" -"img : input rank-2 array('H') with bounds (ns,nf)\n" -"msk : input rank-2 array('B') with bounds (ns,nf)\n" -"row : input rank-2 array('H') with bounds (ns,nf)\n" -"col : input rank-2 array('H') with bounds (ns,nf)\n" -"val : input rank-2 array('H') with bounds (ns,nf)\n" -"cut : input int\n" -"\nReturns\n-------\n" -"tosparse_u16 : int"; -/* extern int tosparse_u16(unsigned_short*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned_short*,int,int,int); */ -static PyObject *f2py_rout__cImageD11_tosparse_u16(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(unsigned_short*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned_short*,int,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int tosparse_u16_return_value=0; - unsigned_short *img = NULL; - npy_intp img_Dims[2] = {-1, -1}; - const int img_Rank = 2; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - unsigned_char *msk = NULL; - npy_intp msk_Dims[2] = {-1, -1}; - const int msk_Rank = 2; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - unsigned_short *row = NULL; - npy_intp row_Dims[2] = {-1, -1}; - const int row_Rank = 2; - PyArrayObject *capi_row_as_array = NULL; - int capi_row_intent = 0; - PyObject *row_capi = Py_None; - unsigned_short *col = NULL; - npy_intp col_Dims[2] = {-1, -1}; - const int col_Rank = 2; - PyArrayObject *capi_col_as_array = NULL; - int capi_col_intent = 0; - PyObject *col_capi = Py_None; - unsigned_short *val = NULL; - npy_intp val_Dims[2] = {-1, -1}; - const int val_Rank = 2; - PyArrayObject *capi_val_as_array = NULL; - int capi_val_intent = 0; - PyObject *val_capi = Py_None; - int cut = 0; - PyObject *cut_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"img","msk","row","col","val","cut",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.tosparse_u16",\ - capi_kwlist,&img_capi,&msk_capi,&row_capi,&col_capi,&val_capi,&cut_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_USHORT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (unsigned_short *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable cut */ - f2py_success = int_from_pyobj(&cut,cut_capi,"_cImageD11.tosparse_u16() 6th argument (cut) can't be converted to int"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(img,0); - /* Processing variable nf */ - nf = shape(img,1); - /* Processing variable msk */ - msk_Dims[0]=ns,msk_Dims[1]=nf; - capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 2nd argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); - - /* Processing variable row */ - row_Dims[0]=ns,row_Dims[1]=nf; - capi_row_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 3rd argument `row`"; - capi_row_as_array = ndarray_from_pyobj( NPY_USHORT,1,row_Dims,row_Rank, capi_row_intent,row_capi,capi_errmess); - if (capi_row_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - row = (unsigned_short *)(PyArray_DATA(capi_row_as_array)); - - /* Processing variable col */ - col_Dims[0]=ns,col_Dims[1]=nf; - capi_col_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 4th argument `col`"; - capi_col_as_array = ndarray_from_pyobj( NPY_USHORT,1,col_Dims,col_Rank, capi_col_intent,col_capi,capi_errmess); - if (capi_col_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - col = (unsigned_short *)(PyArray_DATA(capi_col_as_array)); - - /* Processing variable val */ - val_Dims[0]=ns,val_Dims[1]=nf; - capi_val_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u16: failed to create array from the 5th argument `val`"; - capi_val_as_array = ndarray_from_pyobj( NPY_USHORT,1,val_Dims,val_Rank, capi_val_intent,val_capi,capi_errmess); - if (capi_val_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - val = (unsigned_short *)(PyArray_DATA(capi_val_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - tosparse_u16_return_value = (*f2py_func)(img,msk,row,col,val,cut,ns,nf); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",tosparse_u16_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_val_as_array!=val_capi) { - Py_XDECREF(capi_val_as_array); } - } /* if (capi_val_as_array == NULL) ... else of val */ - /* End of cleaning variable val */ - if((PyObject *)capi_col_as_array!=col_capi) { - Py_XDECREF(capi_col_as_array); } - } /* if (capi_col_as_array == NULL) ... else of col */ - /* End of cleaning variable col */ - if((PyObject *)capi_row_as_array!=row_capi) { - Py_XDECREF(capi_row_as_array); } - } /* if (capi_row_as_array == NULL) ... else of row */ - /* End of cleaning variable row */ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of tosparse_u16 ****************************/ - -/******************************** tosparse_u32 ********************************/ -static char doc_f2py_rout__cImageD11_tosparse_u32[] = "\ -tosparse_u32 = tosparse_u32(img,msk,row,col,val,cut)\n\nWrapper for ``tosparse_u32``.\ -\n\nParameters\n----------\n" -"img : input rank-2 array('I') with bounds (ns,nf)\n" -"msk : input rank-2 array('B') with bounds (ns,nf)\n" -"row : input rank-1 array('H') with bounds (*)\n" -"col : input rank-1 array('H') with bounds (*)\n" -"val : input rank-1 array('I') with bounds (*)\n" -"cut : input float\n" -"\nReturns\n-------\n" -"tosparse_u32 : int"; -/* extern int tosparse_u32(unsigned*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned*,float,int,int); */ -static PyObject *f2py_rout__cImageD11_tosparse_u32(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(unsigned*,unsigned_char*,unsigned_short*,unsigned_short*,unsigned*,float,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int tosparse_u32_return_value=0; - unsigned *img = NULL; - npy_intp img_Dims[2] = {-1, -1}; - const int img_Rank = 2; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - unsigned_char *msk = NULL; - npy_intp msk_Dims[2] = {-1, -1}; - const int msk_Rank = 2; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - unsigned_short *row = NULL; - npy_intp row_Dims[1] = {-1}; - const int row_Rank = 1; - PyArrayObject *capi_row_as_array = NULL; - int capi_row_intent = 0; - PyObject *row_capi = Py_None; - unsigned_short *col = NULL; - npy_intp col_Dims[1] = {-1}; - const int col_Rank = 1; - PyArrayObject *capi_col_as_array = NULL; - int capi_col_intent = 0; - PyObject *col_capi = Py_None; - unsigned *val = NULL; - npy_intp val_Dims[1] = {-1}; - const int val_Rank = 1; - PyArrayObject *capi_val_as_array = NULL; - int capi_val_intent = 0; - PyObject *val_capi = Py_None; - float cut = 0; - PyObject *cut_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"img","msk","row","col","val","cut",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.tosparse_u32",\ - capi_kwlist,&img_capi,&msk_capi,&row_capi,&col_capi,&val_capi,&cut_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_UINT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (unsigned *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable row */ - ; - capi_row_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 3rd argument `row`"; - capi_row_as_array = ndarray_from_pyobj( NPY_USHORT,1,row_Dims,row_Rank, capi_row_intent,row_capi,capi_errmess); - if (capi_row_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - row = (unsigned_short *)(PyArray_DATA(capi_row_as_array)); - - /* Processing variable col */ - ; - capi_col_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 4th argument `col`"; - capi_col_as_array = ndarray_from_pyobj( NPY_USHORT,1,col_Dims,col_Rank, capi_col_intent,col_capi,capi_errmess); - if (capi_col_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - col = (unsigned_short *)(PyArray_DATA(capi_col_as_array)); - - /* Processing variable val */ - ; - capi_val_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 5th argument `val`"; - capi_val_as_array = ndarray_from_pyobj( NPY_UINT,1,val_Dims,val_Rank, capi_val_intent,val_capi,capi_errmess); - if (capi_val_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - val = (unsigned *)(PyArray_DATA(capi_val_as_array)); - - /* Processing variable cut */ - f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.tosparse_u32() 6th argument (cut) can't be converted to float"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(img,0); - /* Processing variable nf */ - nf = shape(img,1); - /* Processing variable msk */ - msk_Dims[0]=ns,msk_Dims[1]=nf; - capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_u32: failed to create array from the 2nd argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - tosparse_u32_return_value = (*f2py_func)(img,msk,row,col,val,cut,ns,nf); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",tosparse_u32_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ - if((PyObject *)capi_val_as_array!=val_capi) { - Py_XDECREF(capi_val_as_array); } - } /* if (capi_val_as_array == NULL) ... else of val */ - /* End of cleaning variable val */ - if((PyObject *)capi_col_as_array!=col_capi) { - Py_XDECREF(capi_col_as_array); } - } /* if (capi_col_as_array == NULL) ... else of col */ - /* End of cleaning variable col */ - if((PyObject *)capi_row_as_array!=row_capi) { - Py_XDECREF(capi_row_as_array); } - } /* if (capi_row_as_array == NULL) ... else of row */ - /* End of cleaning variable row */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of tosparse_u32 ****************************/ - -/******************************** tosparse_f32 ********************************/ -static char doc_f2py_rout__cImageD11_tosparse_f32[] = "\ -tosparse_f32 = tosparse_f32(img,msk,row,col,val,cut)\n\nWrapper for ``tosparse_f32``.\ -\n\nParameters\n----------\n" -"img : input rank-2 array('f') with bounds (ns,nf)\n" -"msk : input rank-2 array('B') with bounds (ns,nf)\n" -"row : input rank-2 array('H') with bounds (ns,nf)\n" -"col : input rank-2 array('H') with bounds (ns,nf)\n" -"val : input rank-2 array('f') with bounds (ns,nf)\n" -"cut : input float\n" -"\nReturns\n-------\n" -"tosparse_f32 : int"; -/* extern int tosparse_f32(float*,unsigned_char*,unsigned_short*,unsigned_short*,float*,float,int,int); */ -static PyObject *f2py_rout__cImageD11_tosparse_f32(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - int (*f2py_func)(float*,unsigned_char*,unsigned_short*,unsigned_short*,float*,float,int,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - int tosparse_f32_return_value=0; - float *img = NULL; - npy_intp img_Dims[2] = {-1, -1}; - const int img_Rank = 2; - PyArrayObject *capi_img_as_array = NULL; - int capi_img_intent = 0; - PyObject *img_capi = Py_None; - unsigned_char *msk = NULL; - npy_intp msk_Dims[2] = {-1, -1}; - const int msk_Rank = 2; - PyArrayObject *capi_msk_as_array = NULL; - int capi_msk_intent = 0; - PyObject *msk_capi = Py_None; - unsigned_short *row = NULL; - npy_intp row_Dims[2] = {-1, -1}; - const int row_Rank = 2; - PyArrayObject *capi_row_as_array = NULL; - int capi_row_intent = 0; - PyObject *row_capi = Py_None; - unsigned_short *col = NULL; - npy_intp col_Dims[2] = {-1, -1}; - const int col_Rank = 2; - PyArrayObject *capi_col_as_array = NULL; - int capi_col_intent = 0; - PyObject *col_capi = Py_None; - float *val = NULL; - npy_intp val_Dims[2] = {-1, -1}; - const int val_Rank = 2; - PyArrayObject *capi_val_as_array = NULL; - int capi_val_intent = 0; - PyObject *val_capi = Py_None; - float cut = 0; - PyObject *cut_capi = Py_None; - int ns = 0; - int nf = 0; - static char *capi_kwlist[] = {"img","msk","row","col","val","cut",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOOOO|:_cImageD11.tosparse_f32",\ - capi_kwlist,&img_capi,&msk_capi,&row_capi,&col_capi,&val_capi,&cut_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable img */ - ; - capi_img_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 1st argument `img`"; - capi_img_as_array = ndarray_from_pyobj( NPY_FLOAT,1,img_Dims,img_Rank, capi_img_intent,img_capi,capi_errmess); - if (capi_img_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - img = (float *)(PyArray_DATA(capi_img_as_array)); - - /* Processing variable cut */ - f2py_success = float_from_pyobj(&cut,cut_capi,"_cImageD11.tosparse_f32() 6th argument (cut) can't be converted to float"); - if (f2py_success) { - /* Processing variable ns */ - ns = shape(img,0); - /* Processing variable nf */ - nf = shape(img,1); - /* Processing variable msk */ - msk_Dims[0]=ns,msk_Dims[1]=nf; - capi_msk_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 2nd argument `msk`"; - capi_msk_as_array = ndarray_from_pyobj( NPY_UBYTE,1,msk_Dims,msk_Rank, capi_msk_intent,msk_capi,capi_errmess); - if (capi_msk_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - msk = (unsigned_char *)(PyArray_DATA(capi_msk_as_array)); - - /* Processing variable row */ - row_Dims[0]=ns,row_Dims[1]=nf; - capi_row_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 3rd argument `row`"; - capi_row_as_array = ndarray_from_pyobj( NPY_USHORT,1,row_Dims,row_Rank, capi_row_intent,row_capi,capi_errmess); - if (capi_row_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - row = (unsigned_short *)(PyArray_DATA(capi_row_as_array)); - - /* Processing variable col */ - col_Dims[0]=ns,col_Dims[1]=nf; - capi_col_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 4th argument `col`"; - capi_col_as_array = ndarray_from_pyobj( NPY_USHORT,1,col_Dims,col_Rank, capi_col_intent,col_capi,capi_errmess); - if (capi_col_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - col = (unsigned_short *)(PyArray_DATA(capi_col_as_array)); - - /* Processing variable val */ - val_Dims[0]=ns,val_Dims[1]=nf; - capi_val_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.tosparse_f32: failed to create array from the 5th argument `val`"; - capi_val_as_array = ndarray_from_pyobj( NPY_FLOAT,1,val_Dims,val_Rank, capi_val_intent,val_capi,capi_errmess); - if (capi_val_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - val = (float *)(PyArray_DATA(capi_val_as_array)); - -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - Py_BEGIN_ALLOW_THREADS - tosparse_f32_return_value = (*f2py_func)(img,msk,row,col,val,cut,ns,nf); - Py_END_ALLOW_THREADS -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue("i",tosparse_f32_return_value); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - if((PyObject *)capi_val_as_array!=val_capi) { - Py_XDECREF(capi_val_as_array); } - } /* if (capi_val_as_array == NULL) ... else of val */ - /* End of cleaning variable val */ - if((PyObject *)capi_col_as_array!=col_capi) { - Py_XDECREF(capi_col_as_array); } - } /* if (capi_col_as_array == NULL) ... else of col */ - /* End of cleaning variable col */ - if((PyObject *)capi_row_as_array!=row_capi) { - Py_XDECREF(capi_row_as_array); } - } /* if (capi_row_as_array == NULL) ... else of row */ - /* End of cleaning variable row */ - if((PyObject *)capi_msk_as_array!=msk_capi) { - Py_XDECREF(capi_msk_as_array); } - } /* if (capi_msk_as_array == NULL) ... else of msk */ - /* End of cleaning variable msk */ - /* End of cleaning variable nf */ - /* End of cleaning variable ns */ - } /*if (f2py_success) of cut*/ - /* End of cleaning variable cut */ - if((PyObject *)capi_img_as_array!=img_capi) { - Py_XDECREF(capi_img_as_array); } - } /* if (capi_img_as_array == NULL) ... else of img */ - /* End of cleaning variable img */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/**************************** end of tosparse_f32 ****************************/ - -/*********************************** splat ***********************************/ -static char doc_f2py_rout__cImageD11_splat[] = "\ -splat(rgba,gve,u,npx)\n\nWrapper for ``splat``.\ -\n\nParameters\n----------\n" -"rgba : input rank-3 array('B') with bounds (w,h,4)\n" -"gve : in/output rank-2 array('d') with bounds (ng,3)\n" -"u : input rank-1 array('d') with bounds (9)\n" -"npx : input int"; -/* extern void splat(unsigned_char*,int,int,double*,int,double*,int); */ -static PyObject *f2py_rout__cImageD11_splat(const PyObject *capi_self, - PyObject *capi_args, - PyObject *capi_keywds, - void (*f2py_func)(unsigned_char*,int,int,double*,int,double*,int)) { - PyObject * volatile capi_buildvalue = NULL; - volatile int f2py_success = 1; -/*decl*/ - - unsigned_char *rgba = NULL; - npy_intp rgba_Dims[3] = {-1, -1, -1}; - const int rgba_Rank = 3; - PyArrayObject *capi_rgba_as_array = NULL; - int capi_rgba_intent = 0; - PyObject *rgba_capi = Py_None; - int w = 0; - int h = 0; - double *gve = NULL; - npy_intp gve_Dims[2] = {-1, -1}; - const int gve_Rank = 2; - PyArrayObject *capi_gve_as_array = NULL; - int capi_gve_intent = 0; - PyObject *gve_capi = Py_None; - int ng = 0; - double *u = NULL; - npy_intp u_Dims[1] = {-1}; - const int u_Rank = 1; - PyArrayObject *capi_u_as_array = NULL; - int capi_u_intent = 0; - PyObject *u_capi = Py_None; - int npx = 0; - PyObject *npx_capi = Py_None; - static char *capi_kwlist[] = {"rgba","gve","u","npx",NULL}; - -/*routdebugenter*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_clock(); -#endif - if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\ - "OOOO|:_cImageD11.splat",\ - capi_kwlist,&rgba_capi,&gve_capi,&u_capi,&npx_capi)) - return NULL; -/*frompyobj*/ - /* Processing variable rgba */ - rgba_Dims[2]=4; - capi_rgba_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.splat: failed to create array from the 1st argument `rgba`"; - capi_rgba_as_array = ndarray_from_pyobj( NPY_UBYTE,1,rgba_Dims,rgba_Rank, capi_rgba_intent,rgba_capi,capi_errmess); - if (capi_rgba_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - rgba = (unsigned_char *)(PyArray_DATA(capi_rgba_as_array)); - - /* Processing variable gve */ - gve_Dims[1]=3; - capi_gve_intent |= F2PY_INTENT_INOUT|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.splat: failed to create array from the 2nd argument `gve`"; - capi_gve_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,gve_Dims,gve_Rank, capi_gve_intent,gve_capi,capi_errmess); - if (capi_gve_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - gve = (double *)(PyArray_DATA(capi_gve_as_array)); - - /* Processing variable u */ - u_Dims[0]=9; - capi_u_intent |= F2PY_INTENT_IN|F2PY_INTENT_C; - const char * capi_errmess = "_cImageD11._cImageD11.splat: failed to create array from the 3rd argument `u`"; - capi_u_as_array = ndarray_from_pyobj( NPY_DOUBLE,1,u_Dims,u_Rank, capi_u_intent,u_capi,capi_errmess); - if (capi_u_as_array == NULL) { - PyObject* capi_err = PyErr_Occurred(); - if (capi_err == NULL) { - capi_err = _cImageD11_error; - PyErr_SetString(capi_err, capi_errmess); - } - } else { - u = (double *)(PyArray_DATA(capi_u_as_array)); - - /* Processing variable npx */ - f2py_success = int_from_pyobj(&npx,npx_capi,"_cImageD11.splat() 4th argument (npx) can't be converted to int"); - if (f2py_success) { - /* Processing variable w */ - w = shape(rgba, 1); - /* Processing variable h */ - h = shape(rgba, 0); - /* Processing variable ng */ - ng = shape(gve, 0); - CHECKSCALAR(shape(gve, 0) == ng,"shape(gve, 0) == ng","hidden ng","splat:ng=%d",ng) { -/*end of frompyobj*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_start_call_clock(); -#endif -/*callfortranroutine*/ - (*f2py_func)(rgba,w,h,gve,ng,u,npx); -if (PyErr_Occurred()) - f2py_success = 0; -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_call_clock(); -#endif -/*end of callfortranroutine*/ - if (f2py_success) { -/*pyobjfrom*/ -/*end of pyobjfrom*/ - CFUNCSMESS("Building return value.\n"); - capi_buildvalue = Py_BuildValue(""); -/*closepyobjfrom*/ -/*end of closepyobjfrom*/ - } /*if (f2py_success) after callfortranroutine*/ -/*cleanupfrompyobj*/ - } /*CHECKSCALAR(shape(gve, 0) == ng)*/ - /* End of cleaning variable ng */ - /* End of cleaning variable h */ - /* End of cleaning variable w */ - } /*if (f2py_success) of npx*/ - /* End of cleaning variable npx */ - if((PyObject *)capi_u_as_array!=u_capi) { - Py_XDECREF(capi_u_as_array); } - } /* if (capi_u_as_array == NULL) ... else of u */ - /* End of cleaning variable u */ - if((PyObject *)capi_gve_as_array!=gve_capi) { - Py_XDECREF(capi_gve_as_array); } - } /* if (capi_gve_as_array == NULL) ... else of gve */ - /* End of cleaning variable gve */ - if((PyObject *)capi_rgba_as_array!=rgba_capi) { - Py_XDECREF(capi_rgba_as_array); } - } /* if (capi_rgba_as_array == NULL) ... else of rgba */ - /* End of cleaning variable rgba */ -/*end of cleanupfrompyobj*/ - if (capi_buildvalue == NULL) { -/*routdebugfailure*/ - } else { -/*routdebugleave*/ - } - CFUNCSMESS("Freeing memory.\n"); -/*freemem*/ -#ifdef F2PY_REPORT_ATEXIT -f2py_stop_clock(); -#endif - return capi_buildvalue; -} -/******************************** end of splat ********************************/ -/*eof body*/ - -/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/ -/*need_f90modhooks*/ - -/************** See f2py2e/rules.py: module_rules['modulebody'] **************/ - -/******************* See f2py2e/common_rules.py: buildhooks *******************/ - -/*need_commonhooks*/ - -/**************************** See f2py2e/rules.py ****************************/ - -static FortranDataDef f2py_routine_defs[] = { - {"compute_geometry",-1,{{-1}},0,0,(char *)compute_geometry, (f2py_init_func)f2py_rout__cImageD11_compute_geometry,doc_f2py_rout__cImageD11_compute_geometry}, - {"compute_gv",-1,{{-1}},0,0,(char *)compute_gv, (f2py_init_func)f2py_rout__cImageD11_compute_gv,doc_f2py_rout__cImageD11_compute_gv}, - {"compute_xlylzl",-1,{{-1}},0,0,(char *)compute_xlylzl, (f2py_init_func)f2py_rout__cImageD11_compute_xlylzl,doc_f2py_rout__cImageD11_compute_xlylzl}, - {"quickorient",-1,{{-1}},0,0,(char *)quickorient, (f2py_init_func)f2py_rout__cImageD11_quickorient,doc_f2py_rout__cImageD11_quickorient}, - {"cimaged11_omp_set_num_threads",-1,{{-1}},0,0,(char *)cimaged11_omp_set_num_threads, (f2py_init_func)f2py_rout__cImageD11_cimaged11_omp_set_num_threads,doc_f2py_rout__cImageD11_cimaged11_omp_set_num_threads}, - {"cimaged11_omp_get_max_threads",-1,{{-1}},0,0,(char *)cimaged11_omp_get_max_threads, (f2py_init_func)f2py_rout__cImageD11_cimaged11_omp_get_max_threads,doc_f2py_rout__cImageD11_cimaged11_omp_get_max_threads}, - {"uint16_to_float_darksub",-1,{{-1}},0,0,(char *)uint16_to_float_darksub, (f2py_init_func)f2py_rout__cImageD11_uint16_to_float_darksub,doc_f2py_rout__cImageD11_uint16_to_float_darksub}, - {"uint16_to_float_darkflm",-1,{{-1}},0,0,(char *)uint16_to_float_darkflm, (f2py_init_func)f2py_rout__cImageD11_uint16_to_float_darkflm,doc_f2py_rout__cImageD11_uint16_to_float_darkflm}, - {"frelon_lines",-1,{{-1}},0,0,(char *)frelon_lines, (f2py_init_func)f2py_rout__cImageD11_frelon_lines,doc_f2py_rout__cImageD11_frelon_lines}, - {"frelon_lines_sub",-1,{{-1}},0,0,(char *)frelon_lines_sub, (f2py_init_func)f2py_rout__cImageD11_frelon_lines_sub,doc_f2py_rout__cImageD11_frelon_lines_sub}, - {"array_mean_var_cut",-1,{{-1}},0,0,(char *)array_mean_var_cut, (f2py_init_func)f2py_rout__cImageD11_array_mean_var_cut,doc_f2py_rout__cImageD11_array_mean_var_cut}, - {"array_mean_var_msk",-1,{{-1}},0,0,(char *)array_mean_var_msk, (f2py_init_func)f2py_rout__cImageD11_array_mean_var_msk,doc_f2py_rout__cImageD11_array_mean_var_msk}, - {"array_stats",-1,{{-1}},0,0,(char *)array_stats, (f2py_init_func)f2py_rout__cImageD11_array_stats,doc_f2py_rout__cImageD11_array_stats}, - {"array_histogram",-1,{{-1}},0,0,(char *)array_histogram, (f2py_init_func)f2py_rout__cImageD11_array_histogram,doc_f2py_rout__cImageD11_array_histogram}, - {"reorder_u16_a32",-1,{{-1}},0,0,(char *)reorder_u16_a32, (f2py_init_func)f2py_rout__cImageD11_reorder_u16_a32,doc_f2py_rout__cImageD11_reorder_u16_a32}, - {"reorder_f32_a32",-1,{{-1}},0,0,(char *)reorder_f32_a32, (f2py_init_func)f2py_rout__cImageD11_reorder_f32_a32,doc_f2py_rout__cImageD11_reorder_f32_a32}, - {"reorderlut_u16_a32",-1,{{-1}},0,0,(char *)reorderlut_u16_a32, (f2py_init_func)f2py_rout__cImageD11_reorderlut_u16_a32,doc_f2py_rout__cImageD11_reorderlut_u16_a32}, - {"reorderlut_f32_a32",-1,{{-1}},0,0,(char *)reorderlut_f32_a32, (f2py_init_func)f2py_rout__cImageD11_reorderlut_f32_a32,doc_f2py_rout__cImageD11_reorderlut_f32_a32}, - {"reorder_u16_a32_a16",-1,{{-1}},0,0,(char *)reorder_u16_a32_a16, (f2py_init_func)f2py_rout__cImageD11_reorder_u16_a32_a16,doc_f2py_rout__cImageD11_reorder_u16_a32_a16}, - {"bgcalc",-1,{{-1}},0,0,(char *)bgcalc, (f2py_init_func)f2py_rout__cImageD11_bgcalc,doc_f2py_rout__cImageD11_bgcalc}, - {"verify_rounding",-1,{{-1}},0,0,(char *)verify_rounding, (f2py_init_func)f2py_rout__cImageD11_verify_rounding,doc_f2py_rout__cImageD11_verify_rounding}, - {"closest_vec",-1,{{-1}},0,0,(char *)closest_vec, (f2py_init_func)f2py_rout__cImageD11_closest_vec,doc_f2py_rout__cImageD11_closest_vec}, - {"closest",-1,{{-1}},0,0,(char *)closest, (f2py_init_func)f2py_rout__cImageD11_closest,doc_f2py_rout__cImageD11_closest}, - {"score",-1,{{-1}},0,0,(char *)score, (f2py_init_func)f2py_rout__cImageD11_score,doc_f2py_rout__cImageD11_score}, - {"score_and_refine",-1,{{-1}},0,0,(char *)score_and_refine, (f2py_init_func)f2py_rout__cImageD11_score_and_refine,doc_f2py_rout__cImageD11_score_and_refine}, - {"score_and_assign",-1,{{-1}},0,0,(char *)score_and_assign, (f2py_init_func)f2py_rout__cImageD11_score_and_assign,doc_f2py_rout__cImageD11_score_and_assign}, - {"refine_assigned",-1,{{-1}},0,0,(char *)refine_assigned, (f2py_init_func)f2py_rout__cImageD11_refine_assigned,doc_f2py_rout__cImageD11_refine_assigned}, - {"put_incr64",-1,{{-1}},0,0,(char *)put_incr64, (f2py_init_func)f2py_rout__cImageD11_put_incr64,doc_f2py_rout__cImageD11_put_incr64}, - {"put_incr32",-1,{{-1}},0,0,(char *)put_incr32, (f2py_init_func)f2py_rout__cImageD11_put_incr32,doc_f2py_rout__cImageD11_put_incr32}, - {"cluster1d",-1,{{-1}},0,0,(char *)cluster1d, (f2py_init_func)f2py_rout__cImageD11_cluster1d,doc_f2py_rout__cImageD11_cluster1d}, - {"score_gvec_z",-1,{{-1}},0,0,(char *)score_gvec_z, (f2py_init_func)f2py_rout__cImageD11_score_gvec_z,doc_f2py_rout__cImageD11_score_gvec_z}, - {"misori_cubic",-1,{{-1}},0,0,(char *)misori_cubic, (f2py_init_func)f2py_rout__cImageD11_misori_cubic,doc_f2py_rout__cImageD11_misori_cubic}, - {"misori_orthorhombic",-1,{{-1}},0,0,(char *)misori_orthorhombic, (f2py_init_func)f2py_rout__cImageD11_misori_orthorhombic,doc_f2py_rout__cImageD11_misori_orthorhombic}, - {"misori_tetragonal",-1,{{-1}},0,0,(char *)misori_tetragonal, (f2py_init_func)f2py_rout__cImageD11_misori_tetragonal,doc_f2py_rout__cImageD11_misori_tetragonal}, - {"misori_monoclinic",-1,{{-1}},0,0,(char *)misori_monoclinic, (f2py_init_func)f2py_rout__cImageD11_misori_monoclinic,doc_f2py_rout__cImageD11_misori_monoclinic}, - {"misori_cubic_pairs",-1,{{-1}},0,0,(char *)misori_cubic_pairs, (f2py_init_func)f2py_rout__cImageD11_misori_cubic_pairs,doc_f2py_rout__cImageD11_misori_cubic_pairs}, - {"count_shared",-1,{{-1}},0,0,(char *)count_shared, (f2py_init_func)f2py_rout__cImageD11_count_shared,doc_f2py_rout__cImageD11_count_shared}, - {"connectedpixels",-1,{{-1}},0,0,(char *)connectedpixels, (f2py_init_func)f2py_rout__cImageD11_connectedpixels,doc_f2py_rout__cImageD11_connectedpixels}, - {"blobproperties",-1,{{-1}},0,0,(char *)blobproperties, (f2py_init_func)f2py_rout__cImageD11_blobproperties,doc_f2py_rout__cImageD11_blobproperties}, - {"bloboverlaps",-1,{{-1}},0,0,(char *)bloboverlaps, (f2py_init_func)f2py_rout__cImageD11_bloboverlaps,doc_f2py_rout__cImageD11_bloboverlaps}, - {"blob_moments",-1,{{-1}},0,0,(char *)blob_moments, (f2py_init_func)f2py_rout__cImageD11_blob_moments,doc_f2py_rout__cImageD11_blob_moments}, - {"clean_mask",-1,{{-1}},0,0,(char *)clean_mask, (f2py_init_func)f2py_rout__cImageD11_clean_mask,doc_f2py_rout__cImageD11_clean_mask}, - {"make_clean_mask",-1,{{-1}},0,0,(char *)make_clean_mask, (f2py_init_func)f2py_rout__cImageD11_make_clean_mask,doc_f2py_rout__cImageD11_make_clean_mask}, - {"localmaxlabel",-1,{{-1}},0,0,(char *)localmaxlabel, (f2py_init_func)f2py_rout__cImageD11_localmaxlabel,doc_f2py_rout__cImageD11_localmaxlabel}, - {"mask_to_coo",-1,{{-1}},0,0,(char *)mask_to_coo, (f2py_init_func)f2py_rout__cImageD11_mask_to_coo,doc_f2py_rout__cImageD11_mask_to_coo}, - {"sparse_is_sorted",-1,{{-1}},0,0,(char *)sparse_is_sorted, (f2py_init_func)f2py_rout__cImageD11_sparse_is_sorted,doc_f2py_rout__cImageD11_sparse_is_sorted}, - {"sparse_connectedpixels",-1,{{-1}},0,0,(char *)sparse_connectedpixels, (f2py_init_func)f2py_rout__cImageD11_sparse_connectedpixels,doc_f2py_rout__cImageD11_sparse_connectedpixels}, - {"sparse_connectedpixels_splat",-1,{{-1}},0,0,(char *)sparse_connectedpixels_splat, (f2py_init_func)f2py_rout__cImageD11_sparse_connectedpixels_splat,doc_f2py_rout__cImageD11_sparse_connectedpixels_splat}, - {"sparse_blob2Dproperties",-1,{{-1}},0,0,(char *)sparse_blob2Dproperties, (f2py_init_func)f2py_rout__cImageD11_sparse_blob2Dproperties,doc_f2py_rout__cImageD11_sparse_blob2Dproperties}, - {"sparse_smooth",-1,{{-1}},0,0,(char *)sparse_smooth, (f2py_init_func)f2py_rout__cImageD11_sparse_smooth,doc_f2py_rout__cImageD11_sparse_smooth}, - {"sparse_localmaxlabel",-1,{{-1}},0,0,(char *)sparse_localmaxlabel, (f2py_init_func)f2py_rout__cImageD11_sparse_localmaxlabel,doc_f2py_rout__cImageD11_sparse_localmaxlabel}, - {"sparse_overlaps",-1,{{-1}},0,0,(char *)sparse_overlaps, (f2py_init_func)f2py_rout__cImageD11_sparse_overlaps,doc_f2py_rout__cImageD11_sparse_overlaps}, - {"compress_duplicates",-1,{{-1}},0,0,(char *)compress_duplicates, (f2py_init_func)f2py_rout__cImageD11_compress_duplicates,doc_f2py_rout__cImageD11_compress_duplicates}, - {"coverlaps",-1,{{-1}},0,0,(char *)coverlaps, (f2py_init_func)f2py_rout__cImageD11_coverlaps,doc_f2py_rout__cImageD11_coverlaps}, - {"tosparse_u16",-1,{{-1}},0,0,(char *)tosparse_u16, (f2py_init_func)f2py_rout__cImageD11_tosparse_u16,doc_f2py_rout__cImageD11_tosparse_u16}, - {"tosparse_u32",-1,{{-1}},0,0,(char *)tosparse_u32, (f2py_init_func)f2py_rout__cImageD11_tosparse_u32,doc_f2py_rout__cImageD11_tosparse_u32}, - {"tosparse_f32",-1,{{-1}},0,0,(char *)tosparse_f32, (f2py_init_func)f2py_rout__cImageD11_tosparse_f32,doc_f2py_rout__cImageD11_tosparse_f32}, - {"splat",-1,{{-1}},0,0,(char *)splat, (f2py_init_func)f2py_rout__cImageD11_splat,doc_f2py_rout__cImageD11_splat}, - -/*eof routine_defs*/ - {NULL} -}; - -static PyMethodDef f2py_module_methods[] = { - - {NULL,NULL} -}; - -static struct PyModuleDef moduledef = { - PyModuleDef_HEAD_INIT, - "_cImageD11", - NULL, - -1, - f2py_module_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC PyInit__cImageD11(void) { - int i; - PyObject *m,*d, *s, *tmp; - m = _cImageD11_module = PyModule_Create(&moduledef); - Py_SET_TYPE(&PyFortran_Type, &PyType_Type); - import_array(); - if (PyErr_Occurred()) - {PyErr_SetString(PyExc_ImportError, "can't initialize module _cImageD11 (failed to import numpy)"); return m;} - d = PyModule_GetDict(m); - s = PyUnicode_FromString("1.24.4"); - PyDict_SetItemString(d, "__version__", s); - Py_DECREF(s); - s = PyUnicode_FromString( - "This module '_cImageD11' is auto-generated with f2py (version:1.24.4).\nFunctions:\n" -" compute_geometry(xlylzl,omega,omegasign,wvln,wedge,chi,t,out)\n" -" compute_gv(xlylzl,omega,omegasign,wvln,wedge,chi,t,gv)\n" -" compute_xlylzl(s,f,p,r,dist,xlylzl)\n" -" quickorient(ubi,bt)\n" -" cimaged11_omp_set_num_threads(n)\n" -" cimaged11_omp_get_max_threads = cimaged11_omp_get_max_threads()\n" -" uint16_to_float_darksub(img,drk,data)\n" -" uint16_to_float_darkflm(img,drk,flm,data)\n" -" frelon_lines(img,cut)\n" -" frelon_lines_sub(img,drk,cut)\n" -" mean,var = array_mean_var_cut(img,n=3,cut=3.0,verbose=0)\n" -" mean,var = array_mean_var_msk(img,msk,n=3,cut=3.0,verbose=0)\n" -" minval,maxval,mean,var = array_stats(img)\n" -" array_histogram(img,low,high,hist)\n" -" reorder_u16_a32(data,adr,out)\n" -" reorder_f32_a32(data,adr,out)\n" -" reorderlut_u16_a32(data,adr,out)\n" -" reorderlut_f32_a32(data,adr,out)\n" -" reorder_u16_a32_a16(data,adr0,adr1,out)\n" -" bgcalc(img,bg,msk,gain,sp,st)\n" -" verify_rounding = verify_rounding(n)\n" -" closest_vec(x,ic)\n" -" ibest,best = closest(x,v)\n" -" score = score(ubi,gv,tol)\n" -" n,sumdrlv2 = score_and_refine(ubi,gv,tol)\n" -" score_and_assign = score_and_assign(ubi,gv,tol,drlv2,labels,label)\n" -" npk,drlv2 = refine_assigned(ubi,gv,labels,label)\n" -" put_incr64(data,ind,vals,boundscheck=0)\n" -" put_incr32(data,ind,vals,boundscheck=0)\n" -" nclusters = cluster1d(ar,order,tol,ids,avgs)\n" -" score_gvec_z(ubi,ub,gv,g0,g1,g2,e,recompute)\n" -" misori_cubic = misori_cubic(u1,u2)\n" -" misori_orthorhombic = misori_orthorhombic(u1,u2)\n" -" misori_tetragonal = misori_tetragonal(u1,u2)\n" -" misori_monoclinic = misori_monoclinic(u1,u2)\n" -" misori_cubic_pairs(u,dist,n=shape(u, 0))\n" -" count_shared = count_shared(pi,pj,ni=shape(pi, 0),nj=shape(pj, 0))\n" -" connectedpixels = connectedpixels(data,labels,threshold,verbose=0,con8=1)\n" -" results = blobproperties(data,labels,np,omega=0,verbose=0)\n" -" bloboverlaps = bloboverlaps(labels1,npk1,results1,labels2,npk2,results2,verbose=0)\n" -" blob_moments(results)\n" -" clean_mask = clean_mask(msk,ret)\n" -" make_clean_mask = make_clean_mask(img,cut,msk,ret)\n" -" localmaxlabel = localmaxlabel(data,labels,wrk)\n" -" mask_to_coo = mask_to_coo(msk,i,j,w)\n" -" sparse_is_sorted = sparse_is_sorted(i,j)\n" -" sparse_connectedpixels = sparse_connectedpixels(v,i,j,threshold,labels)\n" -" sparse_connectedpixels_splat = sparse_connectedpixels_splat(v,i,j,th,lbl,Z,ni,nj)\n" -" results = sparse_blob2Dproperties(v,i,j,labels,npk)\n" -" sparse_smooth(v,i,j,s)\n" -" sparse_localmaxlabel = sparse_localmaxlabel(v,i,j,MV,iMV,labels)\n" -" sparse_overlaps = sparse_overlaps(i1,j1,k1,i2,j2,k2)\n" -" compress_duplicates = compress_duplicates(i,j,oi,oj,tmp)\n" -" coverlaps = coverlaps(row1,col1,labels1,row2,col2,labels2,mat,results)\n" -" tosparse_u16 = tosparse_u16(img,msk,row,col,val,cut)\n" -" tosparse_u32 = tosparse_u32(img,msk,row,col,val,cut)\n" -" tosparse_f32 = tosparse_f32(img,msk,row,col,val,cut)\n" -" splat(rgba,gve,u,npx)\n" -"."); - PyDict_SetItemString(d, "__doc__", s); - Py_DECREF(s); - s = PyUnicode_FromString("1.24.4"); - PyDict_SetItemString(d, "__f2py_numpy_version__", s); - Py_DECREF(s); - _cImageD11_error = PyErr_NewException ("_cImageD11.error", NULL, NULL); - /* - * Store the error object inside the dict, so that it could get deallocated. - * (in practice, this is a module, so it likely will not and cannot.) - */ - PyDict_SetItemString(d, "__cImageD11_error", _cImageD11_error); - Py_DECREF(_cImageD11_error); - for(i=0;f2py_routine_defs[i].name!=NULL;i++) { - tmp = PyFortranObject_NewAsAttr(&f2py_routine_defs[i]); - PyDict_SetItemString(d, f2py_routine_defs[i].name, tmp); - Py_DECREF(tmp); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/*eof initf2pywraphooks*/ -/*eof initf90modhooks*/ - -/*eof initcommonhooks*/ - /* start usercode multiline (0) */ - -/* This runs inside the init part of the module as it is after interface */ -#define str(x) (#x) -PyDict_SetItemString(d,str(s_1) ,PyInt_FromLong(s_1)); -PyDict_SetItemString(d,str(s_I) ,PyInt_FromLong(s_I)); -PyDict_SetItemString(d,str(s_I2) ,PyInt_FromLong(s_I2)); -PyDict_SetItemString(d,str(s_fI) ,PyInt_FromLong(s_fI)); -PyDict_SetItemString(d,str(s_ffI) ,PyInt_FromLong(s_ffI)); -PyDict_SetItemString(d,str(s_sI) ,PyInt_FromLong(s_sI)); -PyDict_SetItemString(d,str(s_ssI) ,PyInt_FromLong(s_ssI)); -PyDict_SetItemString(d,str(s_sfI) ,PyInt_FromLong(s_sfI)); -PyDict_SetItemString(d,str(s_oI) ,PyInt_FromLong(s_oI)); -PyDict_SetItemString(d,str(s_ooI) ,PyInt_FromLong(s_ooI)); -PyDict_SetItemString(d,str(s_soI) ,PyInt_FromLong(s_soI)); -PyDict_SetItemString(d,str(s_foI) ,PyInt_FromLong(s_foI)); -PyDict_SetItemString(d,str(mx_I) ,PyInt_FromLong(mx_I)); -PyDict_SetItemString(d,str(mx_I_f) ,PyInt_FromLong(mx_I_f)); -PyDict_SetItemString(d,str(mx_I_s) ,PyInt_FromLong(mx_I_s)); -PyDict_SetItemString(d,str(mx_I_o) ,PyInt_FromLong(mx_I_o)); -PyDict_SetItemString(d,str(bb_mx_f),PyInt_FromLong(bb_mx_f)); -PyDict_SetItemString(d,str(bb_mx_s),PyInt_FromLong(bb_mx_s)); -PyDict_SetItemString(d,str(bb_mx_o),PyInt_FromLong(bb_mx_o)); -PyDict_SetItemString(d,str(bb_mn_f),PyInt_FromLong(bb_mn_f)); -PyDict_SetItemString(d,str(bb_mn_s),PyInt_FromLong(bb_mn_s)); -PyDict_SetItemString(d,str(bb_mn_o),PyInt_FromLong(bb_mn_o)); - -PyDict_SetItemString(d,str(avg_i),PyInt_FromLong(avg_i)); -PyDict_SetItemString(d,str(f_raw),PyInt_FromLong(f_raw)); -PyDict_SetItemString(d,str(s_raw),PyInt_FromLong(s_raw)); -PyDict_SetItemString(d,str(f_cen),PyInt_FromLong(f_cen)); -PyDict_SetItemString(d,str(s_cen),PyInt_FromLong(s_cen)); -PyDict_SetItemString(d,str(o_raw),PyInt_FromLong(o_raw)); -PyDict_SetItemString(d,str(m_ff),PyInt_FromLong(m_ff)); -PyDict_SetItemString(d,str(m_ss),PyInt_FromLong(m_ss)); -PyDict_SetItemString(d,str(m_oo),PyInt_FromLong(m_oo)); -PyDict_SetItemString(d,str(m_sf),PyInt_FromLong(m_sf)); -PyDict_SetItemString(d,str(m_so),PyInt_FromLong(m_so)); -PyDict_SetItemString(d,str(m_fo),PyInt_FromLong(m_fo)); -PyDict_SetItemString(d,str(dety),PyInt_FromLong(dety)); -PyDict_SetItemString(d,str(detz),PyInt_FromLong(detz)); - -PyDict_SetItemString(d,str(NPROPERTY),PyInt_FromLong(NPROPERTY)); - -PyDict_SetItemString(d,str(s2D_1),PyInt_FromLong(s2D_1)); -PyDict_SetItemString(d,str(s2D_I),PyInt_FromLong(s2D_I)); -PyDict_SetItemString(d,str(s2D_fI),PyInt_FromLong(s2D_fI)); -PyDict_SetItemString(d,str(s2D_sI),PyInt_FromLong(s2D_sI)); -PyDict_SetItemString(d,str(s2D_ffI),PyInt_FromLong(s2D_ffI)); -PyDict_SetItemString(d,str(s2D_sfI),PyInt_FromLong(s2D_sfI)); -PyDict_SetItemString(d,str(s2D_ssI),PyInt_FromLong(s2D_ssI)); -PyDict_SetItemString(d,str(s2D_bb_mx_f),PyInt_FromLong(s2D_bb_mx_f)); -PyDict_SetItemString(d,str(s2D_bb_mx_s),PyInt_FromLong(s2D_bb_mx_s)); -PyDict_SetItemString(d,str(s2D_bb_mn_f),PyInt_FromLong(s2D_bb_mn_f)); -PyDict_SetItemString(d,str(s2D_bb_mn_s),PyInt_FromLong(s2D_bb_mn_s)); -PyDict_SetItemString(d,str(NPROPERTY2D),PyInt_FromLong(NPROPERTY2D)); -/* ends user code */ - - /* end multiline (0)*/ - -#ifdef F2PY_REPORT_ATEXIT - if (! PyErr_Occurred()) - on_exit(f2py_report_on_exit,(void*)"_cImageD11"); -#endif - return m; -} -#ifdef __cplusplus -} -#endif From fdc8596cc79d956c460f18c64e753fb719695add Mon Sep 17 00:00:00 2001 From: Loic Jegou Date: Tue, 14 Jan 2025 09:10:45 +0100 Subject: [PATCH 4/4] With pbp modifications... --- ImageD11/sinograms/point_by_point.py | 48 ++++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ImageD11/sinograms/point_by_point.py b/ImageD11/sinograms/point_by_point.py index a97e55f6..d8ddb3f3 100644 --- a/ImageD11/sinograms/point_by_point.py +++ b/ImageD11/sinograms/point_by_point.py @@ -49,7 +49,7 @@ # GOTO - find somewhere! # Everything written in Numba could move to C? -@numba.njit(boundscheck=True) +@numba.njit(boundscheck=True, cache = True) def hkluniq(ubi, gx, gy, gz, eta, m, tol, hmax): """count uniq peaks - move to cImageD11 in the future""" # index from -hmax to hmax @@ -82,7 +82,7 @@ def hkluniq(ubi, gx, gy, gz, eta, m, tol, hmax): # stuff we need to compute g-vectors # from ImageD11.transform -@numba.njit +@numba.njit(cache = True) def detector_rotation_matrix(tilt_x, tilt_y, tilt_z): r1 = np.array([[np.cos(tilt_z), -np.sin(tilt_z), 0.0], # note this is r.h. [np.sin(tilt_z), np.cos(tilt_z), 0.0], @@ -97,7 +97,7 @@ def detector_rotation_matrix(tilt_x, tilt_y, tilt_z): return r2r1 -@numba.njit +@numba.njit(cache = True) def compute_xyz_lab(sc, fc, y_center=0., y_size=0., tilt_y=0., z_center=0., z_size=0., tilt_z=0., @@ -132,7 +132,7 @@ def compute_xyz_lab(sc, fc, return rotvec -@numba.njit +@numba.njit(cache=True) def compute_tth_eta_from_xyz(peaks_xyz, t_x=0.0, t_y=0.0, t_z=0.0, wedge=0.0, # Wedge == theta on 4circ @@ -147,7 +147,7 @@ def compute_tth_eta_from_xyz(peaks_xyz, return tth, eta -@numba.njit +@numba.njit(cache=True) def compute_tth_eta(sc, fc, y_center=0., y_size=0., tilt_y=0., z_center=0., z_size=0., tilt_z=0., @@ -175,7 +175,7 @@ def compute_tth_eta(sc, fc, return tth, eta -@numba.njit +@numba.njit(cache=True) def compute_k_vectors(tth, eta, wvln): """ generate k vectors - scattering vectors in laboratory frame @@ -195,7 +195,7 @@ def compute_k_vectors(tth, eta, wvln): return k -@numba.njit +@numba.njit(cache=True) def compute_g_from_k(k, omega, wedge=0, chi=0): """ Compute g-vectors with cached k-vectors @@ -226,7 +226,7 @@ def compute_g_from_k(k, omega, wedge=0, chi=0): return g -@numba.njit +@numba.njit(cache=True) def compute_g_vectors(tth, eta, omega, @@ -243,7 +243,7 @@ def compute_g_vectors(tth, return compute_g_from_k(k, omega, wedge, chi) -@numba.njit +@numba.njit(cache=True) def count_unique_peaks(hkl, etasign, dtyi): N = hkl.shape[1] # Number of entries indices = np.zeros(N, dtype=np.int64) @@ -270,7 +270,7 @@ def count_unique_peaks(hkl, etasign, dtyi): return indices -@numba.njit +@numba.njit(cache=True) def count_unique_peaks_no_dtyi(hkl, etasign): N = hkl.shape[1] # Number of entries indices = np.zeros(N, dtype=np.int64) @@ -297,7 +297,7 @@ def count_unique_peaks_no_dtyi(hkl, etasign): return indices -@numba.njit +@numba.njit(cache=True) def merge(hkl, etasign, dtyi, sum_intensity, sc, fc, omega, dty, xpos_refined, eta): """ merge peaks with the same (h, k, l, etasign, dtyi) @@ -318,7 +318,7 @@ def merge(hkl, etasign, dtyi, sum_intensity, sc, fc, omega, dty, xpos_refined, e return merged_sum_intensity, merged_sc, merged_fc, merged_omega, merged_dty, merged_xpos_refined, merged_eta -@numba.njit +@numba.njit(cache=True) def get_voxel_idx(y0, xi0, yi0, sinomega, cosomega, dty, ystep): """ get peaks at xi0, yi0 @@ -331,7 +331,7 @@ def get_voxel_idx(y0, xi0, yi0, sinomega, cosomega, dty, ystep): return idx, ydist -@numba.njit +@numba.njit(cache=True) def compute_gve(sc, fc, omega, xpos, distance, y_center, y_size, tilt_y, z_center, z_size, tilt_z, tilt_x, o11, o12, o21, o22, @@ -367,7 +367,7 @@ def compute_gve(sc, fc, omega, xpos, return gve -@numba.njit +@numba.njit(cache=True) def weighted_lstsq_ubi_fit(ydist, gve, hkl): # run the weighted fit # a.T @ gve = h => gve.T @ a = h.T => a = np.linalg.pinv(gve.T) @ h.T, same for b and c @@ -382,7 +382,7 @@ def weighted_lstsq_ubi_fit(ydist, gve, hkl): return w, ubifit, residuals, rank, sing_vals -@numba.njit +@numba.njit(cache=True) def gve_norm(gve): norms = np.zeros(gve.shape[1]) for i in range(gve.shape[1]): @@ -392,7 +392,7 @@ def gve_norm(gve): return norms -@numba.njit +@numba.njit(cache=True) def divide_where(arr1, arr2, out, wherearr): """ Do arr1/arr2. @@ -402,7 +402,7 @@ def divide_where(arr1, arr2, out, wherearr): return np.where(wherearr != 0, div, out) -@numba.njit +@numba.njit(cache=True) def ubi_to_unitcell(ubi): # fast numba version, can't use guvec version from tensor_map.py here unfortunately mt = np.dot(ubi, ubi.T) @@ -414,7 +414,7 @@ def ubi_to_unitcell(ubi): return np.array([a, b, c, al, be, ga]) -@numba.njit +@numba.njit(cache=True) def ubi_and_ucell_to_u(ubi, ucell): # compute B a, b, c = ucell[:3] @@ -453,7 +453,7 @@ def ubi_and_ucell_to_u(ubi, ucell): return u -@numba.njit +@numba.njit(cache=True) def nb_choose_best(i, j, u, n, NY, ubiar, minpeaks=6): # map of the unique scores @@ -486,7 +486,7 @@ def nb_choose_best(i, j, u, n, NY, ubiar, return uniq, npk, ubi, best_rows -@numba.njit +@numba.njit(cache=True) def nb_inv(mats, imats): for i in range(mats.shape[0]): for j in range(mats.shape[1]): @@ -501,7 +501,7 @@ def nb_inv(mats, imats): imats[i, j] = 42. -@numba.njit +@numba.njit(cache=True) def nb_inv_3d(mats, imats): for i in range(mats.shape[0]): for j in range(mats.shape[1]): @@ -1267,7 +1267,7 @@ def prepare_refine_bash(pbp_object, id11_code_path, output_filename): return bash_script_path -@numba.njit +@numba.njit(cache=True) def unique_with_counts(a): # https://github.com/numba/numba/pull/2959/commits/6657709adcf128d97eaaf8371d9106d48e2360ba b = np.sort(a.ravel()) @@ -1282,7 +1282,7 @@ def unique_with_counts(a): return np.array(unique), np.array(counts) -@numba.njit(parallel=True) +@numba.njit(parallel=True,cache=True) def compute_origins(singlemap, sample_mask, gve, sinomega, cosomega, omega, dty, sx_grid, sy_grid, @@ -1385,7 +1385,7 @@ def compute_origins(singlemap, sample_mask, return lx_modified -@numba.njit(parallel=True) +@numba.njit(parallel=True, cache=True) def refine_map(refine_points, all_pbpmap_ubis, ri_col, rj_col, sx_grid, sy_grid, mask, # refinement stuff sc, fc, eta, sum_intensity, sinomega, cosomega, omega, dty, dtyi, xpos, # icolf columns ystep, y0,