/* Generated by Cython 0.9.6.8 on Wed Nov 14 11:06:42 2007 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#endif
#ifndef WIN32
#define __stdcall
#define __cdecl
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#include "stdlib.h"
#include "math.h"
#include "geodesic.h"
#include "proj_api.h"
#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE
#endif
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
Py_ssize_t ival;
PyObject* x = PyNumber_Index(b);
if (!x) return -1;
ival = PyInt_AsSsize_t(x);
Py_DECREF(x);
return ival;
}
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
if (x == Py_True) return 1;
else if (x == Py_False) return 0;
else return PyObject_IsTrue(x);
}
static int __pyx_skip_dispatch = 0;
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;
static char __pyx_mdoc[] = "\ncopyright (c) 2007 by Jeffrey Whitaker.\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose and without fee is hereby granted,\nprovided that the above copyright notices appear in all copies and that\nboth the copyright notices and this permission notice appear in\nsupporting documentation.\nTHE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\nINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO\nEVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR\nCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF\nUSE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n";
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
static PyObject *__Pyx_ImportModule(char *name); /*proto*/
static int __Pyx_RegisterCleanup(); /*proto*/
static PyObject* cleanup(PyObject *self, PyObject *unused); /*proto*/
static PyMethodDef cleanup_def = {"__cleanup", (PyCFunction)&cleanup, METH_NOARGS, 0};
/* Declarations from _geod */
struct __pyx_obj_5_geod_Geod {
PyObject_HEAD
GEODESIC_T geodesic_t;
PyObject *geodparams;
PyObject *proj_version;
char *geodinitstring;
};
static PyTypeObject *__pyx_ptype_5_geod_Geod = 0;
static PyObject *__pyx_k3;
static PyObject *__pyx_k4;
static PyObject *__pyx_k5;
/* Implementation of _geod */
static char __pyx_k2[] = "1.8.3";
static PyObject *__pyx_n___cinit__;
static PyObject *__pyx_n___reduce__;
static PyObject *__pyx_n__fwd;
static PyObject *__pyx_n__inv;
static PyObject *__pyx_n__npts;
static PyObject *__pyx_n_math;
static PyObject *__pyx_n_radians;
static PyObject *__pyx_n__dg2rad;
static PyObject *__pyx_n_degrees;
static PyObject *__pyx_n__rad2dg;
static PyObject *__pyx_n__doublesize;
static PyObject *__pyx_n___version__;
static PyObject *__pyx_k2p;
static PyObject *__pyx_n_iteritems;
static PyObject *__pyx_n_append;
static PyObject *__pyx_n_join;
static PyObject *__pyx_n_RuntimeError;
static PyObject *__pyx_k6p;
static PyObject *__pyx_k7p;
static PyObject *__pyx_k8p;
static PyObject *__pyx_k9p;
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k6[] = "+";
static char __pyx_k7[] = "=";
static char __pyx_k8[] = " ";
static char __pyx_k9[] = "";
static int __pyx_pf_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_geodparams = 0;
GEODESIC_T __pyx_v_GEOD_T;
PyObject *__pyx_v_geodargs;
PyObject *__pyx_v_key;
PyObject *__pyx_v_value;
int __pyx_r;
PyObject *__pyx_1 = 0;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
static char *__pyx_argnames[] = {"geodparams",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geodparams))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_geodparams);
__pyx_v_geodargs = Py_None; Py_INCREF(Py_None);
__pyx_v_key = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":29
* def __new__(self, geodparams):
* cdef GEODESIC_T GEOD_T
* self.geodparams = geodparams # <<<<<<<<<<<<<<
* # setup proj initialization string.
* geodargs = []
*/
Py_INCREF(__pyx_v_geodparams);
Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams);
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams = __pyx_v_geodparams;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":31
* self.geodparams = geodparams
* # setup proj initialization string.
* geodargs = [] # <<<<<<<<<<<<<<
* for key,value in geodparams.iteritems():
* geodargs.append('+'+key+"="+str(value)+' ')
*/
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; goto __pyx_L1;}
Py_DECREF(__pyx_v_geodargs);
__pyx_v_geodargs = __pyx_1;
__pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":32
* # setup proj initialization string.
* geodargs = []
* for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<<
* geodargs.append('+'+key+"="+str(value)+' ')
* self.geodinitstring = PyString_AsString(''.join(geodargs))
*/
__pyx_1 = PyObject_GetAttr(__pyx_v_geodparams, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_2 = 0; __pyx_1 = __pyx_3; Py_INCREF(__pyx_1); }
else { __pyx_1 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {
if (PyList_CheckExact(__pyx_1)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_2++); Py_INCREF(__pyx_3); }
else {
__pyx_3 = PyIter_Next(__pyx_1);
if (!__pyx_3) {
break;
}
}
if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
__pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0);
Py_INCREF(__pyx_5);
Py_DECREF(__pyx_v_key);
__pyx_v_key = __pyx_5;
__pyx_5 = 0;
__pyx_5 = PyTuple_GET_ITEM(__pyx_3, 1);
Py_INCREF(__pyx_5);
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_5;
__pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
}
else {
__pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_v_key);
__pyx_v_key = __pyx_5;
__pyx_5 = 0;
__pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_5;
__pyx_5 = 0;
if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
}
__pyx_5 = PyObject_GetAttr(__pyx_v_geodargs, __pyx_n_append); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_k6p, __pyx_v_key); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
__pyx_4 = PyNumber_Add(__pyx_3, __pyx_k7p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_INCREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value);
__pyx_6 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyNumber_Add(__pyx_4, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
__pyx_4 = PyNumber_Add(__pyx_3, __pyx_k8p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
__pyx_4 = 0;
__pyx_3 = PyObject_CallObject(__pyx_5, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":34
* for key,value in geodparams.iteritems():
* geodargs.append('+'+key+"="+str(value)+' ')
* self.geodinitstring = PyString_AsString(''.join(geodargs)) # <<<<<<<<<<<<<<
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0]
*/
__pyx_4 = PyObject_GetAttr(__pyx_k9p, __pyx_n_join); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
Py_INCREF(__pyx_v_geodargs);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_geodargs);
__pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring = PyString_AsString(__pyx_6);
Py_DECREF(__pyx_6); __pyx_6 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":36
* self.geodinitstring = PyString_AsString(''.join(geodargs))
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] # <<<<<<<<<<<<<<
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t = (GEOD_init_plus(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring,(&__pyx_v_GEOD_T))[0]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":37
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0]
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* self.proj_version = PJ_VERSION/100.
*/
__pyx_7 = (pj_errno != 0);
if (__pyx_7) {
__pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
__pyx_3 = 0;
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":39
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<<
*
* def __reduce__(self):
*/
__pyx_5 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version);
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version = __pyx_5;
__pyx_5 = 0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("_geod.Geod.__cinit__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_geodargs);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_geodparams);
return __pyx_r;
}
static PyObject *__pyx_n___class__;
static PyObject *__pyx_pf_5_geod_4Geod___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_5_geod_4Geod___reduce__[] = "special method that allows pyproj.Geod instance to be pickled";
static PyObject *__pyx_pf_5_geod_4Geod___reduce__(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams);
PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams);
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
__pyx_1 = 0;
__pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("_geod.Geod.__reduce__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_n_ValueError;
static PyObject *__pyx_k10p;
static PyObject *__pyx_k11p;
static PyObject *__pyx_builtin_ValueError;
static char __pyx_k10[] = "Buffer lengths not the same";
static char __pyx_k11[] = "undefined forward geodesic (may be an equatorial arc)";
static PyObject *__pyx_pf_5_geod_4Geod__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__fwd[] = "\n forward transformation - determine longitude, latitude and back azimuth \n of a terminus point given an initial point longitude and latitude, plus\n forward azimuth and distance.\n if radians=True, lons/lats are radians instead of degrees.\n ";
static PyObject *__pyx_pf_5_geod_4Geod__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_lons = 0;
PyObject *__pyx_v_lats = 0;
PyObject *__pyx_v_az = 0;
PyObject *__pyx_v_dist = 0;
PyObject *__pyx_v_radians = 0;
Py_ssize_t __pyx_v_buflenlons;
Py_ssize_t __pyx_v_buflenlats;
Py_ssize_t __pyx_v_buflenaz;
Py_ssize_t __pyx_v_buflend;
Py_ssize_t __pyx_v_ndim;
Py_ssize_t __pyx_v_i;
double *__pyx_v_lonsdata;
double *__pyx_v_latsdata;
double *__pyx_v_azdata;
double *__pyx_v_distdata;
void *__pyx_v_londata;
void *__pyx_v_latdata;
void *__pyx_v_azdat;
void *__pyx_v_distdat;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
double __pyx_7;
int __pyx_8;
static char *__pyx_argnames[] = {"lons","lats","az","dist","radians",0};
__pyx_v_radians = __pyx_k3;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons, &__pyx_v_lats, &__pyx_v_az, &__pyx_v_dist, &__pyx_v_radians))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_lons);
Py_INCREF(__pyx_v_lats);
Py_INCREF(__pyx_v_az);
Py_INCREF(__pyx_v_dist);
Py_INCREF(__pyx_v_radians);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":56
* cdef void *londata, *latdata, *azdat, *distdat
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons,(&__pyx_v_londata),(&__pyx_v_buflenlons)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":58
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats,(&__pyx_v_latdata),(&__pyx_v_buflenlats)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":60
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_az,(&__pyx_v_azdat),(&__pyx_v_buflenaz)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":62
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* # process data in buffer
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_dist,(&__pyx_v_distdat),(&__pyx_v_buflend)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":65
* raise RuntimeError
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<<
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
*/
__pyx_1 = (__pyx_v_buflenlons == __pyx_v_buflenlats);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenlats == __pyx_v_buflenaz);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenaz == __pyx_v_buflend);
}
}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
Py_INCREF(__pyx_k10p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k10p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":67
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize # <<<<<<<<<<<<<<
* lonsdata = <double *>londata
* latsdata = <double *>latdata
*/
__pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
__pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely((__pyx_6 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_ndim = __pyx_6;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":68
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata # <<<<<<<<<<<<<<
* latsdata = <double *>latdata
* azdata = <double *>azdat
*/
__pyx_v_lonsdata = ((double *)__pyx_v_londata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":69
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
* latsdata = <double *>latdata # <<<<<<<<<<<<<<
* azdata = <double *>azdat
* distdata = <double *>distdat
*/
__pyx_v_latsdata = ((double *)__pyx_v_latdata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":70
* lonsdata = <double *>londata
* latsdata = <double *>latdata
* azdata = <double *>azdat # <<<<<<<<<<<<<<
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
*/
__pyx_v_azdata = ((double *)__pyx_v_azdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":71
* latsdata = <double *>latdata
* azdata = <double *>azdat
* distdata = <double *>distdat # <<<<<<<<<<<<<<
* for i from 0 <= i < ndim:
* if radians:
*/
__pyx_v_distdata = ((double *)__pyx_v_distdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":72
* azdata = <double *>azdat
* distdata = <double *>distdat
* for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
*/
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i++) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":73
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
* if radians: # <<<<<<<<<<<<<<
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":74
* for i from 0 <= i < ndim:
* if radians:
* self.geodesic_t.p1.v = lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = (__pyx_v_lonsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":75
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.ALPHA12 = azdata[i]
* self.geodesic_t.DIST = distdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = (__pyx_v_latsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":76
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.DIST = distdata[i]
* else:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = (__pyx_v_azdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":77
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i]
* self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<<
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_distdata[__pyx_v_i]);
goto __pyx_L9;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":79
* self.geodesic_t.DIST = distdata[i]
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":80
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":81
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t)
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":82
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<<
* geod_pre(&self.geodesic_t)
* if pj_errno != 0:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_distdata[__pyx_v_i]);
}
__pyx_L9:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":83
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t) # <<<<<<<<<<<<<<
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
*/
geod_pre((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":84
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t)
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t)
*/
__pyx_2 = (pj_errno != 0);
if (__pyx_2) {
__pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_5 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
goto __pyx_L10;
}
__pyx_L10:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":86
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t) # <<<<<<<<<<<<<<
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
*/
geod_for((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":87
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t)
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* if isnan(self.geodesic_t.ALPHA21):
*/
__pyx_1 = (pj_errno != 0);
if (__pyx_1) {
__pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_5 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
goto __pyx_L11;
}
__pyx_L11:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":89
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* if isnan(self.geodesic_t.ALPHA21): # <<<<<<<<<<<<<<
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
* if radians:
*/
__pyx_8 = isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21);
if (__pyx_8) {
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_INCREF(__pyx_k11p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k11p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_ValueError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
goto __pyx_L12;
}
__pyx_L12:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":91
* if isnan(self.geodesic_t.ALPHA21):
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
* if radians: # <<<<<<<<<<<<<<
* lonsdata[i] = self.geodesic_t.p2.v
* latsdata[i] = self.geodesic_t.p2.u
*/
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;}
if (__pyx_2) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":92
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
* if radians:
* lonsdata[i] = self.geodesic_t.p2.v # <<<<<<<<<<<<<<
* latsdata[i] = self.geodesic_t.p2.u
* azdata[i] = self.geodesic_t.ALPHA21
*/
(__pyx_v_lonsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":93
* if radians:
* lonsdata[i] = self.geodesic_t.p2.v
* latsdata[i] = self.geodesic_t.p2.u # <<<<<<<<<<<<<<
* azdata[i] = self.geodesic_t.ALPHA21
* else:
*/
(__pyx_v_latsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":94
* lonsdata[i] = self.geodesic_t.p2.v
* latsdata[i] = self.geodesic_t.p2.u
* azdata[i] = self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
*/
(__pyx_v_azdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21;
goto __pyx_L13;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":96
* azdata[i] = self.geodesic_t.ALPHA21
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v # <<<<<<<<<<<<<<
* latsdata[i] = _rad2dg*self.geodesic_t.p2.u
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_lonsdata[__pyx_v_i]) = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":97
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
* latsdata[i] = _rad2dg*self.geodesic_t.p2.u # <<<<<<<<<<<<<<
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_latsdata[__pyx_v_i]) = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":98
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
* latsdata[i] = _rad2dg*self.geodesic_t.p2.u
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
*
* def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False):
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_azdata[__pyx_v_i]) = __pyx_7;
}
__pyx_L13:;
}
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("_geod.Geod._fwd");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_lons);
Py_DECREF(__pyx_v_lats);
Py_DECREF(__pyx_v_az);
Py_DECREF(__pyx_v_dist);
Py_DECREF(__pyx_v_radians);
return __pyx_r;
}
static PyObject *__pyx_k12p;
static PyObject *__pyx_k13p;
static char __pyx_k12[] = "Buffer lengths not the same";
static char __pyx_k13[] = "undefined inverse geodesic (may be an antipodal point)";
static PyObject *__pyx_pf_5_geod_4Geod__inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__inv[] = "\n inverse transformation - return forward and back azimuths, plus distance\n between an initial and terminus lat/lon pair.\n if radians=True, lons/lats are radians instead of degrees.\n ";
static PyObject *__pyx_pf_5_geod_4Geod__inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_lons1 = 0;
PyObject *__pyx_v_lats1 = 0;
PyObject *__pyx_v_lons2 = 0;
PyObject *__pyx_v_lats2 = 0;
PyObject *__pyx_v_radians = 0;
Py_ssize_t __pyx_v_buflenlons;
Py_ssize_t __pyx_v_buflenlats;
Py_ssize_t __pyx_v_buflenaz;
Py_ssize_t __pyx_v_buflend;
Py_ssize_t __pyx_v_ndim;
Py_ssize_t __pyx_v_i;
double *__pyx_v_lonsdata;
double *__pyx_v_latsdata;
double *__pyx_v_azdata;
double *__pyx_v_distdata;
void *__pyx_v_londata;
void *__pyx_v_latdata;
void *__pyx_v_azdat;
void *__pyx_v_distdat;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
double __pyx_7;
int __pyx_8;
static char *__pyx_argnames[] = {"lons1","lats1","lons2","lats2","radians",0};
__pyx_v_radians = __pyx_k4;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons1, &__pyx_v_lats1, &__pyx_v_lons2, &__pyx_v_lats2, &__pyx_v_radians))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_lons1);
Py_INCREF(__pyx_v_lats1);
Py_INCREF(__pyx_v_lons2);
Py_INCREF(__pyx_v_lats2);
Py_INCREF(__pyx_v_radians);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":110
* cdef void *londata, *latdata, *azdat, *distdat
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons1,(&__pyx_v_londata),(&__pyx_v_buflenlons)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":112
* if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats1,(&__pyx_v_latdata),(&__pyx_v_buflenlats)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":114
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons2,(&__pyx_v_azdat),(&__pyx_v_buflenaz)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":116
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* # process data in buffer
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats2,(&__pyx_v_distdat),(&__pyx_v_buflend)) != 0);
if (__pyx_1) {
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":119
* raise RuntimeError
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<<
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
*/
__pyx_1 = (__pyx_v_buflenlons == __pyx_v_buflenlats);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenlats == __pyx_v_buflenaz);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenaz == __pyx_v_buflend);
}
}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
Py_INCREF(__pyx_k12p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k12p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":121
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize # <<<<<<<<<<<<<<
* lonsdata = <double *>londata
* latsdata = <double *>latdata
*/
__pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
__pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely((__pyx_6 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_ndim = __pyx_6;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":122
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata # <<<<<<<<<<<<<<
* latsdata = <double *>latdata
* azdata = <double *>azdat
*/
__pyx_v_lonsdata = ((double *)__pyx_v_londata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":123
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
* latsdata = <double *>latdata # <<<<<<<<<<<<<<
* azdata = <double *>azdat
* distdata = <double *>distdat
*/
__pyx_v_latsdata = ((double *)__pyx_v_latdata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":124
* lonsdata = <double *>londata
* latsdata = <double *>latdata
* azdata = <double *>azdat # <<<<<<<<<<<<<<
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
*/
__pyx_v_azdata = ((double *)__pyx_v_azdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":125
* latsdata = <double *>latdata
* azdata = <double *>azdat
* distdata = <double *>distdat # <<<<<<<<<<<<<<
* for i from 0 <= i < ndim:
* if radians:
*/
__pyx_v_distdata = ((double *)__pyx_v_distdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":126
* azdata = <double *>azdat
* distdata = <double *>distdat
* for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
*/
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i++) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":127
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
* if radians: # <<<<<<<<<<<<<<
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":128
* for i from 0 <= i < ndim:
* if radians:
* self.geodesic_t.p1.v = lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.p2.v = azdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = (__pyx_v_lonsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":129
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = azdata[i]
* self.geodesic_t.p2.u = distdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = (__pyx_v_latsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":130
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.p2.v = azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = distdata[i]
* else:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = (__pyx_v_azdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":131
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.p2.v = azdata[i]
* self.geodesic_t.p2.u = distdata[i] # <<<<<<<<<<<<<<
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = (__pyx_v_distdata[__pyx_v_i]);
goto __pyx_L9;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":133
* self.geodesic_t.p2.u = distdata[i]
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":134
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":135
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.p2.v = _dg2rad*azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
* geod_inv(&self.geodesic_t)
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":136
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
* self.geodesic_t.p2.u = _dg2rad*distdata[i] # <<<<<<<<<<<<<<
* geod_inv(&self.geodesic_t)
* if isnan(self.geodesic_t.DIST):
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_distdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = __pyx_7;
}
__pyx_L9:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":137
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
* geod_inv(&self.geodesic_t) # <<<<<<<<<<<<<<
* if isnan(self.geodesic_t.DIST):
* raise ValueError('undefined inverse geodesic (may be an antipodal point)')
*/
geod_inv((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":138
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
* geod_inv(&self.geodesic_t)
* if isnan(self.geodesic_t.DIST): # <<<<<<<<<<<<<<
* raise ValueError('undefined inverse geodesic (may be an antipodal point)')
* if pj_errno != 0:
*/
__pyx_8 = isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST);
if (__pyx_8) {
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
Py_INCREF(__pyx_k13p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k13p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_ValueError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
goto __pyx_L10;
}
__pyx_L10:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":140
* if isnan(self.geodesic_t.DIST):
* raise ValueError('undefined inverse geodesic (may be an antipodal point)')
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* if radians:
*/
__pyx_2 = (pj_errno != 0);
if (__pyx_2) {
__pyx_5 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
__pyx_5 = 0;
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
goto __pyx_L11;
}
__pyx_L11:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":142
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* if radians: # <<<<<<<<<<<<<<
* lonsdata[i] = self.geodesic_t.ALPHA12
* latsdata[i] = self.geodesic_t.ALPHA21
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":143
* raise RuntimeError(pj_strerrno(pj_errno))
* if radians:
* lonsdata[i] = self.geodesic_t.ALPHA12 # <<<<<<<<<<<<<<
* latsdata[i] = self.geodesic_t.ALPHA21
* else:
*/
(__pyx_v_lonsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":144
* if radians:
* lonsdata[i] = self.geodesic_t.ALPHA12
* latsdata[i] = self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12
*/
(__pyx_v_latsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21;
goto __pyx_L12;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":146
* latsdata[i] = self.geodesic_t.ALPHA21
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12 # <<<<<<<<<<<<<<
* latsdata[i] = _rad2dg*self.geodesic_t.ALPHA21
* azdata[i] = self.geodesic_t.DIST
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_lonsdata[__pyx_v_i]) = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":147
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12
* latsdata[i] = _rad2dg*self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
* azdata[i] = self.geodesic_t.DIST
*
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_latsdata[__pyx_v_i]) = __pyx_7;
}
__pyx_L12:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":148
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12
* latsdata[i] = _rad2dg*self.geodesic_t.ALPHA21
* azdata[i] = self.geodesic_t.DIST # <<<<<<<<<<<<<<
*
* def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False):
*/
(__pyx_v_azdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST;
}
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("_geod.Geod._inv");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_lons1);
Py_DECREF(__pyx_v_lats1);
Py_DECREF(__pyx_v_lons2);
Py_DECREF(__pyx_v_lats2);
Py_DECREF(__pyx_v_radians);
return __pyx_r;
}
static PyObject *__pyx_pf_5_geod_4Geod__npts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__npts[] = "\n given initial and terminus lat/lon, find npts intermediate points.";
static PyObject *__pyx_pf_5_geod_4Geod__npts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
double __pyx_v_lon1;
double __pyx_v_lat1;
double __pyx_v_lon2;
double __pyx_v_lat2;
int __pyx_v_npts;
PyObject *__pyx_v_radians = 0;
int __pyx_v_i;
double __pyx_v_del_s;
PyObject *__pyx_v_lats;
PyObject *__pyx_v_lons;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
double __pyx_5;
long __pyx_6;
static char *__pyx_argnames[] = {"lon1","lat1","lon2","lat2","npts","radians",0};
__pyx_v_radians = __pyx_k5;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "ddddi|O", __pyx_argnames, &__pyx_v_lon1, &__pyx_v_lat1, &__pyx_v_lon2, &__pyx_v_lat2, &__pyx_v_npts, &__pyx_v_radians))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_radians);
__pyx_v_lats = Py_None; Py_INCREF(Py_None);
__pyx_v_lons = Py_None; Py_INCREF(Py_None);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":155
* cdef int i
* cdef double del_s
* if radians: # <<<<<<<<<<<<<<
* self.geodesic_t.p1.v = lon1
* self.geodesic_t.p1.u = lat1
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":156
* cdef double del_s
* if radians:
* self.geodesic_t.p1.v = lon1 # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = lat1
* self.geodesic_t.p2.v = lon2
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_v_lon1;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":157
* if radians:
* self.geodesic_t.p1.v = lon1
* self.geodesic_t.p1.u = lat1 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = lon2
* self.geodesic_t.p2.u = lat2
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_v_lat1;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":158
* self.geodesic_t.p1.v = lon1
* self.geodesic_t.p1.u = lat1
* self.geodesic_t.p2.v = lon2 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = lat2
* else:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = __pyx_v_lon2;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":159
* self.geodesic_t.p1.u = lat1
* self.geodesic_t.p2.v = lon2
* self.geodesic_t.p2.u = lat2 # <<<<<<<<<<<<<<
* else:
* self.geodesic_t.p1.v = _dg2rad*lon1
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = __pyx_v_lat2;
goto __pyx_L2;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":161
* self.geodesic_t.p2.u = lat2
* else:
* self.geodesic_t.p1.v = _dg2rad*lon1 # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = _dg2rad*lat1
* self.geodesic_t.p2.v = _dg2rad*lon2
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lon1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_5;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":162
* else:
* self.geodesic_t.p1.v = _dg2rad*lon1
* self.geodesic_t.p1.u = _dg2rad*lat1 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = _dg2rad*lon2
* self.geodesic_t.p2.u = _dg2rad*lat2
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lat1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_5;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":163
* self.geodesic_t.p1.v = _dg2rad*lon1
* self.geodesic_t.p1.u = _dg2rad*lat1
* self.geodesic_t.p2.v = _dg2rad*lon2 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = _dg2rad*lat2
* # do inverse computation to set azimuths, distance.
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lon2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = __pyx_5;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":164
* self.geodesic_t.p1.u = _dg2rad*lat1
* self.geodesic_t.p2.v = _dg2rad*lon2
* self.geodesic_t.p2.u = _dg2rad*lat2 # <<<<<<<<<<<<<<
* # do inverse computation to set azimuths, distance.
* geod_inv(&self.geodesic_t)
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lat2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = __pyx_5;
}
__pyx_L2:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":166
* self.geodesic_t.p2.u = _dg2rad*lat2
* # do inverse computation to set azimuths, distance.
* geod_inv(&self.geodesic_t) # <<<<<<<<<<<<<<
* # set up some constants needed for forward computation.
* geod_pre(&self.geodesic_t)
*/
geod_inv((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":168
* geod_inv(&self.geodesic_t)
* # set up some constants needed for forward computation.
* geod_pre(&self.geodesic_t) # <<<<<<<<<<<<<<
* # distance increment.
* del_s = self.geodesic_t.DIST/(npts+1)
*/
geod_pre((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":170
* geod_pre(&self.geodesic_t)
* # distance increment.
* del_s = self.geodesic_t.DIST/(npts+1) # <<<<<<<<<<<<<<
* # initialize output tuples.
* lats = ()
*/
__pyx_v_del_s = (((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST / (__pyx_v_npts + 1));
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":172
* del_s = self.geodesic_t.DIST/(npts+1)
* # initialize output tuples.
* lats = () # <<<<<<<<<<<<<<
* lons = ()
* # loop over intermediate points, compute lat/lons.
*/
__pyx_2 = PyTuple_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
Py_DECREF(__pyx_v_lats);
__pyx_v_lats = __pyx_2;
__pyx_2 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":173
* # initialize output tuples.
* lats = ()
* lons = () # <<<<<<<<<<<<<<
* # loop over intermediate points, compute lat/lons.
* for i from 1 <= i < npts+1:
*/
__pyx_3 = PyTuple_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;}
Py_DECREF(__pyx_v_lons);
__pyx_v_lons = __pyx_3;
__pyx_3 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":175
* lons = ()
* # loop over intermediate points, compute lat/lons.
* for i from 1 <= i < npts+1: # <<<<<<<<<<<<<<
* self.geodesic_t.DIST = i*del_s
* geod_for(&self.geodesic_t)
*/
__pyx_6 = (__pyx_v_npts + 1);
for (__pyx_v_i = 1; __pyx_v_i < __pyx_6; __pyx_v_i++) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":176
* # loop over intermediate points, compute lat/lons.
* for i from 1 <= i < npts+1:
* self.geodesic_t.DIST = i*del_s # <<<<<<<<<<<<<<
* geod_for(&self.geodesic_t)
* if radians:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_i * __pyx_v_del_s);
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":177
* for i from 1 <= i < npts+1:
* self.geodesic_t.DIST = i*del_s
* geod_for(&self.geodesic_t) # <<<<<<<<<<<<<<
* if radians:
* lats = lats + (self.geodesic_t.p2.u,)
*/
geod_for((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":178
* self.geodesic_t.DIST = i*del_s
* geod_for(&self.geodesic_t)
* if radians: # <<<<<<<<<<<<<<
* lats = lats + (self.geodesic_t.p2.u,)
* lons = lons + (self.geodesic_t.p2.v,)
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":179
* geod_for(&self.geodesic_t)
* if radians:
* lats = lats + (self.geodesic_t.p2.u,) # <<<<<<<<<<<<<<
* lons = lons + (self.geodesic_t.p2.v,)
* else:
*/
__pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
__pyx_3 = PyNumber_Add(__pyx_v_lats, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_lats);
__pyx_v_lats = __pyx_3;
__pyx_3 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":180
* if radians:
* lats = lats + (self.geodesic_t.p2.u,)
* lons = lons + (self.geodesic_t.p2.v,) # <<<<<<<<<<<<<<
* else:
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,)
*/
__pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
__pyx_3 = PyNumber_Add(__pyx_v_lons, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_lons);
__pyx_v_lons = __pyx_3;
__pyx_3 = 0;
goto __pyx_L5;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":182
* lons = lons + (self.geodesic_t.p2.v,)
* else:
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,) # <<<<<<<<<<<<<<
* lons = lons + (_rad2dg*self.geodesic_t.p2.v,)
* return lons, lats
*/
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
__pyx_3 = PyNumber_Multiply(__pyx_4, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_2 = PyNumber_Add(__pyx_v_lats, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_lats);
__pyx_v_lats = __pyx_2;
__pyx_2 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":183
* else:
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,)
* lons = lons + (_rad2dg*self.geodesic_t.p2.v,) # <<<<<<<<<<<<<<
* return lons, lats
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
__pyx_2 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
__pyx_4 = PyNumber_Add(__pyx_v_lons, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_lons);
__pyx_v_lons = __pyx_4;
__pyx_4 = 0;
}
__pyx_L5:;
}
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":184
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,)
* lons = lons + (_rad2dg*self.geodesic_t.p2.v,)
* return lons, lats # <<<<<<<<<<<<<<
*/
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;}
Py_INCREF(__pyx_v_lons);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_lons);
Py_INCREF(__pyx_v_lats);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lats);
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_geod.Geod._npts");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_lats);
Py_DECREF(__pyx_v_lons);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_radians);
return __pyx_r;
}
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_RuntimeError, "RuntimeError"},
{&__pyx_n_ValueError, "ValueError"},
{&__pyx_n___cinit__, "__cinit__"},
{&__pyx_n___class__, "__class__"},
{&__pyx_n___reduce__, "__reduce__"},
{&__pyx_n___version__, "__version__"},
{&__pyx_n__dg2rad, "_dg2rad"},
{&__pyx_n__doublesize, "_doublesize"},
{&__pyx_n__fwd, "_fwd"},
{&__pyx_n__inv, "_inv"},
{&__pyx_n__npts, "_npts"},
{&__pyx_n__rad2dg, "_rad2dg"},
{&__pyx_n_append, "append"},
{&__pyx_n_degrees, "degrees"},
{&__pyx_n_iteritems, "iteritems"},
{&__pyx_n_join, "join"},
{&__pyx_n_math, "math"},
{&__pyx_n_radians, "radians"},
{0, 0}
};
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2), 0},
{&__pyx_k6p, __pyx_k6, sizeof(__pyx_k6), 0},
{&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7), 0},
{&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8), 0},
{&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9), 0},
{&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10), 0},
{&__pyx_k11p, __pyx_k11, sizeof(__pyx_k11), 0},
{&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12), 0},
{&__pyx_k13p, __pyx_k13, sizeof(__pyx_k13), 0},
{0, 0, 0, 0}
};
static PyObject *__pyx_tp_new_5_geod_Geod(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_5_geod_Geod *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_5_geod_Geod *)o);
p->geodparams = Py_None; Py_INCREF(Py_None);
p->proj_version = Py_None; Py_INCREF(Py_None);
if (__pyx_pf_5_geod_4Geod___new__(o, a, k) < 0) {
Py_DECREF(o); o = 0;
}
return o;
}
static void __pyx_tp_dealloc_5_geod_Geod(PyObject *o) {
struct __pyx_obj_5_geod_Geod *p = (struct __pyx_obj_5_geod_Geod *)o;
Py_XDECREF(p->geodparams);
Py_XDECREF(p->proj_version);
(*o->ob_type->tp_free)(o);
}
static int __pyx_tp_traverse_5_geod_Geod(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5_geod_Geod *p = (struct __pyx_obj_5_geod_Geod *)o;
if (p->geodparams) {
e = (*v)(p->geodparams, a); if (e) return e;
}
if (p->proj_version) {
e = (*v)(p->proj_version, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5_geod_Geod(PyObject *o) {
struct __pyx_obj_5_geod_Geod *p = (struct __pyx_obj_5_geod_Geod *)o;
Py_XDECREF(p->geodparams);
p->geodparams = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->proj_version);
p->proj_version = Py_None; Py_INCREF(Py_None);
return 0;
}
static struct PyMethodDef __pyx_methods_5_geod_Geod[] = {
{"__reduce__", (PyCFunction)__pyx_pf_5_geod_4Geod___reduce__, METH_NOARGS, __pyx_doc_5_geod_4Geod___reduce__},
{"_fwd", (PyCFunction)__pyx_pf_5_geod_4Geod__fwd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5_geod_4Geod__fwd},
{"_inv", (PyCFunction)__pyx_pf_5_geod_4Geod__inv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5_geod_4Geod__inv},
{"_npts", (PyCFunction)__pyx_pf_5_geod_4Geod__npts, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5_geod_4Geod__npts},
{0, 0, 0, 0}
};
static struct PyMemberDef __pyx_members_5_geod_Geod[] = {
{"geodparams", T_OBJECT, offsetof(struct __pyx_obj_5_geod_Geod, geodparams), 0, 0},
{"proj_version", T_OBJECT, offsetof(struct __pyx_obj_5_geod_Geod, proj_version), 0, 0},
{0, 0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_Geod = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};
static PySequenceMethods __pyx_tp_as_sequence_Geod = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_Geod = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyBufferProcs __pyx_tp_as_buffer_Geod = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};
PyTypeObject __pyx_type_5_geod_Geod = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"_geod.Geod", /*tp_name*/
sizeof(struct __pyx_obj_5_geod_Geod), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5_geod_Geod, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_Geod, /*tp_as_number*/
&__pyx_tp_as_sequence_Geod, /*tp_as_sequence*/
&__pyx_tp_as_mapping_Geod, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_Geod, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5_geod_Geod, /*tp_traverse*/
__pyx_tp_clear_5_geod_Geod, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5_geod_Geod, /*tp_methods*/
__pyx_members_5_geod_Geod, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5_geod_Geod, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct PyMethodDef __pyx_methods[] = {
{0, 0, 0, 0}
};
static void __pyx_init_filenames(void); /*proto*/
PyMODINIT_FUNC init_geod(void); /*proto*/
PyMODINIT_FUNC init_geod(void) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
/*--- Libary function declarations ---*/
__pyx_init_filenames();
/*--- Module creation code ---*/
__pyx_m = Py_InitModule4("_geod", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_b = PyImport_AddModule("__builtin__");
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- Intern code ---*/
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- String init code ---*/
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- Builtin init code ---*/
__pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; goto __pyx_L1;}
__pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
/*--- Global init code ---*/
/*--- Function export code ---*/
/*--- Function import code ---*/
/*--- Type init code ---*/
__pyx_type_5_geod_Geod.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5_geod_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "Geod", (PyObject *)&__pyx_type_5_geod_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
__pyx_ptype_5_geod_Geod = &__pyx_type_5_geod_Geod;
/*--- Type import code ---*/
/*--- Execution code ---*/
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_pyproj.pxi":17
* PERFORMANCE OF THIS SOFTWARE.
* """
* import math # <<<<<<<<<<<<<<
*
* _dg2rad = math.radians(1.)
*/
__pyx_1 = __Pyx_Import(__pyx_n_math, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_math, __pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_pyproj.pxi":19
* import math
*
* _dg2rad = math.radians(1.) # <<<<<<<<<<<<<<
* _rad2dg = math.degrees(1.)
* _doublesize = sizeof(double)
*/
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_math); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_radians); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n__dg2rad, __pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_pyproj.pxi":20
*
* _dg2rad = math.radians(1.)
* _rad2dg = math.degrees(1.) # <<<<<<<<<<<<<<
* _doublesize = sizeof(double)
* __version__ = "1.8.3"
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_math); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_degrees); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n__rad2dg, __pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_pyproj.pxi":21
* _dg2rad = math.radians(1.)
* _rad2dg = math.degrees(1.)
* _doublesize = sizeof(double) # <<<<<<<<<<<<<<
* __version__ = "1.8.3"
*
*/
__pyx_3 = PyInt_FromLong((sizeof(double))); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n__doublesize, __pyx_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_pyproj.pxi":22
* _rad2dg = math.degrees(1.)
* _doublesize = sizeof(double)
* __version__ = "1.8.3" # <<<<<<<<<<<<<<
*
* cdef extern from "stdlib.h":
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k2p) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; goto __pyx_L1;}
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":45
* return (self.__class__,(self.geodparams,))
*
* def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<<
* """
* forward transformation - determine longitude, latitude and back azimuth
*/
Py_INCREF(Py_False);
__pyx_k3 = Py_False;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":100
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*
* def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False): # <<<<<<<<<<<<<<
* """
* inverse transformation - return forward and back azimuths, plus distance
*/
Py_INCREF(Py_False);
__pyx_k4 = Py_False;
/* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":150
* azdata[i] = self.geodesic_t.DIST
*
* def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False): # <<<<<<<<<<<<<<
* """
* given initial and terminus lat/lon, find npts intermediate points."""
*/
Py_INCREF(Py_False);
__pyx_k5 = Py_False;
if (__Pyx_RegisterCleanup()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
return;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("_geod");
}
static PyObject* cleanup(PyObject *self, PyObject *unused) {
/*--- Builtin cleanup code ---*/
Py_DECREF(__pyx_builtin_RuntimeError); __pyx_builtin_RuntimeError = 0;
Py_DECREF(__pyx_builtin_ValueError); __pyx_builtin_ValueError = 0;
/*--- Intern cleanup code ---*/
Py_DECREF(__pyx_n__doublesize); __pyx_n__doublesize = 0;
Py_DECREF(__pyx_n___version__); __pyx_n___version__ = 0;
Py_DECREF(__pyx_n__inv); __pyx_n__inv = 0;
Py_DECREF(__pyx_n_join); __pyx_n_join = 0;
Py_DECREF(__pyx_n_RuntimeError); __pyx_n_RuntimeError = 0;
Py_DECREF(__pyx_n___reduce__); __pyx_n___reduce__ = 0;
Py_DECREF(__pyx_n_radians); __pyx_n_radians = 0;
Py_DECREF(__pyx_n___class__); __pyx_n___class__ = 0;
Py_DECREF(__pyx_n__dg2rad); __pyx_n__dg2rad = 0;
Py_DECREF(__pyx_n__fwd); __pyx_n__fwd = 0;
Py_DECREF(__pyx_n___cinit__); __pyx_n___cinit__ = 0;
Py_DECREF(__pyx_n_append); __pyx_n_append = 0;
Py_DECREF(__pyx_n__rad2dg); __pyx_n__rad2dg = 0;
Py_DECREF(__pyx_n_iteritems); __pyx_n_iteritems = 0;
Py_DECREF(__pyx_n_degrees); __pyx_n_degrees = 0;
Py_DECREF(__pyx_n__npts); __pyx_n__npts = 0;
Py_DECREF(__pyx_n_ValueError); __pyx_n_ValueError = 0;
Py_DECREF(__pyx_n_math); __pyx_n_math = 0;
Py_INCREF(Py_None); return Py_None;
}
static char *__pyx_filenames[] = {
"_geod.pyx",
"_pyproj.pxi",
};
/* Runtime support code */
static void __pyx_init_filenames(void) {
__pyx_f = __pyx_filenames;
}
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
PyObject *__import__ = 0;
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
__import__ = PyObject_GetAttrString(__pyx_b, "__import__");
if (!__import__)
goto bad;
if (from_list)
list = from_list;
else {
empty_list = PyList_New(0);
if (!empty_list)
goto bad;
list = empty_list;
}
global_dict = PyModule_GetDict(__pyx_m);
if (!global_dict)
goto bad;
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
module = PyObject_CallFunction(__import__, "OOOO",
name, global_dict, empty_dict, list);
bad:
Py_XDECREF(empty_list);
Py_XDECREF(__import__);
Py_XDECREF(empty_dict);
return module;
}
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
PyObject *result;
result = PyObject_GetAttr(dict, name);
if (!result)
PyErr_SetObject(PyExc_NameError, name);
return result;
}
static void __Pyx_UnpackError(void) {
PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
}
static PyObject *__Pyx_UnpackItem(PyObject *iter) {
PyObject *item;
if (!(item = PyIter_Next(iter))) {
if (!PyErr_Occurred())
__Pyx_UnpackError();
}
return item;
}
static int __Pyx_EndUnpack(PyObject *iter) {
PyObject *item;
if ((item = PyIter_Next(iter))) {
Py_DECREF(item);
__Pyx_UnpackError();
return -1;
}
else if (!PyErr_Occurred())
return 0;
else
return -1;
}
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
Py_XINCREF(type);
Py_XINCREF(value);
Py_XINCREF(tb);
/* First, check the traceback argument, replacing None with NULL. */
if (tb == Py_None) {
Py_DECREF(tb);
tb = 0;
}
else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto raise_error;
}
/* Next, replace a missing value with None */
if (value == NULL) {
value = Py_None;
Py_INCREF(value);
}
#if PY_VERSION_HEX < 0x02050000
if (!PyClass_Check(type))
#else
if (!PyType_Check(type))
#endif
{
/* Raising an instance. The value should be a dummy. */
if (value != Py_None) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto raise_error;
}
/* Normalize to raise <class>, <instance> */
Py_DECREF(value);
value = type;
#if PY_VERSION_HEX < 0x02050000
if (PyInstance_Check(type)) {
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
Py_INCREF(type);
}
else {
PyErr_SetString(PyExc_TypeError,
"raise: exception must be an old-style class or instance");
goto raise_error;
}
#else
type = (PyObject*) type->ob_type;
Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto raise_error;
}
#endif
}
PyErr_Restore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
Py_XDECREF(tb);
return;
}
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
while (t->p) {
*t->p = PyString_InternFromString(t->s);
if (!*t->p)
return -1;
++t;
}
return 0;
}
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
if (!*t->p)
return -1;
++t;
}
return 0;
}
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static void __Pyx_AddTraceback(char *funcname) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
PyObject *empty_tuple = 0;
PyObject *empty_string = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
py_srcfile = PyString_FromString(__pyx_filename);
if (!py_srcfile) goto bad;
py_funcname = PyString_FromString(funcname);
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(__pyx_m);
if (!py_globals) goto bad;
empty_tuple = PyTuple_New(0);
if (!empty_tuple) goto bad;
empty_string = PyString_FromString("");
if (!empty_string) goto bad;
py_code = PyCode_New(
0, /*int argcount,*/
0, /*int nlocals,*/
0, /*int stacksize,*/
0, /*int flags,*/
empty_string, /*PyObject *code,*/
empty_tuple, /*PyObject *consts,*/
empty_tuple, /*PyObject *names,*/
empty_tuple, /*PyObject *varnames,*/
empty_tuple, /*PyObject *freevars,*/
empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
__pyx_lineno, /*int firstlineno,*/
empty_string /*PyObject *lnotab*/
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
PyThreadState_Get(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
py_frame->f_lineno = __pyx_lineno;
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
Py_XDECREF(empty_tuple);
Py_XDECREF(empty_string);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(char *name) {
PyObject *py_name = 0;
PyObject *py_module = 0;
py_name = PyString_FromString(name);
if (!py_name)
goto bad;
py_module = PyImport_Import(py_name);
Py_DECREF(py_name);
return py_module;
bad:
Py_XDECREF(py_name);
return 0;
}
#endif
static int __Pyx_RegisterCleanup() {
/* Don't use Py_AtExit because that has a 32-call limit
* and is called after python finalization.
*/
PyObject *cleanup_func = 0;
PyObject *atexit = 0;
PyObject *reg = 0;
PyObject *args = 0;
PyObject *res = 0;
int ret = -1;
cleanup_func = PyCFunction_New(&cleanup_def, 0);
args = PyTuple_New(1);
if (!cleanup_func || !args)
goto bad;
PyTuple_SET_ITEM(args, 0, cleanup_func);
cleanup_func = 0;
atexit = __Pyx_ImportModule("atexit");
if (!atexit)
goto bad;
reg = PyObject_GetAttrString(atexit, "register");
if (!reg)
goto bad;
res = PyObject_CallObject(reg, args);
if (!res)
goto bad;
ret = 0;
bad:
Py_XDECREF(cleanup_func);
Py_XDECREF(atexit);
Py_XDECREF(reg);
Py_XDECREF(args);
Py_XDECREF(res);
return ret;
}