/* File: CCFmodule.c
 * This file is auto-generated with f2py (version:2.4.3).
 * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
 * written by Pearu Peterson <pearu@cens.ioc.ee>.
 * Generation date: Tue Mar 24 23:42:32 2026
 * 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 <Python.h>
#include <numpy/npy_os.h>

/*********************** See f2py2e/cfuncs.py: includes ***********************/
#include "fortranobject.h"
#include <math.h>

/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/
static PyObject *CCF_error;
static PyObject *CCF_module;

/*********************** See f2py2e/cfuncs.py: typedefs ***********************/
/*need_typedefs*/

/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/
/*need_typedefs_generated*/

/********************** See f2py2e/cfuncs.py: cppmacros **********************/

#if defined(PREPEND_FORTRAN)
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F
#else
#define F_WRAPPEDFUNC(f,F) _f2pywrap##f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) _F2PYWRAP##F##_
#else
#define F_WRAPPEDFUNC(f,F) _f2pywrap##f##_
#endif
#endif
#else
#if defined(NO_APPEND_FORTRAN)
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F
#else
#define F_WRAPPEDFUNC(f,F) f2pywrap##f
#endif
#else
#if defined(UPPERCASE_FORTRAN)
#define F_WRAPPEDFUNC(f,F) F2PYWRAP##F##_
#else
#define F_WRAPPEDFUNC(f,F) f2pywrap##f##_
#endif
#endif
#endif
#if defined(UNDERSCORE_G77)
#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f##_,F##_)
#else
#define F_WRAPPEDFUNC_US(f,F) F_WRAPPEDFUNC(f,F)
#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


/* 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(CCF_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


/************************ 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 = CCF_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 = CCF_error;
        }
        PyErr_SetString(err, errmess);
    }
    return 0;
}


/********************* See f2py2e/cfuncs.py: userincludes *********************/
/*need_userincludes*/

/********************* See f2py2e/capi_rules.py: usercode *********************/


/* See f2py2e/rules.py */
extern void F_WRAPPEDFUNC(ccf,CCF)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*);
extern void F_WRAPPEDFUNC(ccfpix,CCFPIX)(double*,double*,double*,double*,double*,double*,int*,int*);
extern void F_WRAPPEDFUNC(ccfcos,CCFCOS)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*);
extern void F_FUNC_US(ccfcos_batch,CCFCOS_BATCH)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*);
/*eof externroutines*/

/******************** See f2py2e/capi_rules.py: usercode1 ********************/


/******************* See f2py2e/cb_rules.py: buildcallback *******************/
/*need_callbacks*/

/*********************** See f2py2e/rules.py: buildapi ***********************/

/************************************ ccf ************************************/
static char doc_f2py_rout_CCF_ccf[] = "\
ccf,snw = ccf(m_l,m_h,wav,spec,weight,sn,v_r,[n,m])\n\nWrapper for ``ccf``.\
\n\nParameters\n----------\n"
"m_l : input rank-1 array('d') with bounds (n)\n"
"m_h : input rank-1 array('d') with bounds (n)\n"
"wav : input rank-1 array('d') with bounds (m)\n"
"spec : input rank-1 array('d') with bounds (m)\n"
"weight : input rank-1 array('d') with bounds (n)\n"
"sn : input rank-1 array('d') with bounds (m)\n"
"v_r : input float\n"
"\nOther Parameters\n----------------\n"
"n : input int, optional\n    Default: len(m_l)\n"
"m : input int, optional\n    Default: len(wav)\n"
"\nReturns\n-------\n"
"ccf : float\n"
"snw : float";
/* extern void F_WRAPPEDFUNC(ccf,CCF)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*); */
static PyObject *f2py_rout_CCF_ccf(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    double ccf = 0;
    double *m_l = NULL;
    npy_intp m_l_Dims[1] = {-1};
    const int m_l_Rank = 1;
    PyArrayObject *capi_m_l_as_array = NULL;
    int capi_m_l_intent = 0;
    PyObject *m_l_capi = Py_None;
    double *m_h = NULL;
    npy_intp m_h_Dims[1] = {-1};
    const int m_h_Rank = 1;
    PyArrayObject *capi_m_h_as_array = NULL;
    int capi_m_h_intent = 0;
    PyObject *m_h_capi = Py_None;
    double *wav = NULL;
    npy_intp wav_Dims[1] = {-1};
    const int wav_Rank = 1;
    PyArrayObject *capi_wav_as_array = NULL;
    int capi_wav_intent = 0;
    PyObject *wav_capi = Py_None;
    double *spec = NULL;
    npy_intp spec_Dims[1] = {-1};
    const int spec_Rank = 1;
    PyArrayObject *capi_spec_as_array = NULL;
    int capi_spec_intent = 0;
    PyObject *spec_capi = Py_None;
    double *weight = NULL;
    npy_intp weight_Dims[1] = {-1};
    const int weight_Rank = 1;
    PyArrayObject *capi_weight_as_array = NULL;
    int capi_weight_intent = 0;
    PyObject *weight_capi = Py_None;
    double *sn = NULL;
    npy_intp sn_Dims[1] = {-1};
    const int sn_Rank = 1;
    PyArrayObject *capi_sn_as_array = NULL;
    int capi_sn_intent = 0;
    PyObject *sn_capi = Py_None;
    double v_r = 0;
    PyObject *v_r_capi = Py_None;
    double snw = 0;
    int n = 0;
    PyObject *n_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    static char *capi_kwlist[] = {"m_l","m_h","wav","spec","weight","sn","v_r","n","m",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOO|OO:CCF.ccf",\
        capi_kwlist,&m_l_capi,&m_h_capi,&wav_capi,&spec_capi,&weight_capi,&sn_capi,&v_r_capi,&n_capi,&m_capi))
        return NULL;
/*frompyobj*/
    /* Processing variable m_l */
    ;
    capi_m_l_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccf: failed to create array from the 1st argument `m_l`";
    capi_m_l_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_l_Dims,m_l_Rank,  capi_m_l_intent,m_l_capi,capi_errmess);
    if (capi_m_l_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_l = (double *)(PyArray_DATA(capi_m_l_as_array));

    /* Processing variable wav */
    ;
    capi_wav_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccf: failed to create array from the 3rd argument `wav`";
    capi_wav_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,wav_Dims,wav_Rank,  capi_wav_intent,wav_capi,capi_errmess);
    if (capi_wav_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        wav = (double *)(PyArray_DATA(capi_wav_as_array));

    /* Processing variable v_r */
        f2py_success = double_from_pyobj(&v_r,v_r_capi,"CCF.ccf() 7th argument (v_r) can't be converted to double");
    if (f2py_success) {
    /* Processing variable snw */
    /* Processing variable ccf */
    /* Processing variable n */
    if (n_capi == Py_None) n = len(m_l); else
        f2py_success = int_from_pyobj(&n,n_capi,"CCF.ccf() 1st keyword (n) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(m_l)>=n,"len(m_l)>=n","1st keyword n","ccf:n=%d",n) {
    /* Processing variable m */
    if (m_capi == Py_None) m = len(wav); else
        f2py_success = int_from_pyobj(&m,m_capi,"CCF.ccf() 2nd keyword (m) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(wav)>=m,"len(wav)>=m","2nd keyword m","ccf:m=%d",m) {
    /* Processing variable m_h */
    m_h_Dims[0]=n;
    capi_m_h_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccf: failed to create array from the 2nd argument `m_h`";
    capi_m_h_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_h_Dims,m_h_Rank,  capi_m_h_intent,m_h_capi,capi_errmess);
    if (capi_m_h_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_h = (double *)(PyArray_DATA(capi_m_h_as_array));

    /* Processing variable spec */
    spec_Dims[0]=m;
    capi_spec_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccf: failed to create array from the 4th argument `spec`";
    capi_spec_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,spec_Dims,spec_Rank,  capi_spec_intent,spec_capi,capi_errmess);
    if (capi_spec_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        spec = (double *)(PyArray_DATA(capi_spec_as_array));

    /* Processing variable weight */
    weight_Dims[0]=n;
    capi_weight_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccf: failed to create array from the 5th argument `weight`";
    capi_weight_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,weight_Dims,weight_Rank,  capi_weight_intent,weight_capi,capi_errmess);
    if (capi_weight_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        weight = (double *)(PyArray_DATA(capi_weight_as_array));

    /* Processing variable sn */
    sn_Dims[0]=m;
    capi_sn_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccf: failed to create array from the 6th argument `sn`";
    capi_sn_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,sn_Dims,sn_Rank,  capi_sn_intent,sn_capi,capi_errmess);
    if (capi_sn_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        sn = (double *)(PyArray_DATA(capi_sn_as_array));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
    (*f2py_func)(&ccf,m_l,m_h,wav,spec,weight,sn,&v_r,&snw,&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("dd",ccf,snw);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    if((PyObject *)capi_sn_as_array!=sn_capi) {
        Py_XDECREF(capi_sn_as_array); }
    }  /* if (capi_sn_as_array == NULL) ... else of sn */
    /* End of cleaning variable sn */
    if((PyObject *)capi_weight_as_array!=weight_capi) {
        Py_XDECREF(capi_weight_as_array); }
    }  /* if (capi_weight_as_array == NULL) ... else of weight */
    /* End of cleaning variable weight */
    if((PyObject *)capi_spec_as_array!=spec_capi) {
        Py_XDECREF(capi_spec_as_array); }
    }  /* if (capi_spec_as_array == NULL) ... else of spec */
    /* End of cleaning variable spec */
    if((PyObject *)capi_m_h_as_array!=m_h_capi) {
        Py_XDECREF(capi_m_h_as_array); }
    }  /* if (capi_m_h_as_array == NULL) ... else of m_h */
    /* End of cleaning variable m_h */
    } /*CHECKSCALAR(len(wav)>=m)*/
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
    } /*CHECKSCALAR(len(m_l)>=n)*/
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    /* End of cleaning variable ccf */
    /* End of cleaning variable snw */
    } /*if (f2py_success) of v_r*/
    /* End of cleaning variable v_r */
    if((PyObject *)capi_wav_as_array!=wav_capi) {
        Py_XDECREF(capi_wav_as_array); }
    }  /* if (capi_wav_as_array == NULL) ... else of wav */
    /* End of cleaning variable wav */
    if((PyObject *)capi_m_l_as_array!=m_l_capi) {
        Py_XDECREF(capi_m_l_as_array); }
    }  /* if (capi_m_l_as_array == NULL) ... else of m_l */
    /* End of cleaning variable m_l */
/*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 ccf *********************************/

/*********************************** ccfpix ***********************************/
static char doc_f2py_rout_CCF_ccfpix[] = "\
ccfpix = ccfpix(m_l,m_h,x,thar,delta,[n,m])\n\nWrapper for ``ccfpix``.\
\n\nParameters\n----------\n"
"m_l : input rank-1 array('d') with bounds (n)\n"
"m_h : input rank-1 array('d') with bounds (n)\n"
"x : input rank-1 array('d') with bounds (m)\n"
"thar : input rank-1 array('d') with bounds (m)\n"
"delta : input float\n"
"\nOther Parameters\n----------------\n"
"n : input int, optional\n    Default: len(m_l)\n"
"m : input int, optional\n    Default: len(x)\n"
"\nReturns\n-------\n"
"ccfpix : float";
/* extern void F_WRAPPEDFUNC(ccfpix,CCFPIX)(double*,double*,double*,double*,double*,double*,int*,int*); */
static PyObject *f2py_rout_CCF_ccfpix(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,double*,double*,double*,double*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    double ccfpix = 0;
    double *m_l = NULL;
    npy_intp m_l_Dims[1] = {-1};
    const int m_l_Rank = 1;
    PyArrayObject *capi_m_l_as_array = NULL;
    int capi_m_l_intent = 0;
    PyObject *m_l_capi = Py_None;
    double *m_h = NULL;
    npy_intp m_h_Dims[1] = {-1};
    const int m_h_Rank = 1;
    PyArrayObject *capi_m_h_as_array = NULL;
    int capi_m_h_intent = 0;
    PyObject *m_h_capi = Py_None;
    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 *thar = NULL;
    npy_intp thar_Dims[1] = {-1};
    const int thar_Rank = 1;
    PyArrayObject *capi_thar_as_array = NULL;
    int capi_thar_intent = 0;
    PyObject *thar_capi = Py_None;
    double delta = 0;
    PyObject *delta_capi = Py_None;
    int n = 0;
    PyObject *n_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    static char *capi_kwlist[] = {"m_l","m_h","x","thar","delta","n","m",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOO|OO:CCF.ccfpix",\
        capi_kwlist,&m_l_capi,&m_h_capi,&x_capi,&thar_capi,&delta_capi,&n_capi,&m_capi))
        return NULL;
/*frompyobj*/
    /* Processing variable m_l */
    ;
    capi_m_l_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfpix: failed to create array from the 1st argument `m_l`";
    capi_m_l_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_l_Dims,m_l_Rank,  capi_m_l_intent,m_l_capi,capi_errmess);
    if (capi_m_l_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_l = (double *)(PyArray_DATA(capi_m_l_as_array));

    /* Processing variable x */
    ;
    capi_x_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfpix: failed to create array from the 3rd 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 = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        x = (double *)(PyArray_DATA(capi_x_as_array));

    /* Processing variable delta */
        f2py_success = double_from_pyobj(&delta,delta_capi,"CCF.ccfpix() 5th argument (delta) can't be converted to double");
    if (f2py_success) {
    /* Processing variable ccfpix */
    /* Processing variable n */
    if (n_capi == Py_None) n = len(m_l); else
        f2py_success = int_from_pyobj(&n,n_capi,"CCF.ccfpix() 1st keyword (n) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(m_l)>=n,"len(m_l)>=n","1st keyword n","ccfpix:n=%d",n) {
    /* Processing variable m */
    if (m_capi == Py_None) m = len(x); else
        f2py_success = int_from_pyobj(&m,m_capi,"CCF.ccfpix() 2nd keyword (m) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(x)>=m,"len(x)>=m","2nd keyword m","ccfpix:m=%d",m) {
    /* Processing variable m_h */
    m_h_Dims[0]=n;
    capi_m_h_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfpix: failed to create array from the 2nd argument `m_h`";
    capi_m_h_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_h_Dims,m_h_Rank,  capi_m_h_intent,m_h_capi,capi_errmess);
    if (capi_m_h_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_h = (double *)(PyArray_DATA(capi_m_h_as_array));

    /* Processing variable thar */
    thar_Dims[0]=m;
    capi_thar_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfpix: failed to create array from the 4th argument `thar`";
    capi_thar_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,thar_Dims,thar_Rank,  capi_thar_intent,thar_capi,capi_errmess);
    if (capi_thar_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        thar = (double *)(PyArray_DATA(capi_thar_as_array));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
    (*f2py_func)(&ccfpix,m_l,m_h,x,thar,&delta,&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("d",ccfpix);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    if((PyObject *)capi_thar_as_array!=thar_capi) {
        Py_XDECREF(capi_thar_as_array); }
    }  /* if (capi_thar_as_array == NULL) ... else of thar */
    /* End of cleaning variable thar */
    if((PyObject *)capi_m_h_as_array!=m_h_capi) {
        Py_XDECREF(capi_m_h_as_array); }
    }  /* if (capi_m_h_as_array == NULL) ... else of m_h */
    /* End of cleaning variable m_h */
    } /*CHECKSCALAR(len(x)>=m)*/
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
    } /*CHECKSCALAR(len(m_l)>=n)*/
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    /* End of cleaning variable ccfpix */
    } /*if (f2py_success) of delta*/
    /* End of cleaning variable delta */
    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 */
    if((PyObject *)capi_m_l_as_array!=m_l_capi) {
        Py_XDECREF(capi_m_l_as_array); }
    }  /* if (capi_m_l_as_array == NULL) ... else of m_l */
    /* End of cleaning variable m_l */
/*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 ccfpix *******************************/

/*********************************** ccfcos ***********************************/
static char doc_f2py_rout_CCF_ccfcos[] = "\
ccfcos,snw = ccfcos(m_l,m_h,wav,spec,weight,sn,v_r,[n,m])\n\nWrapper for ``ccfcos``.\
\n\nParameters\n----------\n"
"m_l : input rank-1 array('d') with bounds (n)\n"
"m_h : input rank-1 array('d') with bounds (n)\n"
"wav : input rank-1 array('d') with bounds (m)\n"
"spec : input rank-1 array('d') with bounds (m)\n"
"weight : input rank-1 array('d') with bounds (n)\n"
"sn : input rank-1 array('d') with bounds (m)\n"
"v_r : input float\n"
"\nOther Parameters\n----------------\n"
"n : input int, optional\n    Default: len(m_l)\n"
"m : input int, optional\n    Default: len(wav)\n"
"\nReturns\n-------\n"
"ccfcos : float\n"
"snw : float";
/* extern void F_WRAPPEDFUNC(ccfcos,CCFCOS)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*); */
static PyObject *f2py_rout_CCF_ccfcos(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    double ccfcos = 0;
    double *m_l = NULL;
    npy_intp m_l_Dims[1] = {-1};
    const int m_l_Rank = 1;
    PyArrayObject *capi_m_l_as_array = NULL;
    int capi_m_l_intent = 0;
    PyObject *m_l_capi = Py_None;
    double *m_h = NULL;
    npy_intp m_h_Dims[1] = {-1};
    const int m_h_Rank = 1;
    PyArrayObject *capi_m_h_as_array = NULL;
    int capi_m_h_intent = 0;
    PyObject *m_h_capi = Py_None;
    double *wav = NULL;
    npy_intp wav_Dims[1] = {-1};
    const int wav_Rank = 1;
    PyArrayObject *capi_wav_as_array = NULL;
    int capi_wav_intent = 0;
    PyObject *wav_capi = Py_None;
    double *spec = NULL;
    npy_intp spec_Dims[1] = {-1};
    const int spec_Rank = 1;
    PyArrayObject *capi_spec_as_array = NULL;
    int capi_spec_intent = 0;
    PyObject *spec_capi = Py_None;
    double *weight = NULL;
    npy_intp weight_Dims[1] = {-1};
    const int weight_Rank = 1;
    PyArrayObject *capi_weight_as_array = NULL;
    int capi_weight_intent = 0;
    PyObject *weight_capi = Py_None;
    double *sn = NULL;
    npy_intp sn_Dims[1] = {-1};
    const int sn_Rank = 1;
    PyArrayObject *capi_sn_as_array = NULL;
    int capi_sn_intent = 0;
    PyObject *sn_capi = Py_None;
    double v_r = 0;
    PyObject *v_r_capi = Py_None;
    double snw = 0;
    int n = 0;
    PyObject *n_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    static char *capi_kwlist[] = {"m_l","m_h","wav","spec","weight","sn","v_r","n","m",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOO|OO:CCF.ccfcos",\
        capi_kwlist,&m_l_capi,&m_h_capi,&wav_capi,&spec_capi,&weight_capi,&sn_capi,&v_r_capi,&n_capi,&m_capi))
        return NULL;
/*frompyobj*/
    /* Processing variable m_l */
    ;
    capi_m_l_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos: failed to create array from the 1st argument `m_l`";
    capi_m_l_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_l_Dims,m_l_Rank,  capi_m_l_intent,m_l_capi,capi_errmess);
    if (capi_m_l_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_l = (double *)(PyArray_DATA(capi_m_l_as_array));

    /* Processing variable wav */
    ;
    capi_wav_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos: failed to create array from the 3rd argument `wav`";
    capi_wav_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,wav_Dims,wav_Rank,  capi_wav_intent,wav_capi,capi_errmess);
    if (capi_wav_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        wav = (double *)(PyArray_DATA(capi_wav_as_array));

    /* Processing variable v_r */
        f2py_success = double_from_pyobj(&v_r,v_r_capi,"CCF.ccfcos() 7th argument (v_r) can't be converted to double");
    if (f2py_success) {
    /* Processing variable snw */
    /* Processing variable ccfcos */
    /* Processing variable n */
    if (n_capi == Py_None) n = len(m_l); else
        f2py_success = int_from_pyobj(&n,n_capi,"CCF.ccfcos() 1st keyword (n) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(m_l)>=n,"len(m_l)>=n","1st keyword n","ccfcos:n=%d",n) {
    /* Processing variable m */
    if (m_capi == Py_None) m = len(wav); else
        f2py_success = int_from_pyobj(&m,m_capi,"CCF.ccfcos() 2nd keyword (m) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(wav)>=m,"len(wav)>=m","2nd keyword m","ccfcos:m=%d",m) {
    /* Processing variable m_h */
    m_h_Dims[0]=n;
    capi_m_h_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos: failed to create array from the 2nd argument `m_h`";
    capi_m_h_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_h_Dims,m_h_Rank,  capi_m_h_intent,m_h_capi,capi_errmess);
    if (capi_m_h_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_h = (double *)(PyArray_DATA(capi_m_h_as_array));

    /* Processing variable spec */
    spec_Dims[0]=m;
    capi_spec_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos: failed to create array from the 4th argument `spec`";
    capi_spec_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,spec_Dims,spec_Rank,  capi_spec_intent,spec_capi,capi_errmess);
    if (capi_spec_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        spec = (double *)(PyArray_DATA(capi_spec_as_array));

    /* Processing variable weight */
    weight_Dims[0]=n;
    capi_weight_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos: failed to create array from the 5th argument `weight`";
    capi_weight_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,weight_Dims,weight_Rank,  capi_weight_intent,weight_capi,capi_errmess);
    if (capi_weight_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        weight = (double *)(PyArray_DATA(capi_weight_as_array));

    /* Processing variable sn */
    sn_Dims[0]=m;
    capi_sn_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos: failed to create array from the 6th argument `sn`";
    capi_sn_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,sn_Dims,sn_Rank,  capi_sn_intent,sn_capi,capi_errmess);
    if (capi_sn_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        sn = (double *)(PyArray_DATA(capi_sn_as_array));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
    (*f2py_func)(&ccfcos,m_l,m_h,wav,spec,weight,sn,&v_r,&snw,&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("dd",ccfcos,snw);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    if((PyObject *)capi_sn_as_array!=sn_capi) {
        Py_XDECREF(capi_sn_as_array); }
    }  /* if (capi_sn_as_array == NULL) ... else of sn */
    /* End of cleaning variable sn */
    if((PyObject *)capi_weight_as_array!=weight_capi) {
        Py_XDECREF(capi_weight_as_array); }
    }  /* if (capi_weight_as_array == NULL) ... else of weight */
    /* End of cleaning variable weight */
    if((PyObject *)capi_spec_as_array!=spec_capi) {
        Py_XDECREF(capi_spec_as_array); }
    }  /* if (capi_spec_as_array == NULL) ... else of spec */
    /* End of cleaning variable spec */
    if((PyObject *)capi_m_h_as_array!=m_h_capi) {
        Py_XDECREF(capi_m_h_as_array); }
    }  /* if (capi_m_h_as_array == NULL) ... else of m_h */
    /* End of cleaning variable m_h */
    } /*CHECKSCALAR(len(wav)>=m)*/
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
    } /*CHECKSCALAR(len(m_l)>=n)*/
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    /* End of cleaning variable ccfcos */
    /* End of cleaning variable snw */
    } /*if (f2py_success) of v_r*/
    /* End of cleaning variable v_r */
    if((PyObject *)capi_wav_as_array!=wav_capi) {
        Py_XDECREF(capi_wav_as_array); }
    }  /* if (capi_wav_as_array == NULL) ... else of wav */
    /* End of cleaning variable wav */
    if((PyObject *)capi_m_l_as_array!=m_l_capi) {
        Py_XDECREF(capi_m_l_as_array); }
    }  /* if (capi_m_l_as_array == NULL) ... else of m_l */
    /* End of cleaning variable m_l */
/*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 ccfcos *******************************/

/******************************** ccfcos_batch ********************************/
static char doc_f2py_rout_CCF_ccfcos_batch[] = "\
ccf_out,snw_out = ccfcos_batch(m_l,m_h,wav,spec,weight,sn,vels,[n,m,nv])\n\nWrapper for ``ccfcos_batch``.\
\n\nParameters\n----------\n"
"m_l : input rank-1 array('d') with bounds (n)\n"
"m_h : input rank-1 array('d') with bounds (n)\n"
"wav : input rank-1 array('d') with bounds (m)\n"
"spec : input rank-1 array('d') with bounds (m)\n"
"weight : input rank-1 array('d') with bounds (n)\n"
"sn : input rank-1 array('d') with bounds (m)\n"
"vels : input rank-1 array('d') with bounds (nv)\n"
"\nOther Parameters\n----------------\n"
"n : input int, optional\n    Default: len(m_l)\n"
"m : input int, optional\n    Default: len(wav)\n"
"nv : input int, optional\n    Default: len(vels)\n"
"\nReturns\n-------\n"
"ccf_out : rank-1 array('d') with bounds (nv)\n"
"snw_out : rank-1 array('d') with bounds (nv)";
/* extern void F_FUNC_US(ccfcos_batch,CCFCOS_BATCH)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*); */
static PyObject *f2py_rout_CCF_ccfcos_batch(const PyObject *capi_self,
                           PyObject *capi_args,
                           PyObject *capi_keywds,
                           void (*f2py_func)(double*,double*,double*,double*,double*,double*,double*,double*,double*,int*,int*,int*)) {
    PyObject * volatile capi_buildvalue = NULL;
    volatile int f2py_success = 1;
/*decl*/

    double *m_l = NULL;
    npy_intp m_l_Dims[1] = {-1};
    const int m_l_Rank = 1;
    PyArrayObject *capi_m_l_as_array = NULL;
    int capi_m_l_intent = 0;
    PyObject *m_l_capi = Py_None;
    double *m_h = NULL;
    npy_intp m_h_Dims[1] = {-1};
    const int m_h_Rank = 1;
    PyArrayObject *capi_m_h_as_array = NULL;
    int capi_m_h_intent = 0;
    PyObject *m_h_capi = Py_None;
    double *wav = NULL;
    npy_intp wav_Dims[1] = {-1};
    const int wav_Rank = 1;
    PyArrayObject *capi_wav_as_array = NULL;
    int capi_wav_intent = 0;
    PyObject *wav_capi = Py_None;
    double *spec = NULL;
    npy_intp spec_Dims[1] = {-1};
    const int spec_Rank = 1;
    PyArrayObject *capi_spec_as_array = NULL;
    int capi_spec_intent = 0;
    PyObject *spec_capi = Py_None;
    double *weight = NULL;
    npy_intp weight_Dims[1] = {-1};
    const int weight_Rank = 1;
    PyArrayObject *capi_weight_as_array = NULL;
    int capi_weight_intent = 0;
    PyObject *weight_capi = Py_None;
    double *sn = NULL;
    npy_intp sn_Dims[1] = {-1};
    const int sn_Rank = 1;
    PyArrayObject *capi_sn_as_array = NULL;
    int capi_sn_intent = 0;
    PyObject *sn_capi = Py_None;
    double *vels = NULL;
    npy_intp vels_Dims[1] = {-1};
    const int vels_Rank = 1;
    PyArrayObject *capi_vels_as_array = NULL;
    int capi_vels_intent = 0;
    PyObject *vels_capi = Py_None;
    double *ccf_out = NULL;
    npy_intp ccf_out_Dims[1] = {-1};
    const int ccf_out_Rank = 1;
    PyArrayObject *capi_ccf_out_as_array = NULL;
    int capi_ccf_out_intent = 0;
    double *snw_out = NULL;
    npy_intp snw_out_Dims[1] = {-1};
    const int snw_out_Rank = 1;
    PyArrayObject *capi_snw_out_as_array = NULL;
    int capi_snw_out_intent = 0;
    int n = 0;
    PyObject *n_capi = Py_None;
    int m = 0;
    PyObject *m_capi = Py_None;
    int nv = 0;
    PyObject *nv_capi = Py_None;
    static char *capi_kwlist[] = {"m_l","m_h","wav","spec","weight","sn","vels","n","m","nv",NULL};

/*routdebugenter*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_clock();
#endif
    if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
        "OOOOOOO|OOO:CCF.ccfcos_batch",\
        capi_kwlist,&m_l_capi,&m_h_capi,&wav_capi,&spec_capi,&weight_capi,&sn_capi,&vels_capi,&n_capi,&m_capi,&nv_capi))
        return NULL;
/*frompyobj*/
    /* Processing variable m_l */
    ;
    capi_m_l_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the 1st argument `m_l`";
    capi_m_l_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_l_Dims,m_l_Rank,  capi_m_l_intent,m_l_capi,capi_errmess);
    if (capi_m_l_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_l = (double *)(PyArray_DATA(capi_m_l_as_array));

    /* Processing variable wav */
    ;
    capi_wav_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the 3rd argument `wav`";
    capi_wav_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,wav_Dims,wav_Rank,  capi_wav_intent,wav_capi,capi_errmess);
    if (capi_wav_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        wav = (double *)(PyArray_DATA(capi_wav_as_array));

    /* Processing variable vels */
    ;
    capi_vels_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the 7th argument `vels`";
    capi_vels_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,vels_Dims,vels_Rank,  capi_vels_intent,vels_capi,capi_errmess);
    if (capi_vels_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        vels = (double *)(PyArray_DATA(capi_vels_as_array));

    /* Processing variable n */
    if (n_capi == Py_None) n = len(m_l); else
        f2py_success = int_from_pyobj(&n,n_capi,"CCF.ccfcos_batch() 1st keyword (n) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(m_l)>=n,"len(m_l)>=n","1st keyword n","ccfcos_batch:n=%d",n) {
    /* Processing variable m */
    if (m_capi == Py_None) m = len(wav); else
        f2py_success = int_from_pyobj(&m,m_capi,"CCF.ccfcos_batch() 2nd keyword (m) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(wav)>=m,"len(wav)>=m","2nd keyword m","ccfcos_batch:m=%d",m) {
    /* Processing variable nv */
    if (nv_capi == Py_None) nv = len(vels); else
        f2py_success = int_from_pyobj(&nv,nv_capi,"CCF.ccfcos_batch() 3rd keyword (nv) can't be converted to int");
    if (f2py_success) {
    CHECKSCALAR(len(vels)>=nv,"len(vels)>=nv","3rd keyword nv","ccfcos_batch:nv=%d",nv) {
    /* Processing variable m_h */
    m_h_Dims[0]=n;
    capi_m_h_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the 2nd argument `m_h`";
    capi_m_h_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,m_h_Dims,m_h_Rank,  capi_m_h_intent,m_h_capi,capi_errmess);
    if (capi_m_h_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        m_h = (double *)(PyArray_DATA(capi_m_h_as_array));

    /* Processing variable spec */
    spec_Dims[0]=m;
    capi_spec_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the 4th argument `spec`";
    capi_spec_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,spec_Dims,spec_Rank,  capi_spec_intent,spec_capi,capi_errmess);
    if (capi_spec_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        spec = (double *)(PyArray_DATA(capi_spec_as_array));

    /* Processing variable weight */
    weight_Dims[0]=n;
    capi_weight_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the 5th argument `weight`";
    capi_weight_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,weight_Dims,weight_Rank,  capi_weight_intent,weight_capi,capi_errmess);
    if (capi_weight_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        weight = (double *)(PyArray_DATA(capi_weight_as_array));

    /* Processing variable sn */
    sn_Dims[0]=m;
    capi_sn_intent |= F2PY_INTENT_IN;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the 6th argument `sn`";
    capi_sn_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,sn_Dims,sn_Rank,  capi_sn_intent,sn_capi,capi_errmess);
    if (capi_sn_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        sn = (double *)(PyArray_DATA(capi_sn_as_array));

    /* Processing variable ccf_out */
    ccf_out_Dims[0]=nv;
    capi_ccf_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the hidden `ccf_out`";
    capi_ccf_out_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,ccf_out_Dims,ccf_out_Rank,  capi_ccf_out_intent,Py_None,capi_errmess);
    if (capi_ccf_out_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        ccf_out = (double *)(PyArray_DATA(capi_ccf_out_as_array));

    /* Processing variable snw_out */
    snw_out_Dims[0]=nv;
    capi_snw_out_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE;
    const char capi_errmess[] = "CCF.CCF.ccfcos_batch: failed to create array from the hidden `snw_out`";
    capi_snw_out_as_array = ndarray_from_pyobj(  NPY_DOUBLE,1,snw_out_Dims,snw_out_Rank,  capi_snw_out_intent,Py_None,capi_errmess);
    if (capi_snw_out_as_array == NULL) {
        PyObject* capi_err = PyErr_Occurred();
        if (capi_err == NULL) {
            capi_err = CCF_error;
            PyErr_SetString(capi_err, capi_errmess);
        }
    } else {
        snw_out = (double *)(PyArray_DATA(capi_snw_out_as_array));

/*end of frompyobj*/
#ifdef F2PY_REPORT_ATEXIT
f2py_start_call_clock();
#endif
/*callfortranroutine*/
                (*f2py_func)(m_l,m_h,wav,spec,weight,sn,vels,ccf_out,snw_out,&n,&m,&nv);
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("NN",capi_ccf_out_as_array,capi_snw_out_as_array);
/*closepyobjfrom*/
/*end of closepyobjfrom*/
        } /*if (f2py_success) after callfortranroutine*/
/*cleanupfrompyobj*/
    }  /* if (capi_snw_out_as_array == NULL) ... else of snw_out */
    /* End of cleaning variable snw_out */
    }  /* if (capi_ccf_out_as_array == NULL) ... else of ccf_out */
    /* End of cleaning variable ccf_out */
    if((PyObject *)capi_sn_as_array!=sn_capi) {
        Py_XDECREF(capi_sn_as_array); }
    }  /* if (capi_sn_as_array == NULL) ... else of sn */
    /* End of cleaning variable sn */
    if((PyObject *)capi_weight_as_array!=weight_capi) {
        Py_XDECREF(capi_weight_as_array); }
    }  /* if (capi_weight_as_array == NULL) ... else of weight */
    /* End of cleaning variable weight */
    if((PyObject *)capi_spec_as_array!=spec_capi) {
        Py_XDECREF(capi_spec_as_array); }
    }  /* if (capi_spec_as_array == NULL) ... else of spec */
    /* End of cleaning variable spec */
    if((PyObject *)capi_m_h_as_array!=m_h_capi) {
        Py_XDECREF(capi_m_h_as_array); }
    }  /* if (capi_m_h_as_array == NULL) ... else of m_h */
    /* End of cleaning variable m_h */
    } /*CHECKSCALAR(len(vels)>=nv)*/
    } /*if (f2py_success) of nv*/
    /* End of cleaning variable nv */
    } /*CHECKSCALAR(len(wav)>=m)*/
    } /*if (f2py_success) of m*/
    /* End of cleaning variable m */
    } /*CHECKSCALAR(len(m_l)>=n)*/
    } /*if (f2py_success) of n*/
    /* End of cleaning variable n */
    if((PyObject *)capi_vels_as_array!=vels_capi) {
        Py_XDECREF(capi_vels_as_array); }
    }  /* if (capi_vels_as_array == NULL) ... else of vels */
    /* End of cleaning variable vels */
    if((PyObject *)capi_wav_as_array!=wav_capi) {
        Py_XDECREF(capi_wav_as_array); }
    }  /* if (capi_wav_as_array == NULL) ... else of wav */
    /* End of cleaning variable wav */
    if((PyObject *)capi_m_l_as_array!=m_l_capi) {
        Py_XDECREF(capi_m_l_as_array); }
    }  /* if (capi_m_l_as_array == NULL) ... else of m_l */
    /* End of cleaning variable m_l */
/*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 ccfcos_batch ****************************/
/*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[] = {
    {"ccf",-1,{{-1}},0,0,(char *)  F_WRAPPEDFUNC(ccf,CCF),  (f2py_init_func)f2py_rout_CCF_ccf,doc_f2py_rout_CCF_ccf},
    {"ccfpix",-1,{{-1}},0,0,(char *)  F_WRAPPEDFUNC(ccfpix,CCFPIX),  (f2py_init_func)f2py_rout_CCF_ccfpix,doc_f2py_rout_CCF_ccfpix},
    {"ccfcos",-1,{{-1}},0,0,(char *)  F_WRAPPEDFUNC(ccfcos,CCFCOS),  (f2py_init_func)f2py_rout_CCF_ccfcos,doc_f2py_rout_CCF_ccfcos},
    {"ccfcos_batch",-1,{{-1}},0,0,(char *)  F_FUNC_US(ccfcos_batch,CCFCOS_BATCH),  (f2py_init_func)f2py_rout_CCF_ccfcos_batch,doc_f2py_rout_CCF_ccfcos_batch},

/*eof routine_defs*/
    {NULL}
};

static PyMethodDef f2py_module_methods[] = {

    {NULL,NULL}
};

static struct PyModuleDef moduledef = {
    PyModuleDef_HEAD_INIT,
    "CCF",
    NULL,
    -1,
    f2py_module_methods,
    NULL,
    NULL,
    NULL,
    NULL
};

PyMODINIT_FUNC PyInit_CCF(void) {
    int i;
    PyObject *m,*d, *s, *tmp;
    m = CCF_module = PyModule_Create(&moduledef);
    Py_SET_TYPE(&PyFortran_Type, &PyType_Type);
    import_array();
    if (PyErr_Occurred())
        {PyErr_SetString(PyExc_ImportError, "can't initialize module CCF (failed to import numpy)"); return m;}
    d = PyModule_GetDict(m);
    s = PyUnicode_FromString("2.4.3");
    PyDict_SetItemString(d, "__version__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString(
        "This module 'CCF' is auto-generated with f2py (version:2.4.3).\nFunctions:\n"
"    ccf,snw = ccf(m_l,m_h,wav,spec,weight,sn,v_r,n=len(m_l),m=len(wav))\n"
"    ccfpix = ccfpix(m_l,m_h,x,thar,delta,n=len(m_l),m=len(x))\n"
"    ccfcos,snw = ccfcos(m_l,m_h,wav,spec,weight,sn,v_r,n=len(m_l),m=len(wav))\n"
"    ccf_out,snw_out = ccfcos_batch(m_l,m_h,wav,spec,weight,sn,vels,n=len(m_l),m=len(wav),nv=len(vels))\n"
".");
    PyDict_SetItemString(d, "__doc__", s);
    Py_DECREF(s);
    s = PyUnicode_FromString("2.4.3");
    PyDict_SetItemString(d, "__f2py_numpy_version__", s);
    Py_DECREF(s);
    CCF_error = PyErr_NewException ("CCF.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, "_CCF_error", CCF_error);
    Py_DECREF(CCF_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);
    }

    {
      extern double F_FUNC(ccf,CCF)(void);
      PyObject* o = PyDict_GetItemString(d,"ccf");
      tmp = F2PyCapsule_FromVoidPtr((void*)F_WRAPPEDFUNC(ccf,CCF),NULL);
      PyObject_SetAttrString(o,"_cpointer", tmp);
      Py_DECREF(tmp);
      s = PyUnicode_FromString("ccf");
      PyObject_SetAttrString(o,"__name__", s);
      Py_DECREF(s);
    }
    

    {
      extern double F_FUNC(ccfpix,CCFPIX)(void);
      PyObject* o = PyDict_GetItemString(d,"ccfpix");
      tmp = F2PyCapsule_FromVoidPtr((void*)F_WRAPPEDFUNC(ccfpix,CCFPIX),NULL);
      PyObject_SetAttrString(o,"_cpointer", tmp);
      Py_DECREF(tmp);
      s = PyUnicode_FromString("ccfpix");
      PyObject_SetAttrString(o,"__name__", s);
      Py_DECREF(s);
    }
    

    {
      extern double F_FUNC(ccfcos,CCFCOS)(void);
      PyObject* o = PyDict_GetItemString(d,"ccfcos");
      tmp = F2PyCapsule_FromVoidPtr((void*)F_WRAPPEDFUNC(ccfcos,CCFCOS),NULL);
      PyObject_SetAttrString(o,"_cpointer", tmp);
      Py_DECREF(tmp);
      s = PyUnicode_FromString("ccfcos");
      PyObject_SetAttrString(o,"__name__", s);
      Py_DECREF(s);
    }
    

/*eof initf2pywraphooks*/
/*eof initf90modhooks*/

/*eof initcommonhooks*/


#ifdef Py_GIL_DISABLED
    // signal whether this module supports running with the GIL disabled
    PyUnstable_Module_SetGIL(m , Py_MOD_GIL_USED);
#endif

#ifdef F2PY_REPORT_ATEXIT
    if (! PyErr_Occurred())
        on_exit(f2py_report_on_exit,(void*)"CCF");
#endif

    if (PyType_Ready(&PyFortran_Type) < 0) {
        return NULL;
    }

    return m;
}
#ifdef __cplusplus
}
#endif
