From: <ef...@us...> - 2007-10-31 05:56:09
|
Revision: 4070 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4070&view=rev Author: efiring Date: 2007-10-30 22:56:06 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Add numpy Nx2 array support to the pyrex proj wrapper Modified Paths: -------------- trunk/toolkits/basemap/setup.py trunk/toolkits/basemap/src/_proj.c trunk/toolkits/basemap/src/_proj.pyx Added Paths: ----------- trunk/toolkits/basemap/src/c_numpy.pxd Modified: trunk/toolkits/basemap/setup.py =================================================================== --- trunk/toolkits/basemap/setup.py 2007-10-30 20:53:46 UTC (rev 4069) +++ trunk/toolkits/basemap/setup.py 2007-10-31 05:56:06 UTC (rev 4070) @@ -13,6 +13,9 @@ from distutils.core import Extension from distutils.util import convert_path +import numpy + + def dbf_macros(): """Return the macros to define when compiling the dbflib wrapper. @@ -36,7 +39,9 @@ packages = ['matplotlib.toolkits.basemap'] package_dirs = {'':'lib'} -extensions = [Extension("matplotlib.toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)] +extensions = [Extension("matplotlib.toolkits.basemap._proj", + deps+['src/_proj.c'], + include_dirs = ['src', numpy.get_include()],)] extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) # install shapelib and dbflib. @@ -61,21 +66,21 @@ if 'setuptools' in sys.modules: # Are we running with setuptools? # if so, need to specify all the packages in heirarchy - additional_params = {'namespace_packages' : ['matplotlib.toolkits']} + additional_params = {'namespace_packages' : ['matplotlib.toolkits']} packages.extend(['matplotlib', 'matplotlib.toolkits']) setup = setuptools.setup else: additional_params = {} from distutils.core import setup - - + + # Specify all the required mpl data pyproj_datafiles = ['data/epsg', 'data/esri', 'data/esri.extra', 'data/GL27', 'data/nad.lst', 'data/nad27', 'data/nad83', 'data/ntv2_out.dist', 'data/other.extra', 'data/pj_out27.dist', 'data/pj_out83.dist', 'data/proj_def.dat', 'data/README', 'data/td_out.dist', 'data/test27', 'data/test83', 'data/testntv2', 'data/testvarious', 'data/world'] basemap_datafiles = [ 'data/countries_c.txt', 'data/states_c.txt', 'data/rivers_c.txt', 'data/gshhs_c.txt', - 'data/countries_l.txt', + 'data/countries_l.txt', 'data/states_l.txt', 'data/rivers_l.txt', 'data/gshhs_l.txt', @@ -103,8 +108,8 @@ license = "OSI Approved", keywords = ["python","plotting","plots","graphs","charts","GIS","mapping","map projections","maps"], classifiers = ["Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "License :: OSI Approved", + "Intended Audience :: Science/Research", + "License :: OSI Approved", "Topic :: Scientific/Engineering :: Visualization", "Topic :: Software Development :: Libraries :: Python Modules", "Operating System :: OS Independent"], Modified: trunk/toolkits/basemap/src/_proj.c =================================================================== --- trunk/toolkits/basemap/src/_proj.c 2007-10-30 20:53:46 UTC (rev 4069) +++ trunk/toolkits/basemap/src/_proj.c 2007-10-31 05:56:06 UTC (rev 4070) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.7 on Sun Oct 14 08:16:26 2007 */ +/* Generated by Cython 0.9.6.7 on Sun Oct 28 13:19:08 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -25,6 +25,7 @@ #include "math.h" #include "geodesic.h" #include "proj_api.h" +#include "numpy/arrayobject.h" #ifdef __GNUC__ @@ -84,8 +85,17 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ + static void __Pyx_AddTraceback(char *funcname); /*proto*/ +/* Declarations from c_numpy */ + +static PyTypeObject *__pyx_ptype_7c_numpy_dtype = 0; +static PyTypeObject *__pyx_ptype_7c_numpy_ndarray = 0; +static PyTypeObject *__pyx_ptype_7c_numpy_flatiter = 0; +static PyTypeObject *__pyx_ptype_7c_numpy_broadcast = 0; + /* Declarations from _proj */ @@ -99,16 +109,22 @@ }; static PyTypeObject *__pyx_ptype_5_proj_Proj = 0; -static PyObject *__pyx_k3; static PyObject *__pyx_k4; static PyObject *__pyx_k5; static PyObject *__pyx_k6; +static PyObject *__pyx_k7; +static PyObject *__pyx_k8; +static PyObject *__pyx_k9; +static PyObject *__pyx_k10; +static PyObject *__pyx_k11; /* Implementation of _proj */ -static char (__pyx_k2[]) = "1.8.3"; +static char (__pyx_k3[]) = "1.8.3"; +static PyObject *__pyx_n_c_numpy; +static PyObject *__pyx_n_numpy; static PyObject *__pyx_n_math; static PyObject *__pyx_n__dg2rad; static PyObject *__pyx_n__rad2dg; @@ -119,6 +135,8 @@ static PyObject *__pyx_n___dealloc__; static PyObject *__pyx_n___reduce__; static PyObject *__pyx_n__fwd; +static PyObject *__pyx_n__fwdn; +static PyObject *__pyx_n__invn; static PyObject *__pyx_n__inv; static PyObject *__pyx_n_is_latlong; static PyObject *__pyx_n_is_geocent; @@ -126,7 +144,7 @@ static PyObject *__pyx_n_radians; static PyObject *__pyx_n_degrees; -static PyObject *__pyx_k2p; +static PyObject *__pyx_k3p; static PyObject *__pyx_f_py_5_proj_set_datapath(PyObject *__pyx_self, PyObject *__pyx_v_datapath); /*proto*/ static PyObject *__pyx_f_py_5_proj_set_datapath(PyObject *__pyx_self, PyObject *__pyx_v_datapath) { @@ -134,20 +152,20 @@ PyObject *__pyx_r; Py_INCREF(__pyx_v_datapath); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":7 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":11 * def set_datapath(datapath): * cdef char *searchpath * searchpath = PyString_AsString(datapath) # <<<<<<<<<<<<<< * pj_set_searchpath(1, &searchpath) - * + * */ __pyx_v_searchpath = PyString_AsString(__pyx_v_datapath); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":8 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":12 * cdef char *searchpath * searchpath = PyString_AsString(datapath) * pj_set_searchpath(1, &searchpath) # <<<<<<<<<<<<<< - * + * * cdef class Proj: */ pj_set_searchpath(1,(&__pyx_v_searchpath)); @@ -162,17 +180,17 @@ static PyObject *__pyx_n_join; static PyObject *__pyx_n_RuntimeError; -static PyObject *__pyx_k7p; -static PyObject *__pyx_k8p; -static PyObject *__pyx_k9p; -static PyObject *__pyx_k10p; +static PyObject *__pyx_k12p; +static PyObject *__pyx_k13p; +static PyObject *__pyx_k14p; +static PyObject *__pyx_k15p; static PyObject *__pyx_builtin_RuntimeError; -static char (__pyx_k7[]) = "+"; -static char (__pyx_k8[]) = "="; -static char (__pyx_k9[]) = " "; -static char (__pyx_k10[]) = ""; +static char (__pyx_k12[]) = "+"; +static char (__pyx_k13[]) = "="; +static char (__pyx_k14[]) = " "; +static char (__pyx_k15[]) = ""; static int __pyx_f_py_5_proj_4Proj___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_f_py_5_proj_4Proj___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { @@ -196,7 +214,7 @@ __pyx_v_key = Py_None; Py_INCREF(Py_None); __pyx_v_value = Py_None; Py_INCREF(Py_None); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":18 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":22 * * def __new__(self, projparams): * self.projparams = projparams # <<<<<<<<<<<<<< @@ -207,30 +225,30 @@ Py_DECREF(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projparams); ((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projparams = __pyx_v_projparams; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":20 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":24 * self.projparams = projparams * # setup proj initialization string. * pjargs = [] # <<<<<<<<<<<<<< * for key,value in projparams.iteritems(): * pjargs.append('+'+key+"="+str(value)+' ') */ - __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} + __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;} Py_DECREF(__pyx_v_pjargs); __pyx_v_pjargs = __pyx_1; __pyx_1 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":21 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":25 * # setup proj initialization string. * pjargs = [] * for key,value in projparams.iteritems(): # <<<<<<<<<<<<<< * pjargs.append('+'+key+"="+str(value)+' ') * self.srs = ''.join(pjargs) */ - __pyx_1 = PyObject_GetAttr(__pyx_v_projparams, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_projparams, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; 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 = 21; goto __pyx_L1;} } + else { __pyx_1 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; 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); } @@ -254,70 +272,70 @@ 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 = 21; goto __pyx_L1;} + __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; 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 = 21; goto __pyx_L1;} + __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; 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 = 21; goto __pyx_L1;} + __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; 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 = 21; goto __pyx_L1;} + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; } - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":22 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":26 * pjargs = [] * for key,value in projparams.iteritems(): * pjargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<< * self.srs = ''.join(pjargs) * self.pjinitstring = PyString_AsString(self.srs) */ - __pyx_5 = PyObject_GetAttr(__pyx_v_pjargs, __pyx_n_append); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} - __pyx_3 = PyNumber_Add(__pyx_k7p, __pyx_v_key); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} - __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k8p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_v_pjargs, __pyx_n_append); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_k12p, __pyx_v_key); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k13p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; 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 = 22; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; 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 = 22; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; 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 = 22; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(__pyx_4, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k9p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k14p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; 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 = 22; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; 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 = 22; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; 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/src/_proj.pyx":23 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":27 * for key,value in projparams.iteritems(): * pjargs.append('+'+key+"="+str(value)+' ') * self.srs = ''.join(pjargs) # <<<<<<<<<<<<<< * self.pjinitstring = PyString_AsString(self.srs) * # initialize projection */ - __pyx_4 = PyObject_GetAttr(__pyx_k10p, __pyx_n_join); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_k15p, __pyx_n_join); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;} Py_INCREF(__pyx_v_pjargs); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_pjargs); - __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->srs); ((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->srs = __pyx_6; __pyx_6 = 0; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":24 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":28 * pjargs.append('+'+key+"="+str(value)+' ') * self.srs = ''.join(pjargs) * self.pjinitstring = PyString_AsString(self.srs) # <<<<<<<<<<<<<< @@ -326,7 +344,7 @@ */ ((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->pjinitstring = PyString_AsString(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->srs); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":26 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":30 * self.pjinitstring = PyString_AsString(self.srs) * # initialize projection * self.projpj = pj_init_plus(self.pjinitstring) # <<<<<<<<<<<<<< @@ -335,7 +353,7 @@ */ ((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projpj = pj_init_plus(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->pjinitstring); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":27 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":31 * # initialize projection * self.projpj = pj_init_plus(self.pjinitstring) * if pj_errno != 0: # <<<<<<<<<<<<<< @@ -345,34 +363,34 @@ __pyx_7 = (pj_errno != 0); if (__pyx_7) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":28 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":32 * self.projpj = pj_init_plus(self.pjinitstring) * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< * self.proj_version = PJ_VERSION/100. * */ - __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;} - __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;} + __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; 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 = 28; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; 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 = 28; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":29 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":33 * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) * self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_5 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;} Py_DECREF(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->proj_version); ((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->proj_version = __pyx_5; __pyx_5 = 0; @@ -401,7 +419,7 @@ static void __pyx_f_py_5_proj_4Proj___dealloc__(PyObject *__pyx_v_self) { Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":33 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":37 * def __dealloc__(self): * """destroy projection definition""" * pj_free(self.projpj) # <<<<<<<<<<<<<< @@ -424,18 +442,18 @@ PyObject *__pyx_3 = 0; Py_INCREF(__pyx_v_self); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":37 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":41 * def __reduce__(self): * """special method that allows pyproj.Proj instance to be pickled""" * return (self.__class__,(self.projparams,)) # <<<<<<<<<<<<<< * * def _fwd(self, object lons, object lats, radians=False, errcheck=False): */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;} Py_INCREF(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projparams); PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projparams); - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); __pyx_1 = 0; @@ -457,12 +475,12 @@ return __pyx_r; } -static PyObject *__pyx_k11p; +static PyObject *__pyx_k16p; -static char (__pyx_k11[]) = "Buffer lengths not the same"; +static char (__pyx_k16[]) = "Buffer lengths not the same"; static PyObject *__pyx_f_py_5_proj_4Proj__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_5_proj_4Proj__fwd[] = "\n forward transformation - lons,lats to x,y (done in place).\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the forward transformation is invalid.\n if errcheck=False and the forward transformation is invalid, no exception is\n raised and 1.e30 is returned.\n "; +static char __pyx_doc_5_proj_4Proj__fwd[] = "\n forward transformation - lons,lats to x,y (done in place).\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the forward transformation is invalid.\n if errcheck=False and the forward transformation is invalid, no exception is\n raised and 1.e30 is returned.\n "; static PyObject *__pyx_f_py_5_proj_4Proj__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_lons = 0; PyObject *__pyx_v_lats = 0; @@ -486,8 +504,8 @@ Py_ssize_t __pyx_5; double __pyx_6; static char *__pyx_argnames[] = {"lons","lats","radians","errcheck",0}; - __pyx_v_radians = __pyx_k3; - __pyx_v_errcheck = __pyx_k4; + __pyx_v_radians = __pyx_k4; + __pyx_v_errcheck = __pyx_k5; if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|OO", __pyx_argnames, &__pyx_v_lons, &__pyx_v_lats, &__pyx_v_radians, &__pyx_v_errcheck))) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_lons); @@ -495,7 +513,7 @@ Py_INCREF(__pyx_v_radians); Py_INCREF(__pyx_v_errcheck); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":53 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":57 * cdef void *londata, *latdata * # if buffer api is supported, get pointer to data buffers. * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0: # <<<<<<<<<<<<<< @@ -505,7 +523,7 @@ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons,(&__pyx_v_londata),(&__pyx_v_buflenx)) != 0); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":54 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":58 * # if buffer api is supported, get pointer to data buffers. * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0: * raise RuntimeError # <<<<<<<<<<<<<< @@ -513,12 +531,12 @@ * raise RuntimeError */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":55 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":59 * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0: * raise RuntimeError * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0: # <<<<<<<<<<<<<< @@ -528,7 +546,7 @@ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats,(&__pyx_v_latdata),(&__pyx_v_bufleny)) != 0); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":56 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":60 * raise RuntimeError * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0: * raise RuntimeError # <<<<<<<<<<<<<< @@ -536,12 +554,12 @@ * if buflenx != bufleny: */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":58 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":62 * raise RuntimeError * # process data in buffer * if buflenx != bufleny: # <<<<<<<<<<<<<< @@ -551,42 +569,42 @@ __pyx_1 = (__pyx_v_buflenx != __pyx_v_bufleny); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":59 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":63 * # process data in buffer * if buflenx != bufleny: * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< * ndim = buflenx/_doublesize * lonsdata = <double *>londata */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} - Py_INCREF(__pyx_k11p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k11p); - __pyx_3 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} + Py_INCREF(__pyx_k16p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k16p); + __pyx_3 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":60 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":64 * if buflenx != bufleny: * raise RuntimeError("Buffer lengths not the same") * ndim = buflenx/_doublesize # <<<<<<<<<<<<<< * lonsdata = <double *>londata * latsdata = <double *>latdata */ - __pyx_2 = PyInt_FromSsize_t(__pyx_v_buflenx); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} - __pyx_4 = PyNumber_Divide(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} + __pyx_2 = PyInt_FromSsize_t(__pyx_v_buflenx); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + __pyx_4 = PyNumber_Divide(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = __pyx_PyIndex_AsSsize_t(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} + __pyx_5 = __pyx_PyIndex_AsSsize_t(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_ndim = __pyx_5; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":61 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":65 * raise RuntimeError("Buffer lengths not the same") * ndim = buflenx/_doublesize * lonsdata = <double *>londata # <<<<<<<<<<<<<< @@ -595,7 +613,7 @@ */ __pyx_v_lonsdata = ((double (*))__pyx_v_londata); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":62 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":66 * ndim = buflenx/_doublesize * lonsdata = <double *>londata * latsdata = <double *>latdata # <<<<<<<<<<<<<< @@ -604,7 +622,7 @@ */ __pyx_v_latsdata = ((double (*))__pyx_v_latdata); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":63 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":67 * lonsdata = <double *>londata * latsdata = <double *>latdata * for i from 0 <= i < ndim: # <<<<<<<<<<<<<< @@ -613,17 +631,17 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i++) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":64 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":68 * latsdata = <double *>latdata * for i from 0 <= i < ndim: * if radians: # <<<<<<<<<<<<<< * projlonlatin.u = lonsdata[i] * projlonlatin.v = latsdata[i] */ - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;} if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":65 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":69 * for i from 0 <= i < ndim: * if radians: * projlonlatin.u = lonsdata[i] # <<<<<<<<<<<<<< @@ -632,7 +650,7 @@ */ __pyx_v_projlonlatin.u = (__pyx_v_lonsdata[__pyx_v_i]); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":66 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":70 * if radians: * projlonlatin.u = lonsdata[i] * projlonlatin.v = latsdata[i] # <<<<<<<<<<<<<< @@ -644,41 +662,41 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":68 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":72 * projlonlatin.v = latsdata[i] * else: * projlonlatin.u = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<< * projlonlatin.v = _dg2rad*latsdata[i] * projxyout = pj_fwd(projlonlatin,self.projpj) */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;} - __pyx_3 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;} - __pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_6 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;} + __pyx_6 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_projlonlatin.u = __pyx_6; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":69 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":73 * else: * projlonlatin.u = _dg2rad*lonsdata[i] * projlonlatin.v = _dg2rad*latsdata[i] # <<<<<<<<<<<<<< * projxyout = pj_fwd(projlonlatin,self.projpj) * if errcheck and pj_errno != 0: */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} - __pyx_3 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} - __pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_6 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + __pyx_6 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_projlonlatin.v = __pyx_6; } __pyx_L7:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":70 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":74 * projlonlatin.u = _dg2rad*lonsdata[i] * projlonlatin.v = _dg2rad*latsdata[i] * projxyout = pj_fwd(projlonlatin,self.projpj) # <<<<<<<<<<<<<< @@ -687,7 +705,7 @@ */ __pyx_v_projxyout = pj_fwd(__pyx_v_projlonlatin,((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projpj); - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":71 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":75 * projlonlatin.v = _dg2rad*latsdata[i] * projxyout = pj_fwd(projlonlatin,self.projpj) * if errcheck and pj_errno != 0: # <<<<<<<<<<<<<< @@ -696,36 +714,36 @@ */ __pyx_2 = __pyx_v_errcheck; Py_INCREF(__pyx_2); - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} if (__pyx_1) { Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_PyBool_FromLong((pj_errno != 0)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + __pyx_2 = __Pyx_PyBool_FromLong((pj_errno != 0)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} } - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":72 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":76 * projxyout = pj_fwd(projlonlatin,self.projpj) * if errcheck and pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< * # since HUGE_VAL can be 'inf', * # change it to a real (but very large) number. */ - __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); __pyx_3 = 0; - __pyx_2 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":75 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":79 * # since HUGE_VAL can be 'inf', * # change it to a real (but very large) number. * if projxyout.u == HUGE_VAL: # <<<<<<<<<<<<<< @@ -735,7 +753,7 @@ __pyx_1 = (__pyx_v_projxyout.u == HUGE_VAL); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":76 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":80 * # change it to a real (but very large) number. * if projxyout.u == HUGE_VAL: * lonsdata[i] = 1.e30 # <<<<<<<<<<<<<< @@ -747,7 +765,7 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":78 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":82 * lonsdata[i] = 1.e30 * else: * lonsdata[i] = projxyout.u # <<<<<<<<<<<<<< @@ -758,21 +776,21 @@ } __pyx_L9:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":79 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":83 * else: * lonsdata[i] = projxyout.u * if projxyout.v == HUGE_VAL: # <<<<<<<<<<<<<< * latsdata[i] = 1.e30 - * else: + * else: */ __pyx_1 = (__pyx_v_projxyout.v == HUGE_VAL); if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":80 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":84 * lonsdata[i] = projxyout.u * if projxyout.v == HUGE_VAL: * latsdata[i] = 1.e30 # <<<<<<<<<<<<<< - * else: + * else: * latsdata[i] = projxyout.v */ (__pyx_v_latsdata[__pyx_v_i]) = 1.e30; @@ -780,12 +798,12 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_proj.pyx":82 + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":86 * latsdata[i] = 1.e30 - * else: + * else: * latsdata[i] = projxyout.v # <<<<<<<<<<<<<< * - * def _inv(self, object x, object y, radians=False, errcheck=False): + * def _fwdn(self, c_numpy.ndarray lonlat, radians=False, errcheck=False): */ (__pyx_v_latsdata[__pyx_v_i]) = __pyx_v_projxyout.v; } @@ -809,12 +827,485 @@ return __pyx_r; } -static PyObject *__pyx_k12p; +static PyObject *__pyx_f_py_5_proj_4Proj__fwdn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5_proj_4Proj__fwdn[] = "\n forward transformation - lons,lats to x,y (done in place).\n Uses ndarray of shape ...,2.\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the forward\n transformation is invalid.\n if errcheck=False and the forward transformation is\n invalid, no exception is\n raised and 1.e30 is returned.\n "; +static PyObject *__pyx_f_py_5_proj_4Proj__fwdn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_lonlat = 0; + PyObject *__pyx_v_radians = 0; + PyObject *__pyx_v_errcheck = 0; + projUV __pyx_v_projxyout; + projUV __pyx_v_projlonlatin; + projUV (*__pyx_v_llptr); + Py_ssize_t __pyx_v_npts; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + double __pyx_5; + static char *__pyx_argnames[] = {"lonlat","radians","errcheck",0}; + __pyx_v_radians = __pyx_k6; + __pyx_v_errcheck = __pyx_k7; + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_lonlat, &__pyx_v_radians, &__pyx_v_errcheck))) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_lonlat); + Py_INCREF(__pyx_v_radians); + Py_INCREF(__pyx_v_errcheck); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lonlat), __pyx_ptype_7c_numpy_ndarray, 1, "lonlat"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} -static char (__pyx_k12[]) = "Buffer lengths not the same"; + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":102 + * cdef projUV *llptr + * cdef Py_ssize_t npts, i + * npts = c_numpy.PyArray_SIZE(lonlat)//2 # <<<<<<<<<<<<<< + * llptr = <projUV *>lonlat.data + * for i from 0 <= i < npts: + */ + __pyx_v_npts = (PyArray_SIZE(__pyx_v_lonlat) / 2); + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":103 + * cdef Py_ssize_t npts, i + * npts = c_numpy.PyArray_SIZE(lonlat)//2 + * llptr = <projUV *>lonlat.data # <<<<<<<<<<<<<< + * for i from 0 <= i < npts: + * if radians: + */ + __pyx_v_llptr = ((projUV (*))__pyx_v_lonlat->data); + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":104 + * npts = c_numpy.PyArray_SIZE(lonlat)//2 + * llptr = <projUV *>lonlat.data + * for i from 0 <= i < npts: # <<<<<<<<<<<<<< + * if radians: + * projlonlatin = llptr[i] + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_npts; __pyx_v_i++) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":105 + * llptr = <projUV *>lonlat.data + * for i from 0 <= i < npts: + * if radians: # <<<<<<<<<<<<<< + * projlonlatin = llptr[i] + * else: + */ + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + if (__pyx_1) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":106 + * for i from 0 <= i < npts: + * if radians: + * projlonlatin = llptr[i] # <<<<<<<<<<<<<< + * else: + * projlonlatin.u = _dg2rad*llptr[i].u + */ + __pyx_v_projlonlatin = (__pyx_v_llptr[__pyx_v_i]); + goto __pyx_L4; + } + /*else*/ { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":108 + * projlonlatin = llptr[i] + * else: + * projlonlatin.u = _dg2rad*llptr[i].u # <<<<<<<<<<<<<< + * projlonlatin.v = _dg2rad*llptr[i].v + * projxyout = pj_fwd(projlonlatin,self.projpj) + */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble((__pyx_v_llptr[__pyx_v_i]).u); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; 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 = 108; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_projlonlatin.u = __pyx_5; + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":109 + * else: + * projlonlatin.u = _dg2rad*llptr[i].u + * projlonlatin.v = _dg2rad*llptr[i].v # <<<<<<<<<<<<<< + * projxyout = pj_fwd(projlonlatin,self.projpj) + * + */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble((__pyx_v_llptr[__pyx_v_i]).v); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; 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 = 109; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_projlonlatin.v = __pyx_5; + } + __pyx_L4:; + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":110 + * projlonlatin.u = _dg2rad*llptr[i].u + * projlonlatin.v = _dg2rad*llptr[i].v + * projxyout = pj_fwd(projlonlatin,self.projpj) # <<<<<<<<<<<<<< + * + * if errcheck and pj_errno != 0: + */ + __pyx_v_projxyout = pj_fwd(__pyx_v_projlonlatin,((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projpj); + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":112 + * projxyout = pj_fwd(projlonlatin,self.projpj) + * + * if errcheck and pj_errno != 0: # <<<<<<<<<<<<<< + * raise RuntimeError(pj_strerrno(pj_errno)) + * # since HUGE_VAL can be 'inf', + */ + __pyx_2 = __pyx_v_errcheck; + Py_INCREF(__pyx_2); + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} + if (__pyx_1) { + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = __Pyx_PyBool_FromLong((pj_errno != 0)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} + } + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_1) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":113 + * + * if errcheck and pj_errno != 0: + * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< + * # since HUGE_VAL can be 'inf', + * # change it to a real (but very large) number. + */ + __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + goto __pyx_L5; + } + __pyx_L5:; + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":116 + * # since HUGE_VAL can be 'inf', + * # change it to a real (but very large) number. + * if projxyout.u == HUGE_VAL: # <<<<<<<<<<<<<< + * llptr[i].u = 1.e30 + * else: + */ + __pyx_1 = (__pyx_v_projxyout.u == HUGE_VAL); + if (__pyx_1) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":117 + * # change it to a real (but very large) number. + * if projxyout.u == HUGE_VAL: + * llptr[i].u = 1.e30 # <<<<<<<<<<<<<< + * else: + * llptr[i].u = projxyout.u + */ + (__pyx_v_llptr[__pyx_v_i]).u = 1.e30; + goto __pyx_L6; + } + /*else*/ { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":119 + * llptr[i].u = 1.e30 + * else: + * llptr[i].u = projxyout.u # <<<<<<<<<<<<<< + * if projxyout.v == HUGE_VAL: + * llptr[i].u = 1.e30 + */ + (__pyx_v_llptr[__pyx_v_i]).u = __pyx_v_projxyout.u; + } + __pyx_L6:; + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":120 + * else: + * llptr[i].u = projxyout.u + * if projxyout.v == HUGE_VAL: # <<<<<<<<<<<<<< + * llptr[i].u = 1.e30 + * else: + */ + __pyx_1 = (__pyx_v_projxyout.v == HUGE_VAL); + if (__pyx_1) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":121 + * llptr[i].u = projxyout.u + * if projxyout.v == HUGE_VAL: + * llptr[i].u = 1.e30 # <<<<<<<<<<<<<< + * else: + * llptr[i].v = projxyout.v + */ + (__pyx_v_llptr[__pyx_v_i]).u = 1.e30; + goto __pyx_L7; + } + /*else*/ { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":123 + * llptr[i].u = 1.e30 + * else: + * llptr[i].v = projxyout.v # <<<<<<<<<<<<<< + * + * def _invn(self, c_numpy.ndarray xy, radians=False, errcheck=False): + */ + (__pyx_v_llptr[__pyx_v_i]).v = __pyx_v_projxyout.v; + } + __pyx_L7:; + } + + __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("_proj.Proj._fwdn"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_lonlat); + Py_DECREF(__pyx_v_radians); + Py_DECREF(__pyx_v_errcheck); + return __pyx_r; +} + +static PyObject *__pyx_f_py_5_proj_4Proj__invn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_5_proj_4Proj__invn[] = "\n inverse transformation - x,y to lons,lats (done in place).\n Uses ndarray of shape ...,2.\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the inverse transformation is invalid.\n if errcheck=False and the inverse transformation is invalid, no exception is\n raised and 1.e30 is returned.\n "; +static PyObject *__pyx_f_py_5_proj_4Proj__invn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_xy = 0; + PyObject *__pyx_v_radians = 0; + PyObject *__pyx_v_errcheck = 0; + projUV __pyx_v_projxyin; + projUV __pyx_v_projlonlatout; + projUV (*__pyx_v_llptr); + Py_ssize_t __pyx_v_npts; + Py_ssize_t __pyx_v_i; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + double __pyx_5; + static char *__pyx_argnames[] = {"xy","radians","errcheck",0}; + __pyx_v_radians = __pyx_k8; + __pyx_v_errcheck = __pyx_k9; + if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_xy, &__pyx_v_radians, &__pyx_v_errcheck))) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_xy); + Py_INCREF(__pyx_v_radians); + Py_INCREF(__pyx_v_errcheck); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xy), __pyx_ptype_7c_numpy_ndarray, 1, "xy"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;} + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":137 + * cdef projUV *llptr + * cdef Py_ssize_t npts, i + * npts = c_numpy.PyArray_SIZE(xy)//2 # <<<<<<<<<<<<<< + * llptr = <projUV *>xy.data + * + */ + __pyx_v_npts = (PyArray_SIZE(__pyx_v_xy) / 2); + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":138 + * cdef Py_ssize_t npts, i + * npts = c_numpy.PyArray_SIZE(xy)//2 + * llptr = <projUV *>xy.data # <<<<<<<<<<<<<< + * + * for i from 0 <= i < npts: + */ + __pyx_v_llptr = ((projUV (*))__pyx_v_xy->data); + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":140 + * llptr = <projUV *>xy.data + * + * for i from 0 <= i < npts: # <<<<<<<<<<<<<< + * projxyin = llptr[i] + * projlonlatout = pj_inv(projxyin, self.projpj) + */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_npts; __pyx_v_i++) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":141 + * + * for i from 0 <= i < npts: + * projxyin = llptr[i] # <<<<<<<<<<<<<< + * projlonlatout = pj_inv(projxyin, self.projpj) + * if errcheck and pj_errno != 0: + */ + __pyx_v_projxyin = (__pyx_v_llptr[__pyx_v_i]); + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":142 + * for i from 0 <= i < npts: + * projxyin = llptr[i] + * projlonlatout = pj_inv(projxyin, self.projpj) # <<<<<<<<<<<<<< + * if errcheck and pj_errno != 0: + * raise RuntimeError(pj_strerrno(pj_errno)) + */ + __pyx_v_projlonlatout = pj_inv(__pyx_v_projxyin,((struct __pyx_obj_5_proj_Proj *)__pyx_v_self)->projpj); + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":143 + * projxyin = llptr[i] + * projlonlatout = pj_inv(projxyin, self.projpj) + * if errcheck and pj_errno != 0: # <<<<<<<<<<<<<< + * raise RuntimeError(pj_strerrno(pj_errno)) + * # since HUGE_VAL can be 'inf', + */ + __pyx_1 = __pyx_v_errcheck; + Py_INCREF(__pyx_1); + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} + if (__pyx_2) { + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = __Pyx_PyBool_FromLong((pj_errno != 0)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} + } + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (__pyx_2) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":144 + * projlonlatout = pj_inv(projxyin, self.projpj) + * if errcheck and pj_errno != 0: + * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< + * # since HUGE_VAL can be 'inf', + * # change it to a real (but very large) number. + */ + __pyx_1 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); + __pyx_1 = 0; + __pyx_1 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_1, 0, 0); + Py_DECREF(__pyx_1); __pyx_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;} + goto __pyx_L4; + } + __pyx_L4:; + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":147 + * # since HUGE_VAL can be 'inf', + * # change it to a real (but very large) number. + * if projlonlatout.u == HUGE_VAL: # <<<<<<<<<<<<<< + * llptr[i].u = 1.e30 + * elif radians: + */ + __pyx_2 = (__pyx_v_projlonlatout.u == HUGE_VAL); + if (__pyx_2) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":148 + * # change it to a real (but very large) number. + * if projlonlatout.u == HUGE_VAL: + * llptr[i].u = 1.e30 # <<<<<<<<<<<<<< + * elif radians: + * llptr[i].u = projlonlatout.u + */ + (__pyx_v_llptr[__pyx_v_i]).u = 1.e30; + goto __pyx_L5; + } + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} + if (__pyx_2) { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":150 + * llptr[i].u = 1.e30 + * elif radians: + * llptr[i].u = projlonlatout.u # <<<<<<<<<<<<<< + * else: + * llptr[i].u = _rad2dg*projlonlatout.u + */ + (__pyx_v_llptr[__pyx_v_i]).u = __pyx_v_projlonlatout.u; + goto __pyx_L5; + } + /*else*/ { + + /* "/home/efiring/programs/py/mpl/basemap.dev/src/_proj.pyx":152 + * llptr[i].u = projlonlatout.u + * else: + * llptr[i].u = _rad2dg*projlonlatout.u # <<<<<<<<<<<<<< + * if projlonlatout.v == HUGE_VAL: + * llptr[i].v = 1.e30 + */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_3)) {__py... [truncated message content] |