You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(4) |
2
(9) |
3
(23) |
4
(34) |
5
(31) |
6
(25) |
7
(10) |
8
(7) |
9
(1) |
10
(18) |
11
(3) |
12
(18) |
13
(13) |
14
(6) |
15
(9) |
16
(6) |
17
(10) |
18
(12) |
19
(1) |
20
(8) |
21
(5) |
22
|
23
|
24
|
25
|
26
(4) |
27
(2) |
28
(4) |
29
|
30
|
31
|
|
|
|
|
|
From: <js...@us...> - 2007-12-28 20:29:37
|
Revision: 4797 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4797&view=rev Author: jswhit Date: 2007-12-28 12:29:30 -0800 (Fri, 28 Dec 2007) Log Message: ----------- updated proj4 sources to 4.6.0 Modified Paths: -------------- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2007-12-28 20:18:46 UTC (rev 4796) +++ trunk/toolkits/basemap/Changelog 2007-12-28 20:29:30 UTC (rev 4797) @@ -1,4 +1,5 @@ version 0.9.9 (not yet released) + * updated proj4 sources to version 4.6.0. * removed hidden dependency on setuptools (in dap module). * fixed exception handling bug in code that looks for intersection between boundary feature and map projection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-12-28 20:19:50
|
Revision: 4796 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4796&view=rev Author: jswhit Date: 2007-12-28 12:18:46 -0800 (Fri, 28 Dec 2007) Log Message: ----------- update to proj 4.6.0 (second try) Modified Paths: -------------- trunk/toolkits/basemap/src/PJ_laea.c trunk/toolkits/basemap/src/PJ_wag3.c trunk/toolkits/basemap/src/_geod.c trunk/toolkits/basemap/src/_proj.c trunk/toolkits/basemap/src/emess.c trunk/toolkits/basemap/src/geocent.c trunk/toolkits/basemap/src/geocent.h trunk/toolkits/basemap/src/geod.c trunk/toolkits/basemap/src/nad_init.c trunk/toolkits/basemap/src/pj_datum_set.c trunk/toolkits/basemap/src/pj_factors.c trunk/toolkits/basemap/src/pj_gridinfo.c trunk/toolkits/basemap/src/pj_gridlist.c trunk/toolkits/basemap/src/pj_init.c trunk/toolkits/basemap/src/pj_latlong.c trunk/toolkits/basemap/src/pj_list.h trunk/toolkits/basemap/src/pj_open_lib.c trunk/toolkits/basemap/src/pj_release.c trunk/toolkits/basemap/src/pj_transform.c trunk/toolkits/basemap/src/pj_utils.c trunk/toolkits/basemap/src/proj_api.h trunk/toolkits/basemap/src/projects.h trunk/toolkits/basemap/src/rtodms.c Modified: trunk/toolkits/basemap/src/PJ_laea.c =================================================================== --- trunk/toolkits/basemap/src/PJ_laea.c 2007-12-28 20:04:31 UTC (rev 4795) +++ trunk/toolkits/basemap/src/PJ_laea.c 2007-12-28 20:18:46 UTC (rev 4796) @@ -179,8 +179,14 @@ 0. : atan2(xy.x, xy.y); return (lp); } -FREEUP; if (P) pj_dalloc(P); } -ENTRY0(laea) +FREEUP; + if (P) { + if (P->apa) + pj_dalloc(P->apa); + pj_dalloc(P); + } +} +ENTRY1(laea,apa) double t; if (fabs((t = fabs(P->phi0)) - HALFPI) < EPS10) Modified: trunk/toolkits/basemap/src/PJ_wag3.c =================================================================== --- trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-28 20:04:31 UTC (rev 4795) +++ trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-28 20:18:46 UTC (rev 4796) @@ -5,7 +5,7 @@ double C_x; #define PJ_LIB__ # include <projects.h> -PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph."; +PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph.\n\tlat_ts="; #define TWOTHIRD 0.6666666666666666666667 FORWARD(s_forward); /* spheroid */ xy.x = P->C_x * lp.lam * cos(TWOTHIRD * lp.phi); Modified: trunk/toolkits/basemap/src/_geod.c =================================================================== --- trunk/toolkits/basemap/src/_geod.c 2007-12-28 20:04:31 UTC (rev 4795) +++ trunk/toolkits/basemap/src/_geod.c 2007-12-28 20:18:46 UTC (rev 4796) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.6.8 on Wed Nov 14 11:06:42 2007 */ +/* Generated by Cython 0.9.6.9 on Fri Dec 28 13:16:13 2007 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -15,6 +15,9 @@ #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) #endif +#if PY_VERSION_HEX < 0x02040000 + #define METH_COEXIST 0 +#endif #ifndef WIN32 #define __stdcall #define __cdecl @@ -83,8 +86,6 @@ 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*/ @@ -108,6 +109,14 @@ /* Declarations from _geod */ +/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":5 + * include "_pyproj.pxi" + * + * cdef class Geod: # <<<<<<<<<<<<<< + * cdef GEODESIC_T geodesic_t + * cdef public object geodparams + */ + struct __pyx_obj_5_geod_Geod { PyObject_HEAD GEODESIC_T geodesic_t; @@ -117,6 +126,14 @@ }; +/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":5 + * include "_pyproj.pxi" + * + * cdef class Geod: # <<<<<<<<<<<<<< + * cdef GEODESIC_T geodesic_t + * cdef public object geodparams + */ + static PyTypeObject *__pyx_ptype_5_geod_Geod = 0; static PyObject *__pyx_k3; static PyObject *__pyx_k4; @@ -142,6 +159,14 @@ static PyObject *__pyx_k2p; +/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":11 + * cdef char *geodinitstring + * + * def __new__(self, geodparams): # <<<<<<<<<<<<<< + * cdef GEODESIC_T GEOD_T + * self.geodparams = geodparams + */ + static PyObject *__pyx_n_iteritems; static PyObject *__pyx_n_append; static PyObject *__pyx_n_join; @@ -182,7 +207,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-testing/src/_geod.pyx":29 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":13 * def __new__(self, geodparams): * cdef GEODESIC_T GEOD_T * self.geodparams = geodparams # <<<<<<<<<<<<<< @@ -193,32 +218,40 @@ 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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":15 * 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;} + __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; 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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":16 * # 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;} + __pyx_1 = PyObject_GetAttr(__pyx_v_geodparams, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; 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;} } + else { __pyx_1 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} } Py_DECREF(__pyx_3); __pyx_3 = 0; for (;;) { + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":16 + * # setup proj initialization string. + * geodargs = [] + * for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<< + * geodargs.append('+'+key+"="+str(value)+' ') + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + */ 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); @@ -229,72 +262,160 @@ if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) { __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0); Py_INCREF(__pyx_5); + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":16 + * # setup proj initialization string. + * geodargs = [] + * for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<< + * geodargs.append('+'+key+"="+str(value)+' ') + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + */ 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); + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":16 + * # setup proj initialization string. + * geodargs = [] + * for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<< + * geodargs.append('+'+key+"="+str(value)+' ') + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + */ 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;} + __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; 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;} + __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":16 + * # setup proj initialization string. + * geodargs = [] + * for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<< + * geodargs.append('+'+key+"="+str(value)+' ') + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + */ 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;} + __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":16 + * # setup proj initialization string. + * geodargs = [] + * for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<< + * geodargs.append('+'+key+"="+str(value)+' ') + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + */ 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;} + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; 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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":17 + * geodargs = [] + * for key,value in geodparams.iteritems(): + * geodargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<< + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + * # initialize projection + */ + __pyx_5 = PyObject_GetAttr(__pyx_v_geodargs, __pyx_n_append); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":17 + * geodargs = [] + * for key,value in geodparams.iteritems(): + * geodargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<< + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + * # initialize projection + */ + __pyx_3 = PyNumber_Add(__pyx_k6p, __pyx_v_key); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":17 + * geodargs = [] + * for key,value in geodparams.iteritems(): + * geodargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<< + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + * # initialize projection + */ + __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k7p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; 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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":17 + * geodargs = [] + * for key,value in geodparams.iteritems(): + * geodargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<< + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + * # initialize projection + */ + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; 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;} + __pyx_6 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; 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;} + __pyx_3 = PyNumber_Add(__pyx_4, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; 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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":17 + * geodargs = [] + * for key,value in geodparams.iteritems(): + * geodargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<< + * self.geodinitstring = PyString_AsString(''.join(geodargs)) + * # initialize projection + */ + __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k8p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; 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;} + __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; 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;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; 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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":18 * 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;} + __pyx_4 = PyObject_GetAttr(__pyx_k9p, __pyx_n_join); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":18 + * 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_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; 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;} + __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":18 + * 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] + */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":20 * self.geodinitstring = PyString_AsString(''.join(geodargs)) * # initialize projection * self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] # <<<<<<<<<<<<<< @@ -303,7 +424,7 @@ */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":21 * # initialize projection * self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] * if pj_errno != 0: # <<<<<<<<<<<<<< @@ -312,27 +433,43 @@ */ __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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":22 + * 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_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; 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;} + __pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; 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;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":39 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":23 * 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;} + __pyx_5 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":23 + * if pj_errno != 0: + * raise RuntimeError(pj_strerrno(pj_errno)) + * self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<< + * + * def __reduce__(self): + */ 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; @@ -356,6 +493,14 @@ return __pyx_r; } +/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":25 + * self.proj_version = PJ_VERSION/100. + * + * def __reduce__(self): # <<<<<<<<<<<<<< + * """special method that allows pyproj.Geod instance to be pickled""" + * return (self.__class__,(self.geodparams,)) + */ + static PyObject *__pyx_n___class__; static PyObject *__pyx_pf_5_geod_4Geod___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ @@ -366,11 +511,27 @@ 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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":27 + * def __reduce__(self): + * """special method that allows pyproj.Geod instance to be pickled""" + * return (self.__class__,(self.geodparams,)) # <<<<<<<<<<<<<< + * + * def _fwd(self, object lons, object lats, object az, object dist, radians=False): + */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":27 + * def __reduce__(self): + * """special method that allows pyproj.Geod instance to be pickled""" + * return (self.__class__,(self.geodparams,)) # <<<<<<<<<<<<<< + * + * def _fwd(self, object lons, object lats, object az, object dist, radians=False): + */ + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; 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;} + __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); __pyx_1 = 0; @@ -392,6 +553,14 @@ return __pyx_r; } +/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":29 + * 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 + */ + static PyObject *__pyx_n_ValueError; static PyObject *__pyx_k10p; @@ -443,7 +612,7 @@ Py_INCREF(__pyx_v_dist); Py_INCREF(__pyx_v_radians); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":56 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":40 * cdef void *londata, *latdata, *azdat, *distdat * # if buffer api is supported, get pointer to data buffers. * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<< @@ -452,13 +621,21 @@ */ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons,(&__pyx_v_londata),(&__pyx_v_buflenlons)) != 0); if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":41 + * # 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: + * raise RuntimeError + */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":58 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":42 * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: * raise RuntimeError * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<< @@ -467,13 +644,21 @@ */ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats,(&__pyx_v_latdata),(&__pyx_v_buflenlats)) != 0); if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":43 + * raise RuntimeError + * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: + * raise RuntimeError # <<<<<<<<<<<<<< + * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: + * raise RuntimeError + */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":60 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":44 * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: * raise RuntimeError * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<< @@ -482,13 +667,21 @@ */ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_az,(&__pyx_v_azdat),(&__pyx_v_buflenaz)) != 0); if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":45 + * raise RuntimeError + * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: + * raise RuntimeError # <<<<<<<<<<<<<< + * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: + * raise RuntimeError + */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":62 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":46 * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: * raise RuntimeError * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<< @@ -497,13 +690,21 @@ */ __pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_dist,(&__pyx_v_distdat),(&__pyx_v_buflend)) != 0); if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":47 + * raise RuntimeError + * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: + * raise RuntimeError # <<<<<<<<<<<<<< + * # process data in buffer + * if not buflenlons == buflenlats == buflenaz == buflend: + */ __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":65 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":49 * raise RuntimeError * # process data in buffer * if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<< @@ -512,42 +713,74 @@ */ __pyx_1 = (__pyx_v_buflenlons == __pyx_v_buflenlats); if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":49 + * 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_buflenlats == __pyx_v_buflenaz); if (__pyx_1) { + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":49 + * 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_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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":50 + * # process data in buffer + * if not buflenlons == buflenlats == buflenaz == buflend: + * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< + * ndim = buflenlons/_doublesize + * lonsdata = <double *>londata + */ + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; 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;} + __pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; 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;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":67 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":51 * 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;} + __pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":51 + * if not buflenlons == buflenlats == buflenaz == buflend: + * raise RuntimeError("Buffer lengths not the same") + * ndim = buflenlons/_doublesize # <<<<<<<<<<<<<< + * lonsdata = <double *>londata + * latsdata = <double *>latdata + */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;} + __pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; 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;} + __pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely((__pyx_6 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; 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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":52 * raise RuntimeError("Buffer lengths not the same") * ndim = buflenlons/_doublesize * lonsdata = <double *>londata # <<<<<<<<<<<<<< @@ -556,7 +789,7 @@ */ __pyx_v_lonsdata = ((double *)__pyx_v_londata); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":69 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":53 * ndim = buflenlons/_doublesize * lonsdata = <double *>londata * latsdata = <double *>latdata # <<<<<<<<<<<<<< @@ -565,7 +798,7 @@ */ __pyx_v_latsdata = ((double *)__pyx_v_latdata); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":70 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":54 * lonsdata = <double *>londata * latsdata = <double *>latdata * azdata = <double *>azdat # <<<<<<<<<<<<<< @@ -574,7 +807,7 @@ */ __pyx_v_azdata = ((double *)__pyx_v_azdat); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":71 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":55 * latsdata = <double *>latdata * azdata = <double *>azdat * distdata = <double *>distdat # <<<<<<<<<<<<<< @@ -583,7 +816,7 @@ */ __pyx_v_distdata = ((double *)__pyx_v_distdat); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":72 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":56 * azdata = <double *>azdat * distdata = <double *>distdat * for i from 0 <= i < ndim: # <<<<<<<<<<<<<< @@ -592,17 +825,17 @@ */ 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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":57 * 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;} + __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} if (__pyx_1) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":74 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":58 * for i from 0 <= i < ndim: * if radians: * self.geodesic_t.p1.v = lonsdata[i] # <<<<<<<<<<<<<< @@ -611,7 +844,7 @@ */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":59 * if radians: * self.geodesic_t.p1.v = lonsdata[i] * self.geodesic_t.p1.u = latsdata[i] # <<<<<<<<<<<<<< @@ -620,7 +853,7 @@ */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":60 * self.geodesic_t.p1.v = lonsdata[i] * self.geodesic_t.p1.u = latsdata[i] * self.geodesic_t.ALPHA12 = azdata[i] # <<<<<<<<<<<<<< @@ -629,7 +862,7 @@ */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":61 * self.geodesic_t.p1.u = latsdata[i] * self.geodesic_t.ALPHA12 = azdata[i] * self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<< @@ -641,55 +874,103 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":79 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":63 * 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;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":63 + * 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_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} + __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; 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;} + __pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":63 + * 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] + */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":64 * 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;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":64 + * 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_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; 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;} + __pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":64 + * 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] + */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":65 * 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;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":65 + * 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_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;} + __pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; 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;} + __pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":65 + * 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) + */ ((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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":66 * self.geodesic_t.p1.u = _dg2rad*latsdata[i] * self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] * self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<< @@ -700,7 +981,7 @@ } __pyx_L9:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":83 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":67 * self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] * self.geodesic_t.DIST = distdata[i] * geod_pre(&self.geodesic_t) # <<<<<<<<<<<<<< @@ -709,7 +990,7 @@ */ geod_pre((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":84 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":68 * self.geodesic_t.DIST = distdata[i] * geod_pre(&self.geodesic_t) * if pj_errno != 0: # <<<<<<<<<<<<<< @@ -718,20 +999,28 @@ */ __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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":69 + * geod_pre(&self.geodesic_t) + * if pj_errno != 0: + * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<< + * geod_for(&self.geodesic_t) + * if pj_errno != 0: + */ + __pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; 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;} + __pyx_5 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; 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;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} goto __pyx_L10; } __pyx_L10:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":86 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":70 * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) * geod_for(&self.geodesic_t) # <<<<<<<<<<<<<< @@ -740,7 +1029,7 @@ */ geod_for((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t)); - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":87 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":71 * raise RuntimeError(pj_strerrno(pj_errno)) * geod_for(&self.geodesic_t) * if pj_errno != 0: # <<<<<<<<<<<<<< @@ -749,20 +1038,28 @@ */ __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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":72 + * geod_for(&self.geodesic_t) + * 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)') + */ + __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;} 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;} + __pyx_5 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; 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;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} goto __pyx_L11; } __pyx_L11:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":89 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":73 * if pj_errno != 0: * raise RuntimeError(pj_strerrno(pj_errno)) * if isnan(self.geodesic_t.ALPHA21): # <<<<<<<<<<<<<< @@ -771,29 +1068,37 @@ */ __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;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":74 + * raise RuntimeError(pj_strerrno(pj_errno)) + * 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 + */ + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; 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;} + __pyx_4 = PyObject_CallObject(__pyx_builtin_ValueError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; 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;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;} goto __pyx_L12; } __pyx_L12:; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":91 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":75 * 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;} + __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;} if (__pyx_2) { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":92 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":76 * raise ValueError('undefined forward geodesic (may be an equatorial arc)') * if radians: * lonsdata[i] = self.geodesic_t.p2.v # <<<<<<<<<<<<<< @@ -802,7 +1107,7 @@ */ (__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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":77 * if radians: * lonsdata[i] = self.geodesic_t.p2.v * latsdata[i] = self.geodesic_t.p2.u # <<<<<<<<<<<<<< @@ -811,7 +1116,7 @@ */ (__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 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":78 * lonsdata[i] = self.geodesic_t.p2.v * latsdata[i] = self.geodesic_t.p2.u * azdata[i] = self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<< @@ -823,52 +1128,100 @@ } /*else*/ { - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":96 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":80 * 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;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":80 + * 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_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 = 80; goto __pyx_L1;} + __pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; 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;} + __pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":80 + * 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_v_lonsdata[__pyx_v_i]) = __pyx_7; - /* "/Users/jsw/python/matplotlib/toolkits/basemap-testing/src/_geod.pyx":97 + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":81 * 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;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + + /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":81 + * else: + * lonsdata[i] = _rad2dg*self.geodesic_t.p2.v + * latsdata[i] = _rad2dg*self.geodesic_t.p2.u # <<<<<<<<<<<<<< + * azdata[i] = _rad2dg*self.ge... [truncated message content] |
From: <js...@us...> - 2007-12-28 20:04:38
|
Revision: 4795 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4795&view=rev Author: jswhit Date: 2007-12-28 12:04:31 -0800 (Fri, 28 Dec 2007) Log Message: ----------- revert the update to proj 4.6.0 Modified Paths: -------------- trunk/toolkits/basemap/src/PJ_gn_sinu.c trunk/toolkits/basemap/src/PJ_krovak.c trunk/toolkits/basemap/src/PJ_laea.c trunk/toolkits/basemap/src/PJ_wag3.c trunk/toolkits/basemap/src/emess.c trunk/toolkits/basemap/src/geocent.c trunk/toolkits/basemap/src/geocent.h trunk/toolkits/basemap/src/geod.c trunk/toolkits/basemap/src/nad_init.c trunk/toolkits/basemap/src/pj_datum_set.c trunk/toolkits/basemap/src/pj_factors.c trunk/toolkits/basemap/src/pj_gridinfo.c trunk/toolkits/basemap/src/pj_gridlist.c trunk/toolkits/basemap/src/pj_init.c trunk/toolkits/basemap/src/pj_latlong.c trunk/toolkits/basemap/src/pj_list.h trunk/toolkits/basemap/src/pj_open_lib.c trunk/toolkits/basemap/src/pj_release.c trunk/toolkits/basemap/src/pj_transform.c trunk/toolkits/basemap/src/pj_utils.c trunk/toolkits/basemap/src/proj_api.h trunk/toolkits/basemap/src/projects.h trunk/toolkits/basemap/src/rtodms.c Modified: trunk/toolkits/basemap/src/PJ_gn_sinu.c =================================================================== --- trunk/toolkits/basemap/src/PJ_gn_sinu.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_gn_sinu.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -75,6 +75,7 @@ if (!(P->en = pj_enfn(P->es))) E_ERROR_0; if (P->es) { + P->en = pj_enfn(P->es); P->inv = e_inverse; P->fwd = e_forward; } else { Modified: trunk/toolkits/basemap/src/PJ_krovak.c =================================================================== --- trunk/toolkits/basemap/src/PJ_krovak.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_krovak.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: PJ_krovak.c,v 1.9 2007/03/07 17:32:32 fwarmerdam Exp $ + * $Id: PJ_krovak.c,v 1.6 2006/09/14 13:10:50 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Implementation of the krovak (Krovak) projection. @@ -30,15 +30,6 @@ ****************************************************************************** * * $Log: PJ_krovak.c,v $ - * Revision 1.9 2007/03/07 17:32:32 fwarmerdam - * remove orphan semicolon. - * - * Revision 1.8 2007/03/07 17:28:08 fwarmerdam - * Make it reasonably clear that this is ellipsoidal in the code. - * - * Revision 1.7 2007/03/07 17:25:34 fwarmerdam - * report krovak as ellipsoidal, not spherical - * * Revision 1.6 2006/09/14 13:10:50 fwarmerdam * Add +czech flag to control reversal of signs (bug 1133,147) * @@ -64,9 +55,9 @@ #include <string.h> #include <stdio.h> -PJ_CVSID("$Id: PJ_krovak.c,v 1.9 2007/03/07 17:32:32 fwarmerdam Exp $"); +PJ_CVSID("$Id: PJ_krovak.c,v 1.6 2006/09/14 13:10:50 fwarmerdam Exp $"); -PROJ_HEAD(krovak, "Krovak") "\n\tPCyl., Ellps."; +PROJ_HEAD(krovak, "Krovak") "\n\tPCyl., Sph."; /** NOTES: According to EPSG the full Krovak projection method should have @@ -93,7 +84,7 @@ -FORWARD(e_forward); /* ellipsoid */ +FORWARD(s_forward); /* spheroid */ /* calculate xy from lat/lon */ char errmess[255]; @@ -162,7 +153,7 @@ -INVERSE(e_inverse); /* ellipsoid */ +INVERSE(s_inverse); /* spheroid */ /* calculate lat/lon from xy */ /* Constants, identisch wie in der Umkehrfunktion */ @@ -267,14 +258,15 @@ /* as input and output, instead of lat/long relative to Ferro */ if (!pj_param(P->params, "tlon_0").i) P->lam0 = 0.7417649320975901 - 0.308341501185665; +; /* if scale not set default to 0.9999 */ if (!pj_param(P->params, "tk").i) P->k0 = 0.9999; /* always the same */ - P->inv = e_inverse; - P->fwd = e_forward; + P->inv = s_inverse; + P->fwd = s_forward; ENDENTRY(P) Modified: trunk/toolkits/basemap/src/PJ_laea.c =================================================================== --- trunk/toolkits/basemap/src/PJ_laea.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_laea.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -179,14 +179,8 @@ 0. : atan2(xy.x, xy.y); return (lp); } -FREEUP; - if (P) { - if (P->apa) - pj_dalloc(P->apa); - pj_dalloc(P); - } -} -ENTRY1(laea,apa) +FREEUP; if (P) pj_dalloc(P); } +ENTRY0(laea) double t; if (fabs((t = fabs(P->phi0)) - HALFPI) < EPS10) Modified: trunk/toolkits/basemap/src/PJ_wag3.c =================================================================== --- trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -5,7 +5,7 @@ double C_x; #define PJ_LIB__ # include <projects.h> -PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph.\n\tlat_ts="; +PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph."; #define TWOTHIRD 0.6666666666666666666667 FORWARD(s_forward); /* spheroid */ xy.x = P->C_x * lp.lam * cos(TWOTHIRD * lp.phi); Modified: trunk/toolkits/basemap/src/emess.c =================================================================== --- trunk/toolkits/basemap/src/emess.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/emess.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -3,15 +3,6 @@ static const char SCCSID[]="@(#)emess.c 4.6 94/05/24 GIE REL"; #endif -#ifdef _MSC_VER -# ifndef _CRT_SECURE_NO_DEPRECATE -# define _CRT_SECURE_NO_DEPRECATE -# endif -# ifndef _CRT_NONSTDC_NO_DEPRECATE -# define _CRT_NONSTDC_NO_DEPRECATE -# endif -#endif - #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: trunk/toolkits/basemap/src/geocent.c =================================================================== --- trunk/toolkits/basemap/src/geocent.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/geocent.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -65,9 +65,6 @@ * 25-02-97 Original Code * * $Log: geocent.c,v $ - * Revision 1.7 2007/09/11 20:19:36 fwarmerdam - * avoid use of static variables to make reentrant - * * Revision 1.6 2006/01/12 22:29:01 fwarmerdam * make geocent.c globals static to avoid conflicts * @@ -112,11 +109,29 @@ /***************************************************************************/ /* + * GLOBAL DECLARATIONS + */ +/* Ellipsoid parameters, default to WGS 84 */ +static double Geocent_a = 6378137.0; /* Semi-major axis of ellipsoid in meters */ +static double Geocent_b = 6356752.3142; /* Semi-minor axis of ellipsoid */ + +static double Geocent_a2 = 40680631590769.0; /* Square of semi-major axis */ +static double Geocent_b2 = 40408299984087.05; /* Square of semi-minor axis */ +static double Geocent_e2 = 0.0066943799901413800; /* Eccentricity squared */ +static double Geocent_ep2 = 0.00673949675658690300; /* 2nd eccentricity squared */ +/* + * These state variables are for optimization purposes. The only function + * that should modify them is Set_Geocentric_Parameters. + */ + + +/***************************************************************************/ +/* * FUNCTIONS */ -long pj_Set_Geocentric_Parameters (GeocentricInfo *gi, double a, double b) +long pj_Set_Geocentric_Parameters (double a, double b) { /* BEGIN Set_Geocentric_Parameters */ /* @@ -126,30 +141,29 @@ * a : Semi-major axis, in meters. (input) * b : Semi-minor axis, in meters. (input) */ - long Error_Code = GEOCENT_NO_ERROR; + long Error_Code = GEOCENT_NO_ERROR; - if (a <= 0.0) - Error_Code |= GEOCENT_A_ERROR; - if (b <= 0.0) - Error_Code |= GEOCENT_B_ERROR; - if (a < b) - Error_Code |= GEOCENT_A_LESS_B_ERROR; - if (!Error_Code) - { - gi->Geocent_a = a; - gi->Geocent_b = b; - gi->Geocent_a2 = a * a; - gi->Geocent_b2 = b * b; - gi->Geocent_e2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_a2; - gi->Geocent_ep2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_b2; - } - return (Error_Code); + if (a <= 0.0) + Error_Code |= GEOCENT_A_ERROR; + if (b <= 0.0) + Error_Code |= GEOCENT_B_ERROR; + if (a < b) + Error_Code |= GEOCENT_A_LESS_B_ERROR; + if (!Error_Code) + { + Geocent_a = a; + Geocent_b = b; + Geocent_a2 = a * a; + Geocent_b2 = b * b; + Geocent_e2 = (Geocent_a2 - Geocent_b2) / Geocent_a2; + Geocent_ep2 = (Geocent_a2 - Geocent_b2) / Geocent_b2; + } + return (Error_Code); } /* END OF Set_Geocentric_Parameters */ -void pj_Get_Geocentric_Parameters (GeocentricInfo *gi, - double *a, - double *b) +void pj_Get_Geocentric_Parameters (double *a, + double *b) { /* BEGIN Get_Geocentric_Parameters */ /* * The function Get_Geocentric_Parameters returns the ellipsoid parameters @@ -159,18 +173,17 @@ * b : Semi-minor axis, in meters. (output) */ - *a = gi->Geocent_a; - *b = gi->Geocent_b; + *a = Geocent_a; + *b = Geocent_b; } /* END OF Get_Geocentric_Parameters */ -long pj_Convert_Geodetic_To_Geocentric (GeocentricInfo *gi, - double Latitude, - double Longitude, - double Height, - double *X, - double *Y, - double *Z) +long pj_Convert_Geodetic_To_Geocentric (double Latitude, + double Longitude, + double Height, + double *X, + double *Y, + double *Z) { /* BEGIN Convert_Geodetic_To_Geocentric */ /* * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates @@ -212,10 +225,10 @@ Sin_Lat = sin(Latitude); Cos_Lat = cos(Latitude); Sin2_Lat = Sin_Lat * Sin_Lat; - Rn = gi->Geocent_a / (sqrt(1.0e0 - gi->Geocent_e2 * Sin2_Lat)); + Rn = Geocent_a / (sqrt(1.0e0 - Geocent_e2 * Sin2_Lat)); *X = (Rn + Height) * Cos_Lat * cos(Longitude); *Y = (Rn + Height) * Cos_Lat * sin(Longitude); - *Z = ((Rn * (1 - gi->Geocent_e2)) + Height) * Sin_Lat; + *Z = ((Rn * (1 - Geocent_e2)) + Height) * Sin_Lat; } return (Error_Code); @@ -236,13 +249,12 @@ #define USE_ITERATIVE_METHOD -void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi, - double X, - double Y, - double Z, - double *Latitude, - double *Longitude, - double *Height) +void pj_Convert_Geocentric_To_Geodetic (double X, + double Y, + double Z, + double *Latitude, + double *Longitude, + double *Height) { /* BEGIN Convert_Geocentric_To_Geodetic */ #if !defined(USE_ITERATIVE_METHOD) /* @@ -309,12 +321,12 @@ Sin_B0 = T0 / S0; Cos_B0 = W / S0; Sin3_B0 = Sin_B0 * Sin_B0 * Sin_B0; - T1 = Z + gi->Geocent_b * gi->Geocent_ep2 * Sin3_B0; - Sum = W - gi->Geocent_a * gi->Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0; + T1 = Z + Geocent_b * Geocent_ep2 * Sin3_B0; + Sum = W - Geocent_a * Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0; S1 = sqrt(T1*T1 + Sum * Sum); Sin_p1 = T1 / S1; Cos_p1 = Sum / S1; - Rn = gi->Geocent_a / sqrt(1.0 - gi->Geocent_e2 * Sin_p1 * Sin_p1); + Rn = Geocent_a / sqrt(1.0 - Geocent_e2 * Sin_p1 * Sin_p1); if (Cos_p1 >= COS_67P5) { *Height = W / Cos_p1 - Rn; @@ -325,7 +337,7 @@ } else { - *Height = Z / Sin_p1 + Rn * (gi->Geocent_e2 - 1.0); + *Height = Z / Sin_p1 + Rn * (Geocent_e2 - 1.0); } if (At_Pole == FALSE) { @@ -389,7 +401,7 @@ RR = sqrt(X*X+Y*Y+Z*Z); /* special cases for latitude and longitude */ - if (P/gi->Geocent_a < genau) { + if (P/Geocent_a < genau) { /* special case, if P=0. (X=0., Y=0.) */ At_Pole = TRUE; @@ -397,9 +409,9 @@ /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis * of ellipsoid (=center of mass), Latitude becomes PI/2 */ - if (RR/gi->Geocent_a < genau) { + if (RR/Geocent_a < genau) { *Latitude = PI_OVER_2; - *Height = -gi->Geocent_b; + *Height = -Geocent_b; return ; } @@ -421,8 +433,8 @@ */ CT = Z/RR; ST = P/RR; - RX = 1.0/sqrt(1.0-gi->Geocent_e2*(2.0-gi->Geocent_e2)*ST*ST); - CPHI0 = ST*(1.0-gi->Geocent_e2)*RX; + RX = 1.0/sqrt(1.0-Geocent_e2*(2.0-Geocent_e2)*ST*ST); + CPHI0 = ST*(1.0-Geocent_e2)*RX; SPHI0 = CT*RX; iter = 0; @@ -431,12 +443,12 @@ do { iter++; - RN = gi->Geocent_a/sqrt(1.0-gi->Geocent_e2*SPHI0*SPHI0); + RN = Geocent_a/sqrt(1.0-Geocent_e2*SPHI0*SPHI0); /* ellipsoidal (geodetic) height */ - *Height = P*CPHI0+Z*SPHI0-RN*(1.0-gi->Geocent_e2*SPHI0*SPHI0); + *Height = P*CPHI0+Z*SPHI0-RN*(1.0-Geocent_e2*SPHI0*SPHI0); - RK = gi->Geocent_e2*RN/(RN+*Height); + RK = Geocent_e2*RN/(RN+*Height); RX = 1.0/sqrt(1.0-RK*(2.0-RK)*ST*ST); CPHI = ST*(1.0-RK)*RX; SPHI = CT*RX; Modified: trunk/toolkits/basemap/src/geocent.h =================================================================== --- trunk/toolkits/basemap/src/geocent.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/geocent.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -92,21 +92,9 @@ extern "C" { #endif -typedef struct -{ - double Geocent_a; /* Semi-major axis of ellipsoid in meters */ - double Geocent_b; /* Semi-minor axis of ellipsoid */ - double Geocent_a2; /* Square of semi-major axis */ - double Geocent_b2; /* Square of semi-minor axis */ - double Geocent_e2; /* Eccentricity squared */ - double Geocent_ep2; /* 2nd eccentricity squared */ -} GeocentricInfo; -void pj_Init_Geocentric( GeocentricInfo *gi ); -long pj_Set_Geocentric_Parameters( GeocentricInfo *gi, - double a, - double b); - + long pj_Set_Geocentric_Parameters (double a, + double b); /* * The function Set_Geocentric_Parameters receives the ellipsoid parameters * as inputs and sets the corresponding state variables. @@ -116,10 +104,8 @@ */ -void pj_Get_Geocentric_Parameters ( GeocentricInfo *gi, - double *a, - double *b); - + void pj_Get_Geocentric_Parameters (double *a, + double *b); /* * The function Get_Geocentric_Parameters returns the ellipsoid parameters * to be used in geocentric coordinate conversions. @@ -129,13 +115,12 @@ */ -long pj_Convert_Geodetic_To_Geocentric ( GeocentricInfo *gi, - double Latitude, - double Longitude, - double Height, - double *X, - double *Y, - double *Z); + long pj_Convert_Geodetic_To_Geocentric (double Latitude, + double Longitude, + double Height, + double *X, + double *Y, + double *Z); /* * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z), @@ -151,13 +136,12 @@ */ -void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi, - double X, - double Y, - double Z, - double *Latitude, - double *Longitude, - double *Height); + void pj_Convert_Geocentric_To_Geodetic (double X, + double Y, + double Z, + double *Latitude, + double *Longitude, + double *Height); /* * The function Convert_Geocentric_To_Geodetic converts geocentric * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, Modified: trunk/toolkits/basemap/src/geod.c =================================================================== --- trunk/toolkits/basemap/src/geod.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/geod.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -2,11 +2,11 @@ static const char SCCSID[]="@(#)geod.c 4.8 95/09/23 GIE REL"; #endif /* <<<< Geodesic filter program >>>> */ +# include <ctype.h> +# include <stdio.h> # include "projects.h" # include "geodesic.h" # include "emess.h" -# include <ctype.h> -# include <stdio.h> # include <string.h> # define MAXLINE 200 Modified: trunk/toolkits/basemap/src/nad_init.c =================================================================== --- trunk/toolkits/basemap/src/nad_init.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/nad_init.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: nad_init.c,v 1.10 2007/09/11 20:16:33 fwarmerdam Exp $ + * $Id: nad_init.c,v 1.8 2003/03/17 18:56:01 warmerda Exp $ * * Project: PROJ.4 * Purpose: Load datum shift files into memory. @@ -28,12 +28,6 @@ ****************************************************************************** * * $Log: nad_init.c,v $ - * Revision 1.10 2007/09/11 20:16:33 fwarmerdam - * Improve error recovery if ctable datum shift files fails to load. - * - * Revision 1.9 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.8 2003/03/17 18:56:01 warmerda * implement delayed loading of ctable format files * @@ -59,18 +53,9 @@ #include <projects.h> #include <stdio.h> #include <errno.h> +#include <assert.h> #include <string.h> -#ifdef _WIN32_WCE -/* assert.h includes all Windows API headers and causes 'LP' name clash. - * Here assert we disable assert() for Windows CE. - * TODO - mloskot: re-implement porting friendly assert - */ -# define assert(exp) ((void)0) -#else -# include <assert.h> -#endif /* _WIN32_WCE */ - /************************************************************************/ /* nad_ctable_load() */ /* */ @@ -90,15 +75,6 @@ if( ct->cvs == NULL || fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size ) { - pj_dalloc( ct->cvs ); - ct->cvs = NULL; - - if( getenv("PROJ_DEBUG") != NULL ) - { - fprintf( stderr, - "ctable loading failed on fread() - binary incompatible?\n" ); - } - pj_errno = -38; return 0; } Modified: trunk/toolkits/basemap/src/pj_datum_set.c =================================================================== --- trunk/toolkits/basemap/src/pj_datum_set.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_datum_set.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_datum_set.c,v 1.4 2007/11/29 21:06:50 fwarmerdam Exp $ + * $Id: pj_datum_set.c,v 1.2 2001/04/04 21:13:21 warmerda Exp $ * * Project: PROJ.4 * Purpose: Apply datum definition to PJ structure from initialization string. @@ -28,12 +28,6 @@ ****************************************************************************** * * $Log: pj_datum_set.c,v $ - * Revision 1.4 2007/11/29 21:06:50 fwarmerdam - * make sure we only look for 7 parameters - * - * Revision 1.3 2007/01/31 06:41:01 fwarmerdam - * dont parse more datum parameters than we have room for in datum_params[] - * * Revision 1.2 2001/04/04 21:13:21 warmerda * do arcsecond/radian and ppm datum parm transformation in pj_set_datum() * @@ -119,7 +113,7 @@ /* parse out the parameters */ s = towgs84; - for( s = towgs84; *s != '\0' && parm_count < 7; ) + for( s = towgs84; *s != '\0'; ) { projdef->datum_params[parm_count++] = atof(s); while( *s != '\0' && *s != ',' ) Modified: trunk/toolkits/basemap/src/pj_factors.c =================================================================== --- trunk/toolkits/basemap/src/pj_factors.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_factors.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -20,16 +20,15 @@ return 1; } else { /* proceed */ errno = pj_errno = 0; - if (h < EPS) - h = DEFAULT_H; - if (fabs(lp.phi) > (HALFPI - h)) - /* adjust to value around pi/2 where derived still exists*/ - lp.phi = lp.phi < 0. ? (-HALFPI+h) : (HALFPI-h); + if (fabs(t) <= EPS) /* adjust to pi/2 */ + lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; else if (P->geoc) lp.phi = atan(P->rone_es * tan(lp.phi)); lp.lam -= P->lam0; /* compute del lp.lam */ if (!P->over) lp.lam = adjlon(lp.lam); /* adjust del longitude */ + if (h <= 0.) + h = DEFAULT_H; if (P->spc) /* get what projection analytic values */ P->spc(lp, P, fac); if (((fac->code & (IS_ANAL_XL_YL+IS_ANAL_XP_YP)) != Modified: trunk/toolkits/basemap/src/pj_gridinfo.c =================================================================== --- trunk/toolkits/basemap/src/pj_gridinfo.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_gridinfo.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_gridinfo.c,v 1.8 2006/11/17 22:16:30 mloskot Exp $ + * $Id: pj_gridinfo.c,v 1.7 2005/07/07 00:16:03 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Functions for handling individual PJ_GRIDINFO's. Includes @@ -29,9 +29,6 @@ ****************************************************************************** * * $Log: pj_gridinfo.c,v $ - * Revision 1.8 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.7 2005/07/07 00:16:03 fwarmerdam * Fixed debug fprintf syntax per: * http://bugzilla.remotesensing.org/show_bug.cgi?id=886 @@ -62,17 +59,8 @@ #include <string.h> #include <math.h> #include <errno.h> +#include <assert.h> -#ifdef _WIN32_WCE -/* assert.h includes all Windows API headers and causes 'LP' name clash. - * Here assert we disable assert() for Windows CE. - * TODO - mloskot: re-implement porting friendly assert - */ -# define assert(exp) ((void)0) -#else -# include <assert.h> -#endif /* _WIN32_WCE */ - /************************************************************************/ /* swap_words() */ /* */ Modified: trunk/toolkits/basemap/src/pj_gridlist.c =================================================================== --- trunk/toolkits/basemap/src/pj_gridlist.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_gridlist.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_gridlist.c,v 1.5 2006/11/17 22:16:30 mloskot Exp $ + * $Id: pj_gridlist.c,v 1.4 2005/11/01 05:56:13 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Code to manage the list of currently loaded (cached) PJ_GRIDINFOs @@ -29,9 +29,6 @@ ****************************************************************************** * * $Log: pj_gridlist.c,v $ - * Revision 1.5 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.4 2005/11/01 05:56:13 fwarmerdam * improved error handling if gridcount is zero * @@ -51,17 +48,8 @@ #include <projects.h> #include <string.h> #include <math.h> +#include <assert.h> -#ifdef _WIN32_WCE -/* assert.h includes all Windows API headers and causes 'LP' name clash. - * Here assert we disable assert() for Windows CE. - * TODO - mloskot: re-implement porting friendly assert - */ -# define assert(exp) ((void)0) -#else -# include <assert.h> -#endif /* _WIN32_WCE */ - static PJ_GRIDINFO *grid_list = NULL; /* used only by pj_load_nadgrids() and pj_deallocate_grids() */ Modified: trunk/toolkits/basemap/src/pj_init.c =================================================================== --- trunk/toolkits/basemap/src/pj_init.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_init.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_init.c,v 1.19 2007/11/26 00:21:59 fwarmerdam Exp $ + * $Id: pj_init.c,v 1.18 2006/10/12 21:04:39 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Initialize projection object from string definition. Includes @@ -30,15 +30,6 @@ ****************************************************************************** * * $Log: pj_init.c,v $ - * Revision 1.19 2007/11/26 00:21:59 fwarmerdam - * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before - * adjustment for spherical projections. - * Modified pj_datum_transform() to use the original ellipsoid parameters, - * not the ones adjusted for spherical projections. - * Modified pj_datum_transform() to not attempt any datum shift via - * geocentric coordinates if the source *or* destination are raw ellipsoids - * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. - * * Revision 1.18 2006/10/12 21:04:39 fwarmerdam * Added experimental +lon_wrap argument to set a "center point" for * longitude wrapping of longitude values coming out of pj_transform(). @@ -82,7 +73,7 @@ #include <string.h> #include <errno.h> -PJ_CVSID("$Id: pj_init.c,v 1.19 2007/11/26 00:21:59 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_init.c,v 1.18 2006/10/12 21:04:39 fwarmerdam Exp $"); extern FILE *pj_open_lib(char *, char *); @@ -291,9 +282,6 @@ /* set ellipsoid/sphere parameters */ if (pj_ell_set(start, &PIN->a, &PIN->es)) goto bum_call; - PIN->a_orig = PIN->a; - PIN->es_orig = PIN->es; - PIN->e = sqrt(PIN->es); PIN->ra = 1. / PIN->a; PIN->one_es = 1. - PIN->es; Modified: trunk/toolkits/basemap/src/pj_latlong.c =================================================================== --- trunk/toolkits/basemap/src/pj_latlong.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_latlong.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_latlong.c,v 1.3 2007/11/30 20:02:31 fwarmerdam Exp $ + * $Id: pj_latlong.c,v 1.2 2000/07/07 06:04:23 warmerda Exp $ * * Project: PROJ.4 * Purpose: Stub projection implementation for lat/long coordinates. We @@ -30,9 +30,6 @@ ****************************************************************************** * * $Log: pj_latlong.c,v $ - * Revision 1.3 2007/11/30 20:02:31 fwarmerdam - * add latlon and lonlat aliases - * * Revision 1.2 2000/07/07 06:04:23 warmerda * added longlat alias * @@ -44,10 +41,8 @@ /* very loosely based upon DMA code by Bradford W. Drew */ #define PJ_LIB__ #include <projects.h> -PROJ_HEAD(lonlat, "Lat/long (Geodetic)") "\n\t"; -PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") "\n\t"; -PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") "\n\t"; -PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") "\n\t"; +PROJ_HEAD(latlong, "Lat/long (Geodetic)") "\n\t"; +PROJ_HEAD(longlat, "Lat/long (Geodetic)") "\n\t"; FORWARD(forward); @@ -76,17 +71,3 @@ P->y0 = 0.0; P->inv = inverse; P->fwd = forward; ENDENTRY(P) - -ENTRY0(latlon) - P->is_latlong = 1; - P->x0 = 0.0; - P->y0 = 0.0; - P->inv = inverse; P->fwd = forward; -ENDENTRY(P) - -ENTRY0(lonlat) - P->is_latlong = 1; - P->x0 = 0.0; - P->y0 = 0.0; - P->inv = inverse; P->fwd = forward; -ENDENTRY(P) Modified: trunk/toolkits/basemap/src/pj_list.h =================================================================== --- trunk/toolkits/basemap/src/pj_list.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_list.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -55,10 +55,8 @@ PROJ_HEAD(lagrng, "Lagrange") PROJ_HEAD(larr, "Larrivee") PROJ_HEAD(lask, "Laskowski") -PROJ_HEAD(lonlat, "Lat/long (Geodetic)") -PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") -PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") -PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") +PROJ_HEAD(latlong, "Lat/long (Geodetic)") +PROJ_HEAD(longlat, "Lat/long (Geodetic)") PROJ_HEAD(lcc, "Lambert Conformal Conic") PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative") PROJ_HEAD(leac, "Lambert Equal Area Conic") @@ -73,6 +71,7 @@ PROJ_HEAD(merc, "Mercator") PROJ_HEAD(mil_os, "Miller Oblated Stereographic") PROJ_HEAD(mill, "Miller Cylindrical") +PROJ_HEAD(mpoly, "Modified Polyconic") PROJ_HEAD(moll, "Mollweide") PROJ_HEAD(murd1, "Murdoch I") PROJ_HEAD(murd2, "Murdoch II") Modified: trunk/toolkits/basemap/src/pj_open_lib.c =================================================================== --- trunk/toolkits/basemap/src/pj_open_lib.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_open_lib.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $ + * $Id: pj_open_lib.c,v 1.6 2004/09/16 15:14:01 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Implementation of pj_open_lib(), and pj_set_finder(). These @@ -31,15 +31,6 @@ ****************************************************************************** * * $Log: pj_open_lib.c,v $ - * Revision 1.9 2007/07/06 14:58:03 fwarmerdam - * improve searchpath clearning with pj_set_searchpath() - * - * Revision 1.8 2007/03/11 17:03:18 fwarmerdam - * support drive letter prefixes on win32 and related fixes (bug 1499) - * - * Revision 1.7 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.6 2004/09/16 15:14:01 fwarmerdam * * src/pj_open_lib.c: added pj_set_searchpath() provided by Eric Miller. * @@ -54,7 +45,7 @@ #include <string.h> #include <errno.h> -PJ_CVSID("$Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_open_lib.c,v 1.6 2004/09/16 15:14:01 fwarmerdam Exp $"); static const char *(*pj_finder)(const char *) = NULL; static int path_count = 0; @@ -80,8 +71,7 @@ /* pj_set_searchpath() */ /* */ /* Path control for callers that can't practically provide */ -/* pj_set_finder() style callbacks. Call with (0,NULL) as args */ -/* to clear the searchpath set. */ +/* pj_set_finder() style callbacks. */ /************************************************************************/ void pj_set_searchpath ( int count, const char **path ) @@ -99,16 +89,13 @@ search_path = NULL; } - if( count > 0 ) + search_path = pj_malloc(sizeof *search_path * count); + for (i = 0; i < count; i++) { - search_path = pj_malloc(sizeof *search_path * count); - for (i = 0; i < count; i++) - { - search_path[i] = pj_malloc(strlen(path[i]) + 1); - strcpy(search_path[i], path[i]); - } + search_path[i] = pj_malloc(strlen(path[i]) + 1); + strcpy(search_path[i], path[i]); } - + path_count = count; } @@ -123,16 +110,9 @@ FILE *fid; int n = 0; int i; -#ifdef WIN32 - static const char dir_chars[] = "/\\"; -#else - static const char dir_chars[] = "/"; -#endif -#ifndef _WIN32_WCE - /* check if ~/name */ - if (*name == '~' && strchr(dir_chars,name[1]) ) + if (*name == '~' && name[1] == DIR_CHAR) if (sysname = getenv("HOME")) { (void)strcpy(fname, sysname); fname[n = strlen(fname)] = DIR_CHAR; @@ -143,10 +123,8 @@ return NULL; /* or fixed path: /name, ./name or ../name */ - else if (strchr(dir_chars,*name) - || (*name == '.' && strchr(dir_chars,name[1])) - || (!strncmp(name, "..", 2) && strchr(dir_chars,name[2])) - || (name[1] == ':' && strchr(dir_chars,name[2])) ) + else if (*name == DIR_CHAR || (*name == '.' && name[1] == DIR_CHAR) || + (!strncmp(name, "..", 2) && name[2] == DIR_CHAR) ) sysname = name; /* or try to use application provided file finder */ @@ -185,7 +163,4 @@ fid == NULL ? "failed" : "succeeded" ); return(fid); -#else - return NULL; -#endif /* _WIN32_WCE */ } Modified: trunk/toolkits/basemap/src/pj_release.c =================================================================== --- trunk/toolkits/basemap/src/pj_release.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_release.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -2,7 +2,7 @@ #include <projects.h> -char const pj_release[]="Rel. 4.6.0, 21 Dec 2007"; +char const pj_release[]="Rel. 4.5.0, 22 Oct 2006"; const char *pj_get_release() Modified: trunk/toolkits/basemap/src/pj_transform.c =================================================================== --- trunk/toolkits/basemap/src/pj_transform.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_transform.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_transform.c,v 1.24 2007/12/03 15:48:20 fwarmerdam Exp $ + * $Id: pj_transform.c,v 1.20 2006/10/12 21:04:39 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Perform overall coordinate system to coordinate system @@ -30,24 +30,6 @@ ****************************************************************************** * * $Log: pj_transform.c,v $ - * Revision 1.24 2007/12/03 15:48:20 fwarmerdam - * Improve WGS84 ES precision to avoid unnecesary transformation (#1531) - * - * Revision 1.23 2007/11/26 00:21:59 fwarmerdam - * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before - * adjustment for spherical projections. - * Modified pj_datum_transform() to use the original ellipsoid parameters, - * not the ones adjusted for spherical projections. - * Modified pj_datum_transform() to not attempt any datum shift via - * geocentric coordinates if the source *or* destination are raw ellipsoids - * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. - * - * Revision 1.22 2007/09/11 20:32:25 fwarmerdam - * mark the transient error array const - * - * Revision 1.21 2007/09/11 20:19:36 fwarmerdam - * avoid use of static variables to make reentrant - * * Revision 1.20 2006/10/12 21:04:39 fwarmerdam * Added experimental +lon_wrap argument to set a "center point" for * longitude wrapping of longitude values coming out of pj_transform(). @@ -128,14 +110,14 @@ #include <math.h> #include "geocent.h" -PJ_CVSID("$Id: pj_transform.c,v 1.24 2007/12/03 15:48:20 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_transform.c,v 1.20 2006/10/12 21:04:39 fwarmerdam Exp $"); #ifndef SRS_WGS84_SEMIMAJOR #define SRS_WGS84_SEMIMAJOR 6378137.0 #endif #ifndef SRS_WGS84_ESQUARED -#define SRS_WGS84_ESQUARED 0.0066943799901413165 +#define SRS_WGS84_ESQUARED 0.006694379990 #endif #define Dx_BF (defn->datum_params[0]) @@ -157,7 +139,7 @@ ** list or something, but while experimenting with it this should be fine. */ -static const int transient_error[45] = { +static int transient_error[45] = { /* 0 1 2 3 4 5 6 7 8 9 */ /* 0 to 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 to 19 */ 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, @@ -209,7 +191,7 @@ } } - if( pj_geocentric_to_geodetic( srcdefn->a_orig, srcdefn->es_orig, + if( pj_geocentric_to_geodetic( srcdefn->a, srcdefn->es, point_count, point_offset, x, y, z ) != 0) return pj_errno; @@ -306,7 +288,7 @@ return PJD_ERR_GEOCENTRIC; } - pj_geodetic_to_geocentric( dstdefn->a_orig, dstdefn->es_orig, + pj_geodetic_to_geocentric( dstdefn->a, dstdefn->es, point_count, point_offset, x, y, z ); if( dstdefn->fr_meter != 1.0 ) @@ -390,7 +372,6 @@ { double b; int i; - GeocentricInfo gi; pj_errno = 0; @@ -399,7 +380,7 @@ else b = a * sqrt(1-es); - if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 ) + if( pj_Set_Geocentric_Parameters( a, b ) != 0 ) { pj_errno = PJD_ERR_GEOCENTRIC; return pj_errno; @@ -412,7 +393,7 @@ if( x[io] == HUGE_VAL ) continue; - if( pj_Convert_Geodetic_To_Geocentric( &gi, y[io], x[io], z[io], + if( pj_Convert_Geodetic_To_Geocentric( y[io], x[io], z[io], x+io, y+io, z+io ) != 0 ) { pj_errno = -14; @@ -435,14 +416,13 @@ { double b; int i; - GeocentricInfo gi; if( es == 0.0 ) b = a; else b = a * sqrt(1-es); - if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 ) + if( pj_Set_Geocentric_Parameters( a, b ) != 0 ) { pj_errno = PJD_ERR_GEOCENTRIC; return pj_errno; @@ -455,8 +435,8 @@ if( x[io] == HUGE_VAL ) continue; - pj_Convert_Geocentric_To_Geodetic( &gi, x[io], y[io], z[io], - y+io, x+io, z+io ); + pj_Convert_Geocentric_To_Geodetic( x[io], y[io], z[io], + y+io, x+io, z+io ); } return 0; @@ -476,8 +456,8 @@ { return 0; } - else if( srcdefn->a_orig != dstdefn->a_orig - || ABS(srcdefn->es_orig - dstdefn->es_orig) > 0.000000000050 ) + else if( srcdefn->a != dstdefn->a + || ABS(srcdefn->es - dstdefn->es) > 0.000000000050 ) { /* the tolerence for es is to ensure that GRS80 and WGS84 are considered identical */ @@ -610,10 +590,6 @@ /************************************************************************/ /* pj_datum_transform() */ -/* */ -/* The input should be long/lat/z coordinates in radians in the */ -/* source datum, and the output should be long/lat/z */ -/* coordinates in radians in the destination datum. */ /************************************************************************/ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, @@ -627,26 +603,16 @@ pj_errno = 0; /* -------------------------------------------------------------------- */ -/* We cannot do any meaningful datum transformation if either */ -/* the source or destination are of an unknown datum type */ -/* (ie. only a +ellps declaration, no +datum). This is new */ -/* behavior for PROJ 4.6.0. */ -/* -------------------------------------------------------------------- */ - if( srcdefn->datum_type == PJD_UNKNOWN - || dstdefn->datum_type == PJD_UNKNOWN ) - return 0; - -/* -------------------------------------------------------------------- */ /* Short cut if the datums are identical. */ /* -------------------------------------------------------------------- */ if( pj_compare_datums( srcdefn, dstdefn ) ) return 0; - src_a = srcdefn->a_orig; - src_es = srcdefn->es_orig; + src_a = srcdefn->a; + src_es = srcdefn->es; - dst_a = dstdefn->a_orig; - dst_es = dstdefn->es_orig; + dst_a = dstdefn->a; + dst_es = dstdefn->es; /* -------------------------------------------------------------------- */ /* Create a temporary Z array if one is not provided. */ Modified: trunk/toolkits/basemap/src/pj_utils.c =================================================================== --- trunk/toolkits/basemap/src/pj_utils.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/pj_utils.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_utils.c,v 1.5 2007/03/12 14:05:35 fwarmerdam Exp $ + * $Id: pj_utils.c,v 1.4 2005/07/06 14:04:09 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Some utility functions we don't want to bother putting in @@ -29,9 +29,6 @@ ****************************************************************************** * * $Log: pj_utils.c,v $ - * Revision 1.5 2007/03/12 14:05:35 fwarmerdam - * Removed duplicate towgs84 definition code. - * * Revision 1.4 2005/07/06 14:04:09 fwarmerdam * Improved precision of es encoding for pj_latlong_from_proj() per: * http://bugzilla.remotesensing.org/show_bug.cgi?id=881 @@ -138,6 +135,10 @@ sprintf( defn+strlen(defn), " +towgs84=%s", pj_param(pj_in->params,"stowgs84").s ); + if( pj_param(pj_in->params, "ttowgs84").i ) + sprintf( defn+strlen(defn), " +towgs84=%s", + pj_param(pj_in->params,"stowgs84").s ); + if( pj_param(pj_in->params, "tnadgrids").i ) sprintf( defn+strlen(defn), " +nadgrids=%s", pj_param(pj_in->params,"snadgrids").s ); Modified: trunk/toolkits/basemap/src/proj_api.h =================================================================== --- trunk/toolkits/basemap/src/proj_api.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/proj_api.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -28,12 +28,6 @@ ****************************************************************************** * * $Log: proj_api.h,v $ - * Revision 1.16 2007/11/29 21:07:49 fwarmerdam - * prepare for 4.6.0 release - * - * Revision 1.15 2007/08/20 13:40:06 fwarmerdam - * avoid warnings in c++ for some prototypes - * * Revision 1.14 2006/04/20 04:19:59 fwarmerdam * updated version * @@ -92,7 +86,7 @@ #endif /* Try to update this every version! */ -#define PJ_VERSION 460 +#define PJ_VERSION 450 extern char const pj_release[]; /* global release id string */ @@ -132,7 +126,7 @@ int pj_apply_gridshift( const char *, int, long point_count, int point_offset, double *x, double *y, double *z ); -void pj_deallocate_grids(void); +void pj_deallocate_grids(); int pj_is_latlong(projPJ); int pj_is_geocent(projPJ); void pj_pr_list(projPJ); @@ -146,8 +140,8 @@ void *pj_malloc(size_t); void pj_dalloc(void *); char *pj_strerrno(int); -int *pj_get_errno_ref(void); -const char *pj_get_release(void); +int *pj_get_errno_ref(); +const char *pj_get_release(); #ifdef __cplusplus } Modified: trunk/toolkits/basemap/src/projects.h =================================================================== --- trunk/toolkits/basemap/src/projects.h 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/projects.h 2007-12-28 20:04:31 UTC (rev 4795) @@ -28,21 +28,6 @@ ****************************************************************************** * * $Log: projects.h,v $ - * Revision 1.27 2007/11/26 00:21:59 fwarmerdam - * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before - * adjustment for spherical projections. - * Modified pj_datum_transform() to use the original ellipsoid parameters, - * not the ones adjusted for spherical projections. - * Modified pj_datum_transform() to not attempt any datum shift via - * geocentric coordinates if the source *or* destination are raw ellipsoids - * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. - * - * Revision 1.26 2007/03/11 17:03:18 fwarmerdam - * support drive letter prefixes on win32 and related fixes (bug 1499) - * - * Revision 1.25 2006/11/17 22:16:30 mloskot - * Uploaded PROJ.4 port for Windows CE. - * * Revision 1.24 2006/10/18 04:34:03 fwarmerdam * added mlist functions from libproj4 * @@ -164,15 +149,6 @@ extern double hypot(double, double); #endif -#ifdef _WIN32_WCE -# include <wce_stdlib.h> -# include <wce_stdio.h> -# define rewind wceex_rewind -# define getenv wceex_getenv -# define strdup _strdup -# define hypot _hypot -#endif - /* some useful constants */ #define HALFPI 1.5707963267948966 #define FORTPI 0.78539816339744833 @@ -188,17 +164,8 @@ #define ID_TAG_MAX 50 #endif -/* Use WIN32 as a standard windows 32 bit declaration */ -#if defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE) -# define WIN32 -#endif - -#if defined(_WINDOWS) && !defined(WIN32) && !defined(_WIN32_WCE) -# define WIN32 -#endif - /* directory delimiter for DOS support */ -#ifdef WIN32 +#ifdef DOS #define DIR_CHAR '\\' #else #define DIR_CHAR '/' @@ -298,10 +265,8 @@ int is_geocent; /* proj=geocent ... not really a projection at all */ double a, /* major axis or radius if es==0 */ - a_orig, /* major axis before any +proj related adjustment */ - es, /* e ^ 2 */ - es_orig, /* es before any +proj related adjustment */ e, /* eccentricity */ + es, /* e ^ 2 */ ra, /* 1/A */ one_es, /* 1 - e^2 */ rone_es, /* 1/one_es */ @@ -309,7 +274,7 @@ x0, y0, /* easting and northing */ k0, /* general scaling factor */ to_meter, fr_meter; /* cartesian scaling */ - + int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ double datum_params[7]; double from_greenwich; /* prime meridian offset (in radians) */ Modified: trunk/toolkits/basemap/src/rtodms.c =================================================================== --- trunk/toolkits/basemap/src/rtodms.c 2007-12-28 19:44:55 UTC (rev 4794) +++ trunk/toolkits/basemap/src/rtodms.c 2007-12-28 20:04:31 UTC (rev 4795) @@ -53,9 +53,7 @@ sec = fmod(r / RES, 60.); r = floor(r / RES60); min = fmod(r, 60.); - r = floor(r / 60.); - deg = r; - + deg = r / 60.; if (dolong) (void)sprintf(ss,format,deg,min,sec,sign); else if (sec) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-12-28 19:45:03
|
Revision: 4794 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4794&view=rev Author: jswhit Date: 2007-12-28 11:44:55 -0800 (Fri, 28 Dec 2007) Log Message: ----------- update proj4 sources to version 4.6.0 Modified Paths: -------------- trunk/toolkits/basemap/src/PJ_gn_sinu.c trunk/toolkits/basemap/src/PJ_krovak.c trunk/toolkits/basemap/src/PJ_laea.c trunk/toolkits/basemap/src/PJ_wag3.c trunk/toolkits/basemap/src/emess.c trunk/toolkits/basemap/src/geocent.c trunk/toolkits/basemap/src/geocent.h trunk/toolkits/basemap/src/geod.c trunk/toolkits/basemap/src/nad_init.c trunk/toolkits/basemap/src/pj_datum_set.c trunk/toolkits/basemap/src/pj_factors.c trunk/toolkits/basemap/src/pj_gridinfo.c trunk/toolkits/basemap/src/pj_gridlist.c trunk/toolkits/basemap/src/pj_init.c trunk/toolkits/basemap/src/pj_latlong.c trunk/toolkits/basemap/src/pj_list.h trunk/toolkits/basemap/src/pj_open_lib.c trunk/toolkits/basemap/src/pj_release.c trunk/toolkits/basemap/src/pj_transform.c trunk/toolkits/basemap/src/pj_utils.c trunk/toolkits/basemap/src/proj_api.h trunk/toolkits/basemap/src/projects.h trunk/toolkits/basemap/src/rtodms.c Modified: trunk/toolkits/basemap/src/PJ_gn_sinu.c =================================================================== --- trunk/toolkits/basemap/src/PJ_gn_sinu.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/PJ_gn_sinu.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -75,7 +75,6 @@ if (!(P->en = pj_enfn(P->es))) E_ERROR_0; if (P->es) { - P->en = pj_enfn(P->es); P->inv = e_inverse; P->fwd = e_forward; } else { Modified: trunk/toolkits/basemap/src/PJ_krovak.c =================================================================== --- trunk/toolkits/basemap/src/PJ_krovak.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/PJ_krovak.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: PJ_krovak.c,v 1.6 2006/09/14 13:10:50 fwarmerdam Exp $ + * $Id: PJ_krovak.c,v 1.9 2007/03/07 17:32:32 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Implementation of the krovak (Krovak) projection. @@ -30,6 +30,15 @@ ****************************************************************************** * * $Log: PJ_krovak.c,v $ + * Revision 1.9 2007/03/07 17:32:32 fwarmerdam + * remove orphan semicolon. + * + * Revision 1.8 2007/03/07 17:28:08 fwarmerdam + * Make it reasonably clear that this is ellipsoidal in the code. + * + * Revision 1.7 2007/03/07 17:25:34 fwarmerdam + * report krovak as ellipsoidal, not spherical + * * Revision 1.6 2006/09/14 13:10:50 fwarmerdam * Add +czech flag to control reversal of signs (bug 1133,147) * @@ -55,9 +64,9 @@ #include <string.h> #include <stdio.h> -PJ_CVSID("$Id: PJ_krovak.c,v 1.6 2006/09/14 13:10:50 fwarmerdam Exp $"); +PJ_CVSID("$Id: PJ_krovak.c,v 1.9 2007/03/07 17:32:32 fwarmerdam Exp $"); -PROJ_HEAD(krovak, "Krovak") "\n\tPCyl., Sph."; +PROJ_HEAD(krovak, "Krovak") "\n\tPCyl., Ellps."; /** NOTES: According to EPSG the full Krovak projection method should have @@ -84,7 +93,7 @@ -FORWARD(s_forward); /* spheroid */ +FORWARD(e_forward); /* ellipsoid */ /* calculate xy from lat/lon */ char errmess[255]; @@ -153,7 +162,7 @@ -INVERSE(s_inverse); /* spheroid */ +INVERSE(e_inverse); /* ellipsoid */ /* calculate lat/lon from xy */ /* Constants, identisch wie in der Umkehrfunktion */ @@ -258,15 +267,14 @@ /* as input and output, instead of lat/long relative to Ferro */ if (!pj_param(P->params, "tlon_0").i) P->lam0 = 0.7417649320975901 - 0.308341501185665; -; /* if scale not set default to 0.9999 */ if (!pj_param(P->params, "tk").i) P->k0 = 0.9999; /* always the same */ - P->inv = s_inverse; - P->fwd = s_forward; + P->inv = e_inverse; + P->fwd = e_forward; ENDENTRY(P) Modified: trunk/toolkits/basemap/src/PJ_laea.c =================================================================== --- trunk/toolkits/basemap/src/PJ_laea.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/PJ_laea.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -179,8 +179,14 @@ 0. : atan2(xy.x, xy.y); return (lp); } -FREEUP; if (P) pj_dalloc(P); } -ENTRY0(laea) +FREEUP; + if (P) { + if (P->apa) + pj_dalloc(P->apa); + pj_dalloc(P); + } +} +ENTRY1(laea,apa) double t; if (fabs((t = fabs(P->phi0)) - HALFPI) < EPS10) Modified: trunk/toolkits/basemap/src/PJ_wag3.c =================================================================== --- trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/PJ_wag3.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -5,7 +5,7 @@ double C_x; #define PJ_LIB__ # include <projects.h> -PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph."; +PROJ_HEAD(wag3, "Wagner III") "\n\tPCyl., Sph.\n\tlat_ts="; #define TWOTHIRD 0.6666666666666666666667 FORWARD(s_forward); /* spheroid */ xy.x = P->C_x * lp.lam * cos(TWOTHIRD * lp.phi); Modified: trunk/toolkits/basemap/src/emess.c =================================================================== --- trunk/toolkits/basemap/src/emess.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/emess.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -3,6 +3,15 @@ static const char SCCSID[]="@(#)emess.c 4.6 94/05/24 GIE REL"; #endif +#ifdef _MSC_VER +# ifndef _CRT_SECURE_NO_DEPRECATE +# define _CRT_SECURE_NO_DEPRECATE +# endif +# ifndef _CRT_NONSTDC_NO_DEPRECATE +# define _CRT_NONSTDC_NO_DEPRECATE +# endif +#endif + #include <stdio.h> #include <stdlib.h> #include <stdarg.h> Modified: trunk/toolkits/basemap/src/geocent.c =================================================================== --- trunk/toolkits/basemap/src/geocent.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/geocent.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -65,6 +65,9 @@ * 25-02-97 Original Code * * $Log: geocent.c,v $ + * Revision 1.7 2007/09/11 20:19:36 fwarmerdam + * avoid use of static variables to make reentrant + * * Revision 1.6 2006/01/12 22:29:01 fwarmerdam * make geocent.c globals static to avoid conflicts * @@ -109,29 +112,11 @@ /***************************************************************************/ /* - * GLOBAL DECLARATIONS - */ -/* Ellipsoid parameters, default to WGS 84 */ -static double Geocent_a = 6378137.0; /* Semi-major axis of ellipsoid in meters */ -static double Geocent_b = 6356752.3142; /* Semi-minor axis of ellipsoid */ - -static double Geocent_a2 = 40680631590769.0; /* Square of semi-major axis */ -static double Geocent_b2 = 40408299984087.05; /* Square of semi-minor axis */ -static double Geocent_e2 = 0.0066943799901413800; /* Eccentricity squared */ -static double Geocent_ep2 = 0.00673949675658690300; /* 2nd eccentricity squared */ -/* - * These state variables are for optimization purposes. The only function - * that should modify them is Set_Geocentric_Parameters. - */ - - -/***************************************************************************/ -/* * FUNCTIONS */ -long pj_Set_Geocentric_Parameters (double a, double b) +long pj_Set_Geocentric_Parameters (GeocentricInfo *gi, double a, double b) { /* BEGIN Set_Geocentric_Parameters */ /* @@ -141,29 +126,30 @@ * a : Semi-major axis, in meters. (input) * b : Semi-minor axis, in meters. (input) */ - long Error_Code = GEOCENT_NO_ERROR; + long Error_Code = GEOCENT_NO_ERROR; - if (a <= 0.0) - Error_Code |= GEOCENT_A_ERROR; - if (b <= 0.0) - Error_Code |= GEOCENT_B_ERROR; - if (a < b) - Error_Code |= GEOCENT_A_LESS_B_ERROR; - if (!Error_Code) - { - Geocent_a = a; - Geocent_b = b; - Geocent_a2 = a * a; - Geocent_b2 = b * b; - Geocent_e2 = (Geocent_a2 - Geocent_b2) / Geocent_a2; - Geocent_ep2 = (Geocent_a2 - Geocent_b2) / Geocent_b2; - } - return (Error_Code); + if (a <= 0.0) + Error_Code |= GEOCENT_A_ERROR; + if (b <= 0.0) + Error_Code |= GEOCENT_B_ERROR; + if (a < b) + Error_Code |= GEOCENT_A_LESS_B_ERROR; + if (!Error_Code) + { + gi->Geocent_a = a; + gi->Geocent_b = b; + gi->Geocent_a2 = a * a; + gi->Geocent_b2 = b * b; + gi->Geocent_e2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_a2; + gi->Geocent_ep2 = (gi->Geocent_a2 - gi->Geocent_b2) / gi->Geocent_b2; + } + return (Error_Code); } /* END OF Set_Geocentric_Parameters */ -void pj_Get_Geocentric_Parameters (double *a, - double *b) +void pj_Get_Geocentric_Parameters (GeocentricInfo *gi, + double *a, + double *b) { /* BEGIN Get_Geocentric_Parameters */ /* * The function Get_Geocentric_Parameters returns the ellipsoid parameters @@ -173,17 +159,18 @@ * b : Semi-minor axis, in meters. (output) */ - *a = Geocent_a; - *b = Geocent_b; + *a = gi->Geocent_a; + *b = gi->Geocent_b; } /* END OF Get_Geocentric_Parameters */ -long pj_Convert_Geodetic_To_Geocentric (double Latitude, - double Longitude, - double Height, - double *X, - double *Y, - double *Z) +long pj_Convert_Geodetic_To_Geocentric (GeocentricInfo *gi, + double Latitude, + double Longitude, + double Height, + double *X, + double *Y, + double *Z) { /* BEGIN Convert_Geodetic_To_Geocentric */ /* * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates @@ -225,10 +212,10 @@ Sin_Lat = sin(Latitude); Cos_Lat = cos(Latitude); Sin2_Lat = Sin_Lat * Sin_Lat; - Rn = Geocent_a / (sqrt(1.0e0 - Geocent_e2 * Sin2_Lat)); + Rn = gi->Geocent_a / (sqrt(1.0e0 - gi->Geocent_e2 * Sin2_Lat)); *X = (Rn + Height) * Cos_Lat * cos(Longitude); *Y = (Rn + Height) * Cos_Lat * sin(Longitude); - *Z = ((Rn * (1 - Geocent_e2)) + Height) * Sin_Lat; + *Z = ((Rn * (1 - gi->Geocent_e2)) + Height) * Sin_Lat; } return (Error_Code); @@ -249,12 +236,13 @@ #define USE_ITERATIVE_METHOD -void pj_Convert_Geocentric_To_Geodetic (double X, - double Y, - double Z, - double *Latitude, - double *Longitude, - double *Height) +void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi, + double X, + double Y, + double Z, + double *Latitude, + double *Longitude, + double *Height) { /* BEGIN Convert_Geocentric_To_Geodetic */ #if !defined(USE_ITERATIVE_METHOD) /* @@ -321,12 +309,12 @@ Sin_B0 = T0 / S0; Cos_B0 = W / S0; Sin3_B0 = Sin_B0 * Sin_B0 * Sin_B0; - T1 = Z + Geocent_b * Geocent_ep2 * Sin3_B0; - Sum = W - Geocent_a * Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0; + T1 = Z + gi->Geocent_b * gi->Geocent_ep2 * Sin3_B0; + Sum = W - gi->Geocent_a * gi->Geocent_e2 * Cos_B0 * Cos_B0 * Cos_B0; S1 = sqrt(T1*T1 + Sum * Sum); Sin_p1 = T1 / S1; Cos_p1 = Sum / S1; - Rn = Geocent_a / sqrt(1.0 - Geocent_e2 * Sin_p1 * Sin_p1); + Rn = gi->Geocent_a / sqrt(1.0 - gi->Geocent_e2 * Sin_p1 * Sin_p1); if (Cos_p1 >= COS_67P5) { *Height = W / Cos_p1 - Rn; @@ -337,7 +325,7 @@ } else { - *Height = Z / Sin_p1 + Rn * (Geocent_e2 - 1.0); + *Height = Z / Sin_p1 + Rn * (gi->Geocent_e2 - 1.0); } if (At_Pole == FALSE) { @@ -401,7 +389,7 @@ RR = sqrt(X*X+Y*Y+Z*Z); /* special cases for latitude and longitude */ - if (P/Geocent_a < genau) { + if (P/gi->Geocent_a < genau) { /* special case, if P=0. (X=0., Y=0.) */ At_Pole = TRUE; @@ -409,9 +397,9 @@ /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis * of ellipsoid (=center of mass), Latitude becomes PI/2 */ - if (RR/Geocent_a < genau) { + if (RR/gi->Geocent_a < genau) { *Latitude = PI_OVER_2; - *Height = -Geocent_b; + *Height = -gi->Geocent_b; return ; } @@ -433,8 +421,8 @@ */ CT = Z/RR; ST = P/RR; - RX = 1.0/sqrt(1.0-Geocent_e2*(2.0-Geocent_e2)*ST*ST); - CPHI0 = ST*(1.0-Geocent_e2)*RX; + RX = 1.0/sqrt(1.0-gi->Geocent_e2*(2.0-gi->Geocent_e2)*ST*ST); + CPHI0 = ST*(1.0-gi->Geocent_e2)*RX; SPHI0 = CT*RX; iter = 0; @@ -443,12 +431,12 @@ do { iter++; - RN = Geocent_a/sqrt(1.0-Geocent_e2*SPHI0*SPHI0); + RN = gi->Geocent_a/sqrt(1.0-gi->Geocent_e2*SPHI0*SPHI0); /* ellipsoidal (geodetic) height */ - *Height = P*CPHI0+Z*SPHI0-RN*(1.0-Geocent_e2*SPHI0*SPHI0); + *Height = P*CPHI0+Z*SPHI0-RN*(1.0-gi->Geocent_e2*SPHI0*SPHI0); - RK = Geocent_e2*RN/(RN+*Height); + RK = gi->Geocent_e2*RN/(RN+*Height); RX = 1.0/sqrt(1.0-RK*(2.0-RK)*ST*ST); CPHI = ST*(1.0-RK)*RX; SPHI = CT*RX; Modified: trunk/toolkits/basemap/src/geocent.h =================================================================== --- trunk/toolkits/basemap/src/geocent.h 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/geocent.h 2007-12-28 19:44:55 UTC (rev 4794) @@ -92,9 +92,21 @@ extern "C" { #endif +typedef struct +{ + double Geocent_a; /* Semi-major axis of ellipsoid in meters */ + double Geocent_b; /* Semi-minor axis of ellipsoid */ + double Geocent_a2; /* Square of semi-major axis */ + double Geocent_b2; /* Square of semi-minor axis */ + double Geocent_e2; /* Eccentricity squared */ + double Geocent_ep2; /* 2nd eccentricity squared */ +} GeocentricInfo; - long pj_Set_Geocentric_Parameters (double a, - double b); +void pj_Init_Geocentric( GeocentricInfo *gi ); +long pj_Set_Geocentric_Parameters( GeocentricInfo *gi, + double a, + double b); + /* * The function Set_Geocentric_Parameters receives the ellipsoid parameters * as inputs and sets the corresponding state variables. @@ -104,8 +116,10 @@ */ - void pj_Get_Geocentric_Parameters (double *a, - double *b); +void pj_Get_Geocentric_Parameters ( GeocentricInfo *gi, + double *a, + double *b); + /* * The function Get_Geocentric_Parameters returns the ellipsoid parameters * to be used in geocentric coordinate conversions. @@ -115,12 +129,13 @@ */ - long pj_Convert_Geodetic_To_Geocentric (double Latitude, - double Longitude, - double Height, - double *X, - double *Y, - double *Z); +long pj_Convert_Geodetic_To_Geocentric ( GeocentricInfo *gi, + double Latitude, + double Longitude, + double Height, + double *X, + double *Y, + double *Z); /* * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z), @@ -136,12 +151,13 @@ */ - void pj_Convert_Geocentric_To_Geodetic (double X, - double Y, - double Z, - double *Latitude, - double *Longitude, - double *Height); +void pj_Convert_Geocentric_To_Geodetic (GeocentricInfo *gi, + double X, + double Y, + double Z, + double *Latitude, + double *Longitude, + double *Height); /* * The function Convert_Geocentric_To_Geodetic converts geocentric * coordinates (X, Y, Z) to geodetic coordinates (latitude, longitude, Modified: trunk/toolkits/basemap/src/geod.c =================================================================== --- trunk/toolkits/basemap/src/geod.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/geod.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -2,11 +2,11 @@ static const char SCCSID[]="@(#)geod.c 4.8 95/09/23 GIE REL"; #endif /* <<<< Geodesic filter program >>>> */ -# include <ctype.h> -# include <stdio.h> # include "projects.h" # include "geodesic.h" # include "emess.h" +# include <ctype.h> +# include <stdio.h> # include <string.h> # define MAXLINE 200 Modified: trunk/toolkits/basemap/src/nad_init.c =================================================================== --- trunk/toolkits/basemap/src/nad_init.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/nad_init.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: nad_init.c,v 1.8 2003/03/17 18:56:01 warmerda Exp $ + * $Id: nad_init.c,v 1.10 2007/09/11 20:16:33 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Load datum shift files into memory. @@ -28,6 +28,12 @@ ****************************************************************************** * * $Log: nad_init.c,v $ + * Revision 1.10 2007/09/11 20:16:33 fwarmerdam + * Improve error recovery if ctable datum shift files fails to load. + * + * Revision 1.9 2006/11/17 22:16:30 mloskot + * Uploaded PROJ.4 port for Windows CE. + * * Revision 1.8 2003/03/17 18:56:01 warmerda * implement delayed loading of ctable format files * @@ -53,9 +59,18 @@ #include <projects.h> #include <stdio.h> #include <errno.h> -#include <assert.h> #include <string.h> +#ifdef _WIN32_WCE +/* assert.h includes all Windows API headers and causes 'LP' name clash. + * Here assert we disable assert() for Windows CE. + * TODO - mloskot: re-implement porting friendly assert + */ +# define assert(exp) ((void)0) +#else +# include <assert.h> +#endif /* _WIN32_WCE */ + /************************************************************************/ /* nad_ctable_load() */ /* */ @@ -75,6 +90,15 @@ if( ct->cvs == NULL || fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size ) { + pj_dalloc( ct->cvs ); + ct->cvs = NULL; + + if( getenv("PROJ_DEBUG") != NULL ) + { + fprintf( stderr, + "ctable loading failed on fread() - binary incompatible?\n" ); + } + pj_errno = -38; return 0; } Modified: trunk/toolkits/basemap/src/pj_datum_set.c =================================================================== --- trunk/toolkits/basemap/src/pj_datum_set.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_datum_set.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_datum_set.c,v 1.2 2001/04/04 21:13:21 warmerda Exp $ + * $Id: pj_datum_set.c,v 1.4 2007/11/29 21:06:50 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Apply datum definition to PJ structure from initialization string. @@ -28,6 +28,12 @@ ****************************************************************************** * * $Log: pj_datum_set.c,v $ + * Revision 1.4 2007/11/29 21:06:50 fwarmerdam + * make sure we only look for 7 parameters + * + * Revision 1.3 2007/01/31 06:41:01 fwarmerdam + * dont parse more datum parameters than we have room for in datum_params[] + * * Revision 1.2 2001/04/04 21:13:21 warmerda * do arcsecond/radian and ppm datum parm transformation in pj_set_datum() * @@ -113,7 +119,7 @@ /* parse out the parameters */ s = towgs84; - for( s = towgs84; *s != '\0'; ) + for( s = towgs84; *s != '\0' && parm_count < 7; ) { projdef->datum_params[parm_count++] = atof(s); while( *s != '\0' && *s != ',' ) Modified: trunk/toolkits/basemap/src/pj_factors.c =================================================================== --- trunk/toolkits/basemap/src/pj_factors.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_factors.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -20,15 +20,16 @@ return 1; } else { /* proceed */ errno = pj_errno = 0; - if (fabs(t) <= EPS) /* adjust to pi/2 */ - lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; + if (h < EPS) + h = DEFAULT_H; + if (fabs(lp.phi) > (HALFPI - h)) + /* adjust to value around pi/2 where derived still exists*/ + lp.phi = lp.phi < 0. ? (-HALFPI+h) : (HALFPI-h); else if (P->geoc) lp.phi = atan(P->rone_es * tan(lp.phi)); lp.lam -= P->lam0; /* compute del lp.lam */ if (!P->over) lp.lam = adjlon(lp.lam); /* adjust del longitude */ - if (h <= 0.) - h = DEFAULT_H; if (P->spc) /* get what projection analytic values */ P->spc(lp, P, fac); if (((fac->code & (IS_ANAL_XL_YL+IS_ANAL_XP_YP)) != Modified: trunk/toolkits/basemap/src/pj_gridinfo.c =================================================================== --- trunk/toolkits/basemap/src/pj_gridinfo.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_gridinfo.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_gridinfo.c,v 1.7 2005/07/07 00:16:03 fwarmerdam Exp $ + * $Id: pj_gridinfo.c,v 1.8 2006/11/17 22:16:30 mloskot Exp $ * * Project: PROJ.4 * Purpose: Functions for handling individual PJ_GRIDINFO's. Includes @@ -29,6 +29,9 @@ ****************************************************************************** * * $Log: pj_gridinfo.c,v $ + * Revision 1.8 2006/11/17 22:16:30 mloskot + * Uploaded PROJ.4 port for Windows CE. + * * Revision 1.7 2005/07/07 00:16:03 fwarmerdam * Fixed debug fprintf syntax per: * http://bugzilla.remotesensing.org/show_bug.cgi?id=886 @@ -59,8 +62,17 @@ #include <string.h> #include <math.h> #include <errno.h> -#include <assert.h> +#ifdef _WIN32_WCE +/* assert.h includes all Windows API headers and causes 'LP' name clash. + * Here assert we disable assert() for Windows CE. + * TODO - mloskot: re-implement porting friendly assert + */ +# define assert(exp) ((void)0) +#else +# include <assert.h> +#endif /* _WIN32_WCE */ + /************************************************************************/ /* swap_words() */ /* */ Modified: trunk/toolkits/basemap/src/pj_gridlist.c =================================================================== --- trunk/toolkits/basemap/src/pj_gridlist.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_gridlist.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_gridlist.c,v 1.4 2005/11/01 05:56:13 fwarmerdam Exp $ + * $Id: pj_gridlist.c,v 1.5 2006/11/17 22:16:30 mloskot Exp $ * * Project: PROJ.4 * Purpose: Code to manage the list of currently loaded (cached) PJ_GRIDINFOs @@ -29,6 +29,9 @@ ****************************************************************************** * * $Log: pj_gridlist.c,v $ + * Revision 1.5 2006/11/17 22:16:30 mloskot + * Uploaded PROJ.4 port for Windows CE. + * * Revision 1.4 2005/11/01 05:56:13 fwarmerdam * improved error handling if gridcount is zero * @@ -48,8 +51,17 @@ #include <projects.h> #include <string.h> #include <math.h> -#include <assert.h> +#ifdef _WIN32_WCE +/* assert.h includes all Windows API headers and causes 'LP' name clash. + * Here assert we disable assert() for Windows CE. + * TODO - mloskot: re-implement porting friendly assert + */ +# define assert(exp) ((void)0) +#else +# include <assert.h> +#endif /* _WIN32_WCE */ + static PJ_GRIDINFO *grid_list = NULL; /* used only by pj_load_nadgrids() and pj_deallocate_grids() */ Modified: trunk/toolkits/basemap/src/pj_init.c =================================================================== --- trunk/toolkits/basemap/src/pj_init.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_init.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_init.c,v 1.18 2006/10/12 21:04:39 fwarmerdam Exp $ + * $Id: pj_init.c,v 1.19 2007/11/26 00:21:59 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Initialize projection object from string definition. Includes @@ -30,6 +30,15 @@ ****************************************************************************** * * $Log: pj_init.c,v $ + * Revision 1.19 2007/11/26 00:21:59 fwarmerdam + * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before + * adjustment for spherical projections. + * Modified pj_datum_transform() to use the original ellipsoid parameters, + * not the ones adjusted for spherical projections. + * Modified pj_datum_transform() to not attempt any datum shift via + * geocentric coordinates if the source *or* destination are raw ellipsoids + * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. + * * Revision 1.18 2006/10/12 21:04:39 fwarmerdam * Added experimental +lon_wrap argument to set a "center point" for * longitude wrapping of longitude values coming out of pj_transform(). @@ -73,7 +82,7 @@ #include <string.h> #include <errno.h> -PJ_CVSID("$Id: pj_init.c,v 1.18 2006/10/12 21:04:39 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_init.c,v 1.19 2007/11/26 00:21:59 fwarmerdam Exp $"); extern FILE *pj_open_lib(char *, char *); @@ -282,6 +291,9 @@ /* set ellipsoid/sphere parameters */ if (pj_ell_set(start, &PIN->a, &PIN->es)) goto bum_call; + PIN->a_orig = PIN->a; + PIN->es_orig = PIN->es; + PIN->e = sqrt(PIN->es); PIN->ra = 1. / PIN->a; PIN->one_es = 1. - PIN->es; Modified: trunk/toolkits/basemap/src/pj_latlong.c =================================================================== --- trunk/toolkits/basemap/src/pj_latlong.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_latlong.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_latlong.c,v 1.2 2000/07/07 06:04:23 warmerda Exp $ + * $Id: pj_latlong.c,v 1.3 2007/11/30 20:02:31 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Stub projection implementation for lat/long coordinates. We @@ -30,6 +30,9 @@ ****************************************************************************** * * $Log: pj_latlong.c,v $ + * Revision 1.3 2007/11/30 20:02:31 fwarmerdam + * add latlon and lonlat aliases + * * Revision 1.2 2000/07/07 06:04:23 warmerda * added longlat alias * @@ -41,8 +44,10 @@ /* very loosely based upon DMA code by Bradford W. Drew */ #define PJ_LIB__ #include <projects.h> -PROJ_HEAD(latlong, "Lat/long (Geodetic)") "\n\t"; -PROJ_HEAD(longlat, "Lat/long (Geodetic)") "\n\t"; +PROJ_HEAD(lonlat, "Lat/long (Geodetic)") "\n\t"; +PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") "\n\t"; +PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") "\n\t"; +PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") "\n\t"; FORWARD(forward); @@ -71,3 +76,17 @@ P->y0 = 0.0; P->inv = inverse; P->fwd = forward; ENDENTRY(P) + +ENTRY0(latlon) + P->is_latlong = 1; + P->x0 = 0.0; + P->y0 = 0.0; + P->inv = inverse; P->fwd = forward; +ENDENTRY(P) + +ENTRY0(lonlat) + P->is_latlong = 1; + P->x0 = 0.0; + P->y0 = 0.0; + P->inv = inverse; P->fwd = forward; +ENDENTRY(P) Modified: trunk/toolkits/basemap/src/pj_list.h =================================================================== --- trunk/toolkits/basemap/src/pj_list.h 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_list.h 2007-12-28 19:44:55 UTC (rev 4794) @@ -55,8 +55,10 @@ PROJ_HEAD(lagrng, "Lagrange") PROJ_HEAD(larr, "Larrivee") PROJ_HEAD(lask, "Laskowski") -PROJ_HEAD(latlong, "Lat/long (Geodetic)") -PROJ_HEAD(longlat, "Lat/long (Geodetic)") +PROJ_HEAD(lonlat, "Lat/long (Geodetic)") +PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") +PROJ_HEAD(latlong, "Lat/long (Geodetic alias)") +PROJ_HEAD(longlat, "Lat/long (Geodetic alias)") PROJ_HEAD(lcc, "Lambert Conformal Conic") PROJ_HEAD(lcca, "Lambert Conformal Conic Alternative") PROJ_HEAD(leac, "Lambert Equal Area Conic") @@ -71,7 +73,6 @@ PROJ_HEAD(merc, "Mercator") PROJ_HEAD(mil_os, "Miller Oblated Stereographic") PROJ_HEAD(mill, "Miller Cylindrical") -PROJ_HEAD(mpoly, "Modified Polyconic") PROJ_HEAD(moll, "Mollweide") PROJ_HEAD(murd1, "Murdoch I") PROJ_HEAD(murd2, "Murdoch II") Modified: trunk/toolkits/basemap/src/pj_open_lib.c =================================================================== --- trunk/toolkits/basemap/src/pj_open_lib.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_open_lib.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_open_lib.c,v 1.6 2004/09/16 15:14:01 fwarmerdam Exp $ + * $Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Implementation of pj_open_lib(), and pj_set_finder(). These @@ -31,6 +31,15 @@ ****************************************************************************** * * $Log: pj_open_lib.c,v $ + * Revision 1.9 2007/07/06 14:58:03 fwarmerdam + * improve searchpath clearning with pj_set_searchpath() + * + * Revision 1.8 2007/03/11 17:03:18 fwarmerdam + * support drive letter prefixes on win32 and related fixes (bug 1499) + * + * Revision 1.7 2006/11/17 22:16:30 mloskot + * Uploaded PROJ.4 port for Windows CE. + * * Revision 1.6 2004/09/16 15:14:01 fwarmerdam * * src/pj_open_lib.c: added pj_set_searchpath() provided by Eric Miller. * @@ -45,7 +54,7 @@ #include <string.h> #include <errno.h> -PJ_CVSID("$Id: pj_open_lib.c,v 1.6 2004/09/16 15:14:01 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_open_lib.c,v 1.9 2007/07/06 14:58:03 fwarmerdam Exp $"); static const char *(*pj_finder)(const char *) = NULL; static int path_count = 0; @@ -71,7 +80,8 @@ /* pj_set_searchpath() */ /* */ /* Path control for callers that can't practically provide */ -/* pj_set_finder() style callbacks. */ +/* pj_set_finder() style callbacks. Call with (0,NULL) as args */ +/* to clear the searchpath set. */ /************************************************************************/ void pj_set_searchpath ( int count, const char **path ) @@ -89,13 +99,16 @@ search_path = NULL; } - search_path = pj_malloc(sizeof *search_path * count); - for (i = 0; i < count; i++) + if( count > 0 ) { - search_path[i] = pj_malloc(strlen(path[i]) + 1); - strcpy(search_path[i], path[i]); + search_path = pj_malloc(sizeof *search_path * count); + for (i = 0; i < count; i++) + { + search_path[i] = pj_malloc(strlen(path[i]) + 1); + strcpy(search_path[i], path[i]); + } } - + path_count = count; } @@ -110,9 +123,16 @@ FILE *fid; int n = 0; int i; +#ifdef WIN32 + static const char dir_chars[] = "/\\"; +#else + static const char dir_chars[] = "/"; +#endif +#ifndef _WIN32_WCE + /* check if ~/name */ - if (*name == '~' && name[1] == DIR_CHAR) + if (*name == '~' && strchr(dir_chars,name[1]) ) if (sysname = getenv("HOME")) { (void)strcpy(fname, sysname); fname[n = strlen(fname)] = DIR_CHAR; @@ -123,8 +143,10 @@ return NULL; /* or fixed path: /name, ./name or ../name */ - else if (*name == DIR_CHAR || (*name == '.' && name[1] == DIR_CHAR) || - (!strncmp(name, "..", 2) && name[2] == DIR_CHAR) ) + else if (strchr(dir_chars,*name) + || (*name == '.' && strchr(dir_chars,name[1])) + || (!strncmp(name, "..", 2) && strchr(dir_chars,name[2])) + || (name[1] == ':' && strchr(dir_chars,name[2])) ) sysname = name; /* or try to use application provided file finder */ @@ -163,4 +185,7 @@ fid == NULL ? "failed" : "succeeded" ); return(fid); +#else + return NULL; +#endif /* _WIN32_WCE */ } Modified: trunk/toolkits/basemap/src/pj_release.c =================================================================== --- trunk/toolkits/basemap/src/pj_release.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_release.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -2,7 +2,7 @@ #include <projects.h> -char const pj_release[]="Rel. 4.5.0, 22 Oct 2006"; +char const pj_release[]="Rel. 4.6.0, 21 Dec 2007"; const char *pj_get_release() Modified: trunk/toolkits/basemap/src/pj_transform.c =================================================================== --- trunk/toolkits/basemap/src/pj_transform.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_transform.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_transform.c,v 1.20 2006/10/12 21:04:39 fwarmerdam Exp $ + * $Id: pj_transform.c,v 1.24 2007/12/03 15:48:20 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Perform overall coordinate system to coordinate system @@ -30,6 +30,24 @@ ****************************************************************************** * * $Log: pj_transform.c,v $ + * Revision 1.24 2007/12/03 15:48:20 fwarmerdam + * Improve WGS84 ES precision to avoid unnecesary transformation (#1531) + * + * Revision 1.23 2007/11/26 00:21:59 fwarmerdam + * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before + * adjustment for spherical projections. + * Modified pj_datum_transform() to use the original ellipsoid parameters, + * not the ones adjusted for spherical projections. + * Modified pj_datum_transform() to not attempt any datum shift via + * geocentric coordinates if the source *or* destination are raw ellipsoids + * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. + * + * Revision 1.22 2007/09/11 20:32:25 fwarmerdam + * mark the transient error array const + * + * Revision 1.21 2007/09/11 20:19:36 fwarmerdam + * avoid use of static variables to make reentrant + * * Revision 1.20 2006/10/12 21:04:39 fwarmerdam * Added experimental +lon_wrap argument to set a "center point" for * longitude wrapping of longitude values coming out of pj_transform(). @@ -110,14 +128,14 @@ #include <math.h> #include "geocent.h" -PJ_CVSID("$Id: pj_transform.c,v 1.20 2006/10/12 21:04:39 fwarmerdam Exp $"); +PJ_CVSID("$Id: pj_transform.c,v 1.24 2007/12/03 15:48:20 fwarmerdam Exp $"); #ifndef SRS_WGS84_SEMIMAJOR #define SRS_WGS84_SEMIMAJOR 6378137.0 #endif #ifndef SRS_WGS84_ESQUARED -#define SRS_WGS84_ESQUARED 0.006694379990 +#define SRS_WGS84_ESQUARED 0.0066943799901413165 #endif #define Dx_BF (defn->datum_params[0]) @@ -139,7 +157,7 @@ ** list or something, but while experimenting with it this should be fine. */ -static int transient_error[45] = { +static const int transient_error[45] = { /* 0 1 2 3 4 5 6 7 8 9 */ /* 0 to 9 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 to 19 */ 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, @@ -191,7 +209,7 @@ } } - if( pj_geocentric_to_geodetic( srcdefn->a, srcdefn->es, + if( pj_geocentric_to_geodetic( srcdefn->a_orig, srcdefn->es_orig, point_count, point_offset, x, y, z ) != 0) return pj_errno; @@ -288,7 +306,7 @@ return PJD_ERR_GEOCENTRIC; } - pj_geodetic_to_geocentric( dstdefn->a, dstdefn->es, + pj_geodetic_to_geocentric( dstdefn->a_orig, dstdefn->es_orig, point_count, point_offset, x, y, z ); if( dstdefn->fr_meter != 1.0 ) @@ -372,6 +390,7 @@ { double b; int i; + GeocentricInfo gi; pj_errno = 0; @@ -380,7 +399,7 @@ else b = a * sqrt(1-es); - if( pj_Set_Geocentric_Parameters( a, b ) != 0 ) + if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 ) { pj_errno = PJD_ERR_GEOCENTRIC; return pj_errno; @@ -393,7 +412,7 @@ if( x[io] == HUGE_VAL ) continue; - if( pj_Convert_Geodetic_To_Geocentric( y[io], x[io], z[io], + if( pj_Convert_Geodetic_To_Geocentric( &gi, y[io], x[io], z[io], x+io, y+io, z+io ) != 0 ) { pj_errno = -14; @@ -416,13 +435,14 @@ { double b; int i; + GeocentricInfo gi; if( es == 0.0 ) b = a; else b = a * sqrt(1-es); - if( pj_Set_Geocentric_Parameters( a, b ) != 0 ) + if( pj_Set_Geocentric_Parameters( &gi, a, b ) != 0 ) { pj_errno = PJD_ERR_GEOCENTRIC; return pj_errno; @@ -435,8 +455,8 @@ if( x[io] == HUGE_VAL ) continue; - pj_Convert_Geocentric_To_Geodetic( x[io], y[io], z[io], - y+io, x+io, z+io ); + pj_Convert_Geocentric_To_Geodetic( &gi, x[io], y[io], z[io], + y+io, x+io, z+io ); } return 0; @@ -456,8 +476,8 @@ { return 0; } - else if( srcdefn->a != dstdefn->a - || ABS(srcdefn->es - dstdefn->es) > 0.000000000050 ) + else if( srcdefn->a_orig != dstdefn->a_orig + || ABS(srcdefn->es_orig - dstdefn->es_orig) > 0.000000000050 ) { /* the tolerence for es is to ensure that GRS80 and WGS84 are considered identical */ @@ -590,6 +610,10 @@ /************************************************************************/ /* pj_datum_transform() */ +/* */ +/* The input should be long/lat/z coordinates in radians in the */ +/* source datum, and the output should be long/lat/z */ +/* coordinates in radians in the destination datum. */ /************************************************************************/ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, @@ -603,16 +627,26 @@ pj_errno = 0; /* -------------------------------------------------------------------- */ +/* We cannot do any meaningful datum transformation if either */ +/* the source or destination are of an unknown datum type */ +/* (ie. only a +ellps declaration, no +datum). This is new */ +/* behavior for PROJ 4.6.0. */ +/* -------------------------------------------------------------------- */ + if( srcdefn->datum_type == PJD_UNKNOWN + || dstdefn->datum_type == PJD_UNKNOWN ) + return 0; + +/* -------------------------------------------------------------------- */ /* Short cut if the datums are identical. */ /* -------------------------------------------------------------------- */ if( pj_compare_datums( srcdefn, dstdefn ) ) return 0; - src_a = srcdefn->a; - src_es = srcdefn->es; + src_a = srcdefn->a_orig; + src_es = srcdefn->es_orig; - dst_a = dstdefn->a; - dst_es = dstdefn->es; + dst_a = dstdefn->a_orig; + dst_es = dstdefn->es_orig; /* -------------------------------------------------------------------- */ /* Create a temporary Z array if one is not provided. */ Modified: trunk/toolkits/basemap/src/pj_utils.c =================================================================== --- trunk/toolkits/basemap/src/pj_utils.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/pj_utils.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -1,5 +1,5 @@ /****************************************************************************** - * $Id: pj_utils.c,v 1.4 2005/07/06 14:04:09 fwarmerdam Exp $ + * $Id: pj_utils.c,v 1.5 2007/03/12 14:05:35 fwarmerdam Exp $ * * Project: PROJ.4 * Purpose: Some utility functions we don't want to bother putting in @@ -29,6 +29,9 @@ ****************************************************************************** * * $Log: pj_utils.c,v $ + * Revision 1.5 2007/03/12 14:05:35 fwarmerdam + * Removed duplicate towgs84 definition code. + * * Revision 1.4 2005/07/06 14:04:09 fwarmerdam * Improved precision of es encoding for pj_latlong_from_proj() per: * http://bugzilla.remotesensing.org/show_bug.cgi?id=881 @@ -135,10 +138,6 @@ sprintf( defn+strlen(defn), " +towgs84=%s", pj_param(pj_in->params,"stowgs84").s ); - if( pj_param(pj_in->params, "ttowgs84").i ) - sprintf( defn+strlen(defn), " +towgs84=%s", - pj_param(pj_in->params,"stowgs84").s ); - if( pj_param(pj_in->params, "tnadgrids").i ) sprintf( defn+strlen(defn), " +nadgrids=%s", pj_param(pj_in->params,"snadgrids").s ); Modified: trunk/toolkits/basemap/src/proj_api.h =================================================================== --- trunk/toolkits/basemap/src/proj_api.h 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/proj_api.h 2007-12-28 19:44:55 UTC (rev 4794) @@ -28,6 +28,12 @@ ****************************************************************************** * * $Log: proj_api.h,v $ + * Revision 1.16 2007/11/29 21:07:49 fwarmerdam + * prepare for 4.6.0 release + * + * Revision 1.15 2007/08/20 13:40:06 fwarmerdam + * avoid warnings in c++ for some prototypes + * * Revision 1.14 2006/04/20 04:19:59 fwarmerdam * updated version * @@ -86,7 +92,7 @@ #endif /* Try to update this every version! */ -#define PJ_VERSION 450 +#define PJ_VERSION 460 extern char const pj_release[]; /* global release id string */ @@ -126,7 +132,7 @@ int pj_apply_gridshift( const char *, int, long point_count, int point_offset, double *x, double *y, double *z ); -void pj_deallocate_grids(); +void pj_deallocate_grids(void); int pj_is_latlong(projPJ); int pj_is_geocent(projPJ); void pj_pr_list(projPJ); @@ -140,8 +146,8 @@ void *pj_malloc(size_t); void pj_dalloc(void *); char *pj_strerrno(int); -int *pj_get_errno_ref(); -const char *pj_get_release(); +int *pj_get_errno_ref(void); +const char *pj_get_release(void); #ifdef __cplusplus } Modified: trunk/toolkits/basemap/src/projects.h =================================================================== --- trunk/toolkits/basemap/src/projects.h 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/projects.h 2007-12-28 19:44:55 UTC (rev 4794) @@ -28,6 +28,21 @@ ****************************************************************************** * * $Log: projects.h,v $ + * Revision 1.27 2007/11/26 00:21:59 fwarmerdam + * Modified PJ structure to hold a_orig, es_orig, ellipsoid definition before + * adjustment for spherical projections. + * Modified pj_datum_transform() to use the original ellipsoid parameters, + * not the ones adjusted for spherical projections. + * Modified pj_datum_transform() to not attempt any datum shift via + * geocentric coordinates if the source *or* destination are raw ellipsoids + * (ie. PJD_UNKNOWN). All per PROJ bug #1602, GDAL bug #2025. + * + * Revision 1.26 2007/03/11 17:03:18 fwarmerdam + * support drive letter prefixes on win32 and related fixes (bug 1499) + * + * Revision 1.25 2006/11/17 22:16:30 mloskot + * Uploaded PROJ.4 port for Windows CE. + * * Revision 1.24 2006/10/18 04:34:03 fwarmerdam * added mlist functions from libproj4 * @@ -149,6 +164,15 @@ extern double hypot(double, double); #endif +#ifdef _WIN32_WCE +# include <wce_stdlib.h> +# include <wce_stdio.h> +# define rewind wceex_rewind +# define getenv wceex_getenv +# define strdup _strdup +# define hypot _hypot +#endif + /* some useful constants */ #define HALFPI 1.5707963267948966 #define FORTPI 0.78539816339744833 @@ -164,8 +188,17 @@ #define ID_TAG_MAX 50 #endif +/* Use WIN32 as a standard windows 32 bit declaration */ +#if defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE) +# define WIN32 +#endif + +#if defined(_WINDOWS) && !defined(WIN32) && !defined(_WIN32_WCE) +# define WIN32 +#endif + /* directory delimiter for DOS support */ -#ifdef DOS +#ifdef WIN32 #define DIR_CHAR '\\' #else #define DIR_CHAR '/' @@ -265,8 +298,10 @@ int is_geocent; /* proj=geocent ... not really a projection at all */ double a, /* major axis or radius if es==0 */ + a_orig, /* major axis before any +proj related adjustment */ + es, /* e ^ 2 */ + es_orig, /* es before any +proj related adjustment */ e, /* eccentricity */ - es, /* e ^ 2 */ ra, /* 1/A */ one_es, /* 1 - e^2 */ rone_es, /* 1/one_es */ @@ -274,7 +309,7 @@ x0, y0, /* easting and northing */ k0, /* general scaling factor */ to_meter, fr_meter; /* cartesian scaling */ - + int datum_type; /* PJD_UNKNOWN/3PARAM/7PARAM/GRIDSHIFT/WGS84 */ double datum_params[7]; double from_greenwich; /* prime meridian offset (in radians) */ Modified: trunk/toolkits/basemap/src/rtodms.c =================================================================== --- trunk/toolkits/basemap/src/rtodms.c 2007-12-27 13:05:41 UTC (rev 4793) +++ trunk/toolkits/basemap/src/rtodms.c 2007-12-28 19:44:55 UTC (rev 4794) @@ -53,7 +53,9 @@ sec = fmod(r / RES, 60.); r = floor(r / RES60); min = fmod(r, 60.); - deg = r / 60.; + r = floor(r / 60.); + deg = r; + if (dolong) (void)sprintf(ss,format,deg,min,sec,sign); else if (sec) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-12-27 13:05:46
|
Revision: 4793 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4793&view=rev Author: jswhit Date: 2007-12-27 05:05:41 -0800 (Thu, 27 Dec 2007) Log Message: ----------- adjust title Modified Paths: -------------- trunk/toolkits/basemap/examples/hires.py Modified: trunk/toolkits/basemap/examples/hires.py =================================================================== --- trunk/toolkits/basemap/examples/hires.py 2007-12-27 13:02:56 UTC (rev 4792) +++ trunk/toolkits/basemap/examples/hires.py 2007-12-27 13:05:41 UTC (rev 4793) @@ -42,5 +42,5 @@ # draw meridians meridians = arange(-12,13,2) m.drawmeridians(meridians,labels=[0,0,1,1]) -title("High-Res British Isles",y=1.075) +title("High-Res British Isles",y=1.04) show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-12-27 13:03:00
|
Revision: 4792 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4792&view=rev Author: jswhit Date: 2007-12-27 05:02:56 -0800 (Thu, 27 Dec 2007) Log Message: ----------- add runtime_library_dirs to _geos Extension initialization. Modified Paths: -------------- trunk/toolkits/basemap/setup.py Modified: trunk/toolkits/basemap/setup.py =================================================================== --- trunk/toolkits/basemap/setup.py 2007-12-26 20:01:29 UTC (rev 4791) +++ trunk/toolkits/basemap/setup.py 2007-12-27 13:02:56 UTC (rev 4792) @@ -65,18 +65,18 @@ break else: geos_version = check_geosversion(GEOS_dir) -if geos_version != '"2.2.3"': - raise SystemExit(""" -Can't find geos library version 2.2.3. Please set the -environment variable GEOS_DIR to point to the location -where geos 2.2.3 is installed (for example, if geos_c.h -is in /usr/local/include, and libgeos_c is in /usr/local/lib, -set GEOS_DIR to /usr/local), or edit the setup.py script -manually and set the variable GEOS_dir (right after the line -that says "set GEOS_dir manually here".""") -else: - geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()] - geos_library_dirs=[os.path.join(GEOS_dir,'lib'),os.path.join(GEOS_dir,'lib64')] +#if geos_version != '"2.2.3"': +# raise SystemExit(""" +#Can't find geos library version 2.2.3. Please set the +#environment variable GEOS_DIR to point to the location +#where geos 2.2.3 is installed (for example, if geos_c.h +#is in /usr/local/include, and libgeos_c is in /usr/local/lib, +#set GEOS_DIR to /usr/local), or edit the setup.py script +#manually and set the variable GEOS_dir (right after the line +#that says "set GEOS_dir manually here".""") +#else: +geos_include_dirs=[os.path.join(GEOS_dir,'include'),numpy.get_include()] +geos_library_dirs=[os.path.join(GEOS_dir,'lib'),os.path.join(GEOS_dir,'lib64')] # proj4 and geos extensions. deps = glob.glob('src/*.c') @@ -90,7 +90,11 @@ extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) # for some reason, pickling won't work if this extension is installed # as "matplotlib.toolkits.basemap._geos" -extensions.append(Extension("_geos",['src/_geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,libraries=['geos_c','geos'])) +extensions.append(Extension("_geos",['src/_geos.c'], + library_dirs=geos_library_dirs, + runtime_library_dirs=geos_library_dirs, + include_dirs=geos_include_dirs, + libraries=['geos_c','geos'])) # install shapelib and dbflib. packages = packages + ['shapelib','dbflib'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-12-26 20:01:33
|
Revision: 4791 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4791&view=rev Author: jswhit Date: 2007-12-26 12:01:29 -0800 (Wed, 26 Dec 2007) Log Message: ----------- remove hidden dependency on setuptools Modified Paths: -------------- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2007-12-26 17:10:34 UTC (rev 4790) +++ trunk/toolkits/basemap/Changelog 2007-12-26 20:01:29 UTC (rev 4791) @@ -1,4 +1,5 @@ version 0.9.9 (not yet released) + * removed hidden dependency on setuptools (in dap module). * fixed exception handling bug in code that looks for intersection between boundary feature and map projection region. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2007-12-26 17:10:48
|
Revision: 4790 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4790&view=rev Author: efiring Date: 2007-12-26 09:10:34 -0800 (Wed, 26 Dec 2007) Log Message: ----------- Warning instead of exception if matplotlib.use() is called too late. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/__init__.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-12-26 07:51:19 UTC (rev 4789) +++ trunk/matplotlib/CHANGELOG 2007-12-26 17:10:34 UTC (rev 4790) @@ -1,3 +1,6 @@ +2007-12-26 Reduce too-late use of matplotlib.use() to a warning + instead of an exception, for backwards compatibility - EF + 2007-12-25 Fix bug in errorbar, identified by Noriko Minakawa - EF 2007-12-25 Changed masked array importing to work with the upcoming Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2007-12-26 07:51:19 UTC (rev 4789) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2007-12-26 17:10:34 UTC (rev 4790) @@ -727,8 +727,11 @@ except: from config import rcParams, rcdefaults -_use_error_msg = """ matplotlib.use() must be called *before* pylab -or matplotlib.backends is imported for the first time.""" +_use_error_msg = """ This call to matplotlib.use() has no effect +because the the backend has already been chosen; +matplotlib.use() must be called *before* pylab, matplotlib.pyplot, +or matplotlib.backends is imported for the first time. +""" def use(arg): """ @@ -747,7 +750,7 @@ be called before importing matplotlib.backends. """ if 'matplotlib.backends' in sys.modules: - raise RuntimeError(_use_error_msg) + warnings.warn(_use_error_msg) be_parts = arg.split('.') name = validate_backend(be_parts[0]) rcParams['backend'] = name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2007-12-26 07:51:22
|
Revision: 4789 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4789&view=rev Author: efiring Date: 2007-12-25 23:51:19 -0800 (Tue, 25 Dec 2007) Log Message: ----------- Fix bug in errorbar, reported by Noriko Minakawa Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-12-26 07:23:27 UTC (rev 4788) +++ trunk/matplotlib/CHANGELOG 2007-12-26 07:51:19 UTC (rev 4789) @@ -1,3 +1,5 @@ +2007-12-25 Fix bug in errorbar, identified by Noriko Minakawa - EF + 2007-12-25 Changed masked array importing to work with the upcoming numpy 1.05 (now the maskedarray branch) as well as with earlier versions. - EF Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2007-12-26 07:23:27 UTC (rev 4788) +++ trunk/matplotlib/lib/matplotlib/axes.py 2007-12-26 07:51:19 UTC (rev 4789) @@ -3684,6 +3684,8 @@ lines_kw['linewidth']=kwargs['linewidth'] if 'lw' in kwargs: lines_kw['lw']=kwargs['lw'] + if 'transform' in kwargs: + lines_kw['transform'] = kwargs['transform'] # arrays fine here, they are booleans and hence not units if not iterable(lolims): @@ -3719,6 +3721,8 @@ plot_kw['markeredgewidth']=kwargs['markeredgewidth'] if 'mew' in kwargs: plot_kw['mew']=kwargs['mew'] + if 'transform' in kwargs: + plot_kw['transform'] = kwargs['transform'] if xerr is not None: if iterable(xerr) and len(xerr)==2 and iterable(xerr[0]) and iterable(xerr[1]): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2007-12-26 07:23:32
|
Revision: 4788 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4788&view=rev Author: efiring Date: 2007-12-25 23:23:27 -0800 (Tue, 25 Dec 2007) Log Message: ----------- Make numerix.ma and numerix.npyma work with numpy 1.05 The numpy maskedarray branch is scheduled to become the trunk for 1.05. It includes a change from ma.py being in numpy/core to ma being a module under numpy, so the import syntax is different in numerix.ma and numerix.npyma. Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-12-21 19:40:59 UTC (rev 4787) +++ trunk/matplotlib/CHANGELOG 2007-12-26 07:23:27 UTC (rev 4788) @@ -1,3 +1,7 @@ +2007-12-25 Changed masked array importing to work with the upcoming + numpy 1.05 (now the maskedarray branch) as well as with + earlier versions. - EF + 2007-12-16 rec2csv saves doubles without losing precision. Also, it does not close filehandles passed in open. - JDH,ADS Modified: trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py 2007-12-21 19:40:59 UTC (rev 4787) +++ trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py 2007-12-26 07:23:27 UTC (rev 4788) @@ -13,7 +13,10 @@ from maskedarray import * print "using maskedarray" else: - from numpy.core.ma import * + try: + from numpy.ma import * # numpy 1.05 and later + except ImportError: + from numpy.core.ma import * # earlier #print "using ma" def getmaskorNone(obj): _msk = getmask(obj) Modified: trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py 2007-12-21 19:40:59 UTC (rev 4787) +++ trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py 2007-12-26 07:23:27 UTC (rev 4788) @@ -4,5 +4,8 @@ from maskedarray import * print "using maskedarray" else: - from numpy.core.ma import * + try: + from numpy.ma import * # numpy 1.05 and later + except ImportError: + from numpy.core.ma import * # earlier #print "using ma" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-21 19:41:07
|
Revision: 4787 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4787&view=rev Author: mdboom Date: 2007-12-21 11:40:59 -0800 (Fri, 21 Dec 2007) Log Message: ----------- Merged revisions 4773-4785 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4783 | mdboom | 2007-12-21 10:08:38 -0500 (Fri, 21 Dec 2007) | 2 lines Add size-dependent highly-accurate arc drawing. ........ r4785 | jdh2358 | 2007-12-21 11:22:42 -0500 (Fri, 21 Dec 2007) | 2 lines added unit support to arc ........ Modified Paths: -------------- branches/transforms/API_CHANGES branches/transforms/CODING_GUIDE branches/transforms/examples/units/ellipse_with_units.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/legend.py branches/transforms/lib/matplotlib/mlab.py branches/transforms/lib/matplotlib/patches.py branches/transforms/unit/ellipse_large.py Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4772 + /trunk/matplotlib:1-4785 Modified: branches/transforms/API_CHANGES =================================================================== --- branches/transforms/API_CHANGES 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/API_CHANGES 2007-12-21 19:40:59 UTC (rev 4787) @@ -169,6 +169,9 @@ END OF TRANSFORMS REFACTORING + For csv2rec, checkrows=0 is the new default indicating all rows + will be checked for type inference + A warning is issued when an image is drawn on log-scaled axes, since it will not log-scale the image data. Modified: branches/transforms/CODING_GUIDE =================================================================== --- branches/transforms/CODING_GUIDE 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/CODING_GUIDE 2007-12-21 19:40:59 UTC (rev 4787) @@ -12,6 +12,9 @@ # checking out the main src svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib --username=youruser --password=yourpass +# branch checkouts, eg the transforms branch +svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms transbranch + == Committing changes == When committing changes to matplotlib, there are a few things to bear @@ -27,12 +30,6 @@ support 2.3, so avoid 2.4 only features like decorators until we remove 2.3 support - * Are your changes Numeric, numarray and numpy compatible? Try - running simple_plot.py or image_demo.py with --Numeric, --numarray - and --numpy (Note, someone should add examples to - backend_driver.py which explicitly require numpy, numarray and - Numeric so we can automatically catch these) - * Can you pass examples/backend_driver.py? This is our poor man's unit test. @@ -49,9 +46,8 @@ For numpy, use: import numpy as npy - ... a = npy.array([1,2,3]) - ... + For masked arrays, use: import matplotlib.numerix.npyma as ma @@ -64,16 +60,20 @@ For matplotlib main module, use: import matplotlib as mpl - ... mpl.rcParams['xtick.major.pad'] = 6 -For matplotlib modules, use: +For matplotlib modules (or any other modules), use: - import matplotlib.cbook as cbook as mpl_cbook - ... - if mpl_cbook.iterable(z): - ... + import matplotlib.cbook as cbook + + if cbook.iterable(z): + pass + We prefer this over the equivalent 'from matplotlib import cbook' + because the latter is ambiguous whether cbook is a module or a + function to the new developer. The former makes it explcit that + you are importing a module or package. + == Naming, spacing, and formatting conventions == In general, we want to hew as closely as possible to the standard @@ -114,15 +114,6 @@ python, C and C++ -When importing modules from the matplotlib namespace - - import matplotlib.cbook as cbook # DO - from matplotlib import cbook #DONT - -because the latter is ambiguous whether cbook is a module or a -function to the new developer. The former makes it explcit that you -are importing a module or package. - ; and similarly for c++-mode-hook and c-mode-hook (add-hook 'python-mode-hook (lambda () Modified: branches/transforms/examples/units/ellipse_with_units.py =================================================================== --- branches/transforms/examples/units/ellipse_with_units.py 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/examples/units/ellipse_with_units.py 2007-12-21 19:40:59 UTC (rev 4787) @@ -1,5 +1,5 @@ """ -Compare the ellipse generated with arcs versus a polygonal approximation +Compare the ellipse generated with arcs versus a polygonal approximation """ from basic_units import cm import numpy as npy @@ -46,4 +46,24 @@ #fig.savefig('ellipse_compare.png') fig.savefig('ellipse_compare') +fig = figure() +ax = fig.add_subplot(211, aspect='auto') +ax.fill(x, y, alpha=0.2, facecolor='yellow', edgecolor='yellow', linewidth=1, zorder=1) + +e1 = patches.Arc((xcenter, ycenter), width, height, + angle=angle, linewidth=2, fill=False, zorder=2) + +ax.add_patch(e1) + +ax = fig.add_subplot(212, aspect='equal') +ax.fill(x, y, alpha=0.2, facecolor='green', edgecolor='green', zorder=1) +e2 = patches.Arc((xcenter, ycenter), width, height, + angle=angle, linewidth=2, fill=False, zorder=2) + + +ax.add_patch(e2) + +#fig.savefig('arc_compare.png') +fig.savefig('arc_compare') + show() Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/lib/matplotlib/axes.py 2007-12-21 19:40:59 UTC (rev 4787) @@ -321,6 +321,8 @@ ret.append(seg) def makefill(x, y): + x = self.axes.convert_xunits(x) + y = self.axes.convert_yunits(y) facecolor = self._get_next_cycle_color() seg = mpatches.Polygon(zip(x, y), facecolor = facecolor, @@ -363,6 +365,8 @@ def makefill(x, y): facecolor = color + x = self.axes.convert_xunits(x) + y = self.axes.convert_yunits(y) seg = mpatches.Polygon(zip(x, y), facecolor = facecolor, fill=True, Modified: branches/transforms/lib/matplotlib/legend.py =================================================================== --- branches/transforms/lib/matplotlib/legend.py 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/lib/matplotlib/legend.py 2007-12-21 19:40:59 UTC (rev 4787) @@ -140,7 +140,7 @@ self._offsetTransform = Affine2D() self._parentTransform = BboxTransformTo(parent.bbox) Artist.set_transform(self, self._offsetTransform + self._parentTransform) - + if loc is None: loc = rcParams["legend.loc"] if not self.isaxes and loc in [0,'best']: @@ -226,7 +226,7 @@ bboxesAll = bboxesText bboxesAll.extend(bboxesHandles) bbox = Bbox.union(bboxesAll) - + self.save = bbox ibox = bbox.inverse_transformed(self.get_transform()) @@ -328,7 +328,7 @@ if isinstance(handle, Rectangle): transform = handle.get_data_transform() + inverse_transform - bboxes.append(handle._bbox.transformed(transform)) + bboxes.append(handle.get_bbox().transformed(transform)) else: transform = handle.get_transform() + inverse_transform bboxes.append(handle.get_path().get_extents(transform)) @@ -499,7 +499,7 @@ bbox = bbox.expanded(1 + self.pad, 1 + self.pad) l, b, w, h = bbox.bounds self.legendPatch.set_bounds(l, b, w, h) - + ox, oy = 0, 0 # center if iterable(self._loc) and len(self._loc)==2: Modified: branches/transforms/lib/matplotlib/mlab.py =================================================================== --- branches/transforms/lib/matplotlib/mlab.py 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/lib/matplotlib/mlab.py 2007-12-21 19:40:59 UTC (rev 4787) @@ -2045,7 +2045,7 @@ return newrec.view(npy.recarray) -def csv2rec(fname, comments='#', skiprows=0, checkrows=5, delimiter=',', +def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',', converterd=None, names=None, missing=None): """ Load data from comma/space/tab delimited file in fname into a @@ -2075,7 +2075,7 @@ names, if not None, is a list of header names. In this case, no header will be read from the file - if no rows are found, None is returned See examples/loadrec.py + if no rows are found, None is returned -- see examples/loadrec.py """ if converterd is None: Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/lib/matplotlib/patches.py 2007-12-21 19:40:59 UTC (rev 4787) @@ -366,10 +366,11 @@ Patch.__init__(self, **kwargs) - left, right = self.convert_xunits((xy[0], xy[0] + width)) - bottom, top = self.convert_yunits((xy[1], xy[1] + height)) - self._bbox = transforms.Bbox.from_extents(left, bottom, right, top) - self._rect_transform = transforms.BboxTransformTo(self._bbox) + self._x = xy[0] + self._y = xy[1] + self._width = width + self._height = height + self._rect_transform = transforms.IdentityTransform() __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd def get_path(self): @@ -378,6 +379,19 @@ """ return Path.unit_rectangle() + def _update_patch_transform(self): + x = self.convert_xunits(self._x) + y = self.convert_yunits(self._y) + width = self.convert_xunits(self._width) + height = self.convert_yunits(self._height) + bbox = transforms.Bbox.from_bounds(x, y, width, height) + self._rect_transform = transforms.BboxTransformTo(bbox) + self._combined_transform = self._rect_transform + artist.Artist.get_transform(self) + + def draw(self, renderer): + self._update_patch_transform() + Patch.draw(self, renderer) + def get_patch_transform(self): return self._rect_transform @@ -388,19 +402,19 @@ def get_x(self): "Return the left coord of the rectangle" - return self._bbox.x0 + return self._x def get_y(self): "Return the bottom coord of the rectangle" - return self._bbox.y0 + return self._y def get_width(self): "Return the width of the rectangle" - return self._bbox.width + return self._width def get_height(self): "Return the height of the rectangle" - return self._bbox.height + return self._height def set_x(self, x): """ @@ -408,9 +422,7 @@ ACCEPTS: float """ - w = self._bbox.width - x = self.convert_xunits(x) - self._bbox.intervalx = (x, x + w) + self._x = x def set_y(self, y): """ @@ -418,9 +430,7 @@ ACCEPTS: float """ - h = self._bbox.height - y = self.convert_yunits(y) - self._bbox.intervaly = (y, y + h) + self._y = y def set_width(self, w): """ @@ -428,8 +438,7 @@ ACCEPTS: float """ - w = self.convert_xunits(w) - self._bbox.x1 = self._bbox.x0 + w + self._width = w def set_height(self, h): """ @@ -437,8 +446,7 @@ ACCEPTS: float """ - h = self.convert_yunits(h) - self._bbox.y1 = self._bbox.y0 + h + self._height = h def set_bounds(self, *args): """ @@ -450,10 +458,13 @@ l,b,w,h = args[0] else: l,b,w,h = args - l, w = self.convert_xunits((l, w)) - b, h = self.convert_yunits((b, h)) - self._bbox.bounds = l,b,w,h + self._x = l + self._y = b + self._width = w + self._height = h + def get_bbox(self): + return transforms.Bbox.from_bounds(self._x, self._y, self._width, self._height) class RegularPolygon(Patch): """ @@ -494,7 +505,6 @@ def _get_xy(self): return self._xy def _set_xy(self, xy): - self._xy = xy self._update_transform() xy = property(_get_xy, _set_xy) @@ -588,9 +598,23 @@ """ Patch.__init__(self, **kwargs) - self._path = Path.wedge(theta1, theta2) + self.center = center + self.r = r + self.theta1 = theta1 + self.theta2 = theta2 + self._patch_transform = transforms.IdentityTransform() + self._path = Path.wedge(self.theta1, self.theta2) + + def draw(self, renderer): + x = self.convert_xunits(self.center[0]) + y = self.convert_yunits(self.center[1]) + rx = self.convert_xunits(self.r) + ry = self.convert_yunits(self.r) self._patch_transform = transforms.Affine2D() \ - .scale(r).translate(*center) + .scale(rx, ry).translate(x, y) + self._combined_transform = self._patch_transform + \ + artist.Artist.get_transform(self) + Patch.draw(self, renderer) __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd def get_path(self): @@ -806,8 +830,6 @@ %(Patch)s """ - self.center = xy - self.radius = radius RegularPolygon.__init__(self, xy, resolution, radius, @@ -821,7 +843,7 @@ A scale-free ellipse """ def __str__(self): - return "Ellipse(%d,%d;%dx%d)"%(self.center[0],self.center[1],self.width,self.height) + return "Ellipse(%s,%s;%sx%s)"%(self.center[0],self.center[1],self.width,self.height) def __init__(self, xy, width, height, angle=0.0, **kwargs): """ @@ -835,18 +857,28 @@ """ Patch.__init__(self, **kwargs) - self._center = xy - self._width, self._height = width, height - self._angle = angle - self._recompute_transform() + self.center = xy + self.width, self.height = width, height + self.angle = angle self._path = Path.unit_circle() + self._patch_transform = transforms.IdentityTransform() def _recompute_transform(self): + center = (self.convert_xunits(self.center[0]), + self.convert_yunits(self.center[1])) + width = self.convert_xunits(self.width) + height = self.convert_yunits(self.height) self._patch_transform = transforms.Affine2D() \ - .scale(self._width * 0.5, self._height * 0.5) \ - .rotate_deg(self._angle) \ - .translate(*self._center) + .scale(width * 0.5, height * 0.5) \ + .rotate_deg(self.angle) \ + .translate(*center) + self._combined_transform = self._patch_transform + \ + artist.Artist.get_transform(self) + def draw(self, renderer): + self._recompute_transform() + Patch.draw(self, renderer) + def get_path(self): """ Return the vertices of the rectangle @@ -861,27 +893,7 @@ x, y = self.get_transform().inverted().transform_point((ev.x, ev.y)) return (x*x + y*y) <= 1.0, {} - def _get_center(self): - return self._center - def _set_center(self, center): - self._center = center - self._recompute_transform() - center = property(_get_center, _set_center) - def _get_xy(self): - return self._xy - def _set_xy(self, xy): - self._xy = xy - self._recompute_transform() - xy = property(_get_xy, _set_xy) - - def _get_angle(self): - return self._angle - def _set_angle(self, angle): - self._angle = angle - self._recompute_transform() - angle = property(_get_angle, _set_angle) - class Circle(Ellipse): """ A circle patch @@ -912,9 +924,14 @@ """ An elliptical arc. Because it performs various optimizations, it can not be filled. + + The arc must be used in an Axes instance it cannot be added + directly to a Figure) because it is optimized to only render the + segments that are inside the axes bounding box with high + resolution. """ def __str__(self): - return "Arc(%d,%d;%dx%d)"%(self.center[0],self.center[1],self.width,self.height) + return "Arc(%s,%s;%sx%s)"%(self.center[0],self.center[1],self.width,self.height) def __init__(self, xy, width, height, angle=0.0, theta1=0.0, theta2=360.0, **kwargs): """ @@ -938,8 +955,8 @@ Ellipse.__init__(self, xy, width, height, angle, **kwargs) - self._theta1 = theta1 - self._theta2 = theta2 + self.theta1 = theta1 + self.theta2 = theta2 def draw(self, renderer): """ @@ -984,13 +1001,20 @@ pairs of vertices are drawn using the bezier arc approximation technique implemented in Path.arc(). """ + if not hasattr(self, 'axes'): + raise RuntimeError('Arcs can only be used in Axes instances') + + self._recompute_transform() + # Get the width and height in pixels + width = self.convert_xunits(self.width) + height = self.convert_yunits(self.height) width, height = self.get_transform().transform_point( - (self._width, self._height)) - inv_error = (1.0 / 1.89818e-6) + (width, height)) + inv_error = (1.0 / 1.89818e-6) * 0.5 if width < inv_error and height < inv_error: - self._path = Path.arc(self._theta1, self._theta2) + self._path = Path.arc(self.theta1, self.theta2) return Patch.draw(self, renderer) def iter_circle_intersect_on_line(x0, y0, x1, y1): @@ -1037,7 +1061,6 @@ if x >= x0e and x <= x1e and y >= y0e and y <= y1e: yield x, y - # Transforms the axes box_path so that it is relative to the unit # circle in the same way that it is relative to the desired # ellipse. @@ -1050,8 +1073,8 @@ TWOPI = PI * 2.0 RAD2DEG = 180.0 / PI DEG2RAD = PI / 180.0 - theta1 = self._theta1 - theta2 = self._theta2 + theta1 = self.theta1 + theta2 = self.theta2 thetas = {} # For each of the point pairs, there is a line segment for p0, p1 in zip(box_path.vertices[:-1], box_path.vertices[1:]): Modified: branches/transforms/unit/ellipse_large.py =================================================================== --- branches/transforms/unit/ellipse_large.py 2007-12-21 18:53:29 UTC (rev 4786) +++ branches/transforms/unit/ellipse_large.py 2007-12-21 19:40:59 UTC (rev 4787) @@ -6,7 +6,7 @@ import math from pylab import * -from matplotlib.patches import Arc +from matplotlib.patches import Ellipse, Arc # given a point x, y x = 2692.440 @@ -47,39 +47,75 @@ ellipseLine = ax.plot( xs, ys, **kwargs ) + + ################################################## # make the axes -ax = subplot( 211, aspect='equal' ) -ax.set_aspect( 'equal', 'datalim' ) +ax1 = subplot( 311, aspect='equal' ) +ax1.set_aspect( 'equal', 'datalim' ) # make the lower-bound ellipse diam = (r - delta) * 2.0 -lower_ellipse = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkgreen" ) -ax.add_patch( lower_ellipse ) +lower_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkgreen" ) +ax1.add_patch( lower_ellipse ) # make the target ellipse diam = r * 2.0 -target_ellipse = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkred" ) -ax.add_patch( target_ellipse ) +target_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkred" ) +ax1.add_patch( target_ellipse ) # make the upper-bound ellipse diam = (r + delta) * 2.0 -upper_ellipse = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkblue" ) -ax.add_patch( upper_ellipse ) +upper_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkblue" ) +ax1.add_patch( upper_ellipse ) # make the target diam = delta * 2.0 +target = Ellipse( (x, y), diam, diam, 0.0, fill=False, edgecolor="#DD1208" ) +ax1.add_patch( target ) + +# give it a big marker +ax1.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + +################################################## +# make the axes +ax = subplot( 312, aspect='equal' , sharex=ax1, sharey=ax1) +ax.set_aspect( 'equal', 'datalim' ) + +# make the lower-bound arc +diam = (r - delta) * 2.0 +lower_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkgreen" ) +ax.add_patch( lower_arc ) + +# make the target arc +diam = r * 2.0 +target_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkred" ) +ax.add_patch( target_arc ) + +# make the upper-bound arc +diam = (r + delta) * 2.0 +upper_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkblue" ) +ax.add_patch( upper_arc ) + +# make the target +diam = delta * 2.0 target = Arc( (x, y), diam, diam, 0.0, fill=False, edgecolor="#DD1208" ) ax.add_patch( target ) # give it a big marker ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + + + + ################################################## # now lets do the same thing again using a custom ellipse function + + # make the axes -ax = subplot( 212, aspect='equal', sharex=ax, sharey=ax ) +ax = subplot( 313, aspect='equal', sharex=ax1, sharey=ax1 ) ax.set_aspect( 'equal', 'datalim' ) # make the lower-bound ellipse @@ -97,11 +133,17 @@ # give it a big marker ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + +# give it a big marker +ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + ################################################## # lets zoom in to see the area of interest -ax.set_xlim(2650, 2735) -ax.set_ylim(6705, 6735) +ax1.set_xlim(2650, 2735) +ax1.set_ylim(6705, 6735) + +savefig("ellipse") show() -# savefig("ellipse") + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jd...@us...> - 2007-12-21 18:56:52
|
Revision: 4785 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4785&view=rev Author: jdh2358 Date: 2007-12-21 08:22:42 -0800 (Fri, 21 Dec 2007) Log Message: ----------- added unit support to arc Modified Paths: -------------- trunk/matplotlib/API_CHANGES trunk/matplotlib/CODING_GUIDE trunk/matplotlib/examples/units/ellipse_with_units.py trunk/matplotlib/lib/matplotlib/mlab.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/unit/ellipse_large.py Modified: trunk/matplotlib/API_CHANGES =================================================================== --- trunk/matplotlib/API_CHANGES 2007-12-21 15:13:14 UTC (rev 4784) +++ trunk/matplotlib/API_CHANGES 2007-12-21 16:22:42 UTC (rev 4785) @@ -1,3 +1,6 @@ + For csv2rec, checkrows=0 is the new default indicating all rows + will be checked for type inference + A warning is issued when an image is drawn on log-scaled axes, since it will not log-scale the image data. Modified: trunk/matplotlib/CODING_GUIDE =================================================================== --- trunk/matplotlib/CODING_GUIDE 2007-12-21 15:13:14 UTC (rev 4784) +++ trunk/matplotlib/CODING_GUIDE 2007-12-21 16:22:42 UTC (rev 4785) @@ -12,6 +12,9 @@ # checking out the main src svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib --username=youruser --password=yourpass +# branch checkouts, eg the transforms branch +svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms transbranch + == Committing changes == When committing changes to matplotlib, there are a few things to bear @@ -27,12 +30,6 @@ support 2.3, so avoid 2.4 only features like decorators until we remove 2.3 support - * Are your changes Numeric, numarray and numpy compatible? Try - running simple_plot.py or image_demo.py with --Numeric, --numarray - and --numpy (Note, someone should add examples to - backend_driver.py which explicitly require numpy, numarray and - Numeric so we can automatically catch these) - * Can you pass examples/backend_driver.py? This is our poor man's unit test. @@ -49,9 +46,8 @@ For numpy, use: import numpy as npy - ... a = npy.array([1,2,3]) - ... + For masked arrays, use: import matplotlib.numerix.npyma as ma @@ -64,16 +60,20 @@ For matplotlib main module, use: import matplotlib as mpl - ... mpl.rcParams['xtick.major.pad'] = 6 -For matplotlib modules, use: +For matplotlib modules (or any other modules), use: - import matplotlib.cbook as cbook as mpl_cbook - ... - if mpl_cbook.iterable(z): - ... + import matplotlib.cbook as cbook + + if cbook.iterable(z): + pass + We prefer this over the equivalent 'from matplotlib import cbook' + because the latter is ambiguous whether cbook is a module or a + function to the new developer. The former makes it explcit that + you are importing a module or package. + == Naming, spacing, and formatting conventions == In general, we want to hew as closely as possible to the standard @@ -114,15 +114,6 @@ python, C and C++ -When importing modules from the matplotlib namespace - - import matplotlib.cbook as cbook # DO - from matplotlib import cbook #DONT - -because the latter is ambiguous whether cbook is a module or a -function to the new developer. The former makes it explcit that you -are importing a module or package. - ; and similarly for c++-mode-hook and c-mode-hook (add-hook 'python-mode-hook (lambda () Modified: trunk/matplotlib/examples/units/ellipse_with_units.py =================================================================== --- trunk/matplotlib/examples/units/ellipse_with_units.py 2007-12-21 15:13:14 UTC (rev 4784) +++ trunk/matplotlib/examples/units/ellipse_with_units.py 2007-12-21 16:22:42 UTC (rev 4785) @@ -1,5 +1,5 @@ """ -Compare the ellipse generated with arcs versus a polygonal approximation +Compare the ellipse generated with arcs versus a polygonal approximation """ from basic_units import cm import numpy as npy @@ -46,4 +46,24 @@ #fig.savefig('ellipse_compare.png') fig.savefig('ellipse_compare') +fig = figure() +ax = fig.add_subplot(211, aspect='auto') +ax.fill(x, y, alpha=0.2, facecolor='yellow', edgecolor='yellow', linewidth=1, zorder=1) + +e1 = patches.Arc((xcenter, ycenter), width, height, + angle=angle, linewidth=2, fill=False, zorder=2) + +ax.add_patch(e1) + +ax = fig.add_subplot(212, aspect='equal') +ax.fill(x, y, alpha=0.2, facecolor='green', edgecolor='green', zorder=1) +e2 = patches.Arc((xcenter, ycenter), width, height, + angle=angle, linewidth=2, fill=False, zorder=2) + + +ax.add_patch(e2) + +#fig.savefig('arc_compare.png') +fig.savefig('arc_compare') + show() Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2007-12-21 15:13:14 UTC (rev 4784) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2007-12-21 16:22:42 UTC (rev 4785) @@ -2045,7 +2045,7 @@ return newrec.view(npy.recarray) -def csv2rec(fname, comments='#', skiprows=0, checkrows=5, delimiter=',', +def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',', converterd=None, names=None, missing=None): """ Load data from comma/space/tab delimited file in fname into a @@ -2075,7 +2075,7 @@ names, if not None, is a list of header names. In this case, no header will be read from the file - if no rows are found, None is returned See examples/loadrec.py + if no rows are found, None is returned -- see examples/loadrec.py """ if converterd is None: Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2007-12-21 15:13:14 UTC (rev 4784) +++ trunk/matplotlib/lib/matplotlib/patches.py 2007-12-21 16:22:42 UTC (rev 4785) @@ -977,10 +977,16 @@ """ An elliptical arc. Because it performs various optimizations, it can not be filled. + + The arc must be used in an Axes instance it cannot be added + directly to a Figure) because it is optimized to only render the + segments that are inside the axes bounding box with high + resolution. """ def __str__(self): - return "Arc(%d,%d;%dx%d)"%(self.center[0],self.center[1],self.width,self.height) + return "Arc(%s,%s;%sx%s)"%(self.center[0],self.center[1],self.width,self.height) + def __init__(self, xy, width, height, angle=0.0, theta1=0.0, theta2=360.0, **kwargs): """ xy - center of ellipse @@ -1053,6 +1059,10 @@ """ # Do the usual GC handling stuff if not self.get_visible(): return + + if not hasattr(self, 'axes'): + raise RuntimeError('Arcs can only be used in Axes instances') + gc = renderer.new_gc() gc.set_foreground(self._edgecolor) gc.set_linewidth(self._linewidth) @@ -1212,10 +1222,17 @@ # Set up the master transform from unit circle, all the way to # display space. + + centerx, centery = self.center + centerx = self.convert_xunits(centerx) + centery = self.convert_yunits(centery) + width = self.convert_xunits(self.width) + height = self.convert_yunits(self.height) + trans = self.get_transform() scale = npy.array( - [[self.width * 0.5, 0.0, 0.0], - [0.0, self.height * 0.5, 0.0], + [[width * 0.5, 0.0, 0.0], + [0.0, height * 0.5, 0.0], [0.0, 0.0, 1.0]], npy.float_) theta = (self.angle / 180.0) * npy.pi rotate = npy.array( @@ -1223,8 +1240,8 @@ [npy.sin(theta), npy.cos(theta), 0.0], [0.0, 0.0, 1.0]], npy.float_) translate = npy.array( - [[1.0, 0.0, self.center[0]], - [0.0, 1.0, self.center[1]], + [[1.0, 0.0, centerx], + [0.0, 1.0, centery], [0.0, 0.0, 1.0]], npy.float_) sx, b, c, sy, tx, ty = trans.as_vec6_val() dataTrans = npy.array( @@ -1240,7 +1257,7 @@ # that as a threshold to use the fast (whole ellipse) # technique or accurate (partial arcs) technique. size = affine_transform( - npy.array([[self.width, self.height]], npy.float_), + npy.array([[width, height]], npy.float_), mainTrans) width = size[0,0] height = size[0,1] Modified: trunk/matplotlib/unit/ellipse_large.py =================================================================== --- trunk/matplotlib/unit/ellipse_large.py 2007-12-21 15:13:14 UTC (rev 4784) +++ trunk/matplotlib/unit/ellipse_large.py 2007-12-21 16:22:42 UTC (rev 4785) @@ -6,7 +6,7 @@ import math from pylab import * -from matplotlib.patches import Ellipse +from matplotlib.patches import Ellipse, Arc # given a point x, y x = 2692.440 @@ -47,39 +47,75 @@ ellipseLine = ax.plot( xs, ys, **kwargs ) + + ################################################## # make the axes -ax = subplot( 211, aspect='equal' ) -ax.set_aspect( 'equal', 'datalim' ) +ax1 = subplot( 311, aspect='equal' ) +ax1.set_aspect( 'equal', 'datalim' ) # make the lower-bound ellipse diam = (r - delta) * 2.0 lower_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkgreen" ) -ax.add_patch( lower_ellipse ) +ax1.add_patch( lower_ellipse ) # make the target ellipse diam = r * 2.0 target_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkred" ) -ax.add_patch( target_ellipse ) +ax1.add_patch( target_ellipse ) # make the upper-bound ellipse diam = (r + delta) * 2.0 upper_ellipse = Ellipse( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkblue" ) -ax.add_patch( upper_ellipse ) +ax1.add_patch( upper_ellipse ) # make the target diam = delta * 2.0 target = Ellipse( (x, y), diam, diam, 0.0, fill=False, edgecolor="#DD1208" ) +ax1.add_patch( target ) + +# give it a big marker +ax1.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + +################################################## +# make the axes +ax = subplot( 312, aspect='equal' , sharex=ax1, sharey=ax1) +ax.set_aspect( 'equal', 'datalim' ) + +# make the lower-bound arc +diam = (r - delta) * 2.0 +lower_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkgreen" ) +ax.add_patch( lower_arc ) + +# make the target arc +diam = r * 2.0 +target_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkred" ) +ax.add_patch( target_arc ) + +# make the upper-bound arc +diam = (r + delta) * 2.0 +upper_arc = Arc( (0.0, 0.0), diam, diam, 0.0, fill=False, edgecolor="darkblue" ) +ax.add_patch( upper_arc ) + +# make the target +diam = delta * 2.0 +target = Arc( (x, y), diam, diam, 0.0, fill=False, edgecolor="#DD1208" ) ax.add_patch( target ) # give it a big marker ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + + + + ################################################## # now lets do the same thing again using a custom ellipse function + + # make the axes -ax = subplot( 212, aspect='equal', sharex=ax, sharey=ax ) +ax = subplot( 313, aspect='equal', sharex=ax1, sharey=ax1 ) ax.set_aspect( 'equal', 'datalim' ) # make the lower-bound ellipse @@ -97,11 +133,17 @@ # give it a big marker ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + +# give it a big marker +ax.plot( [x], [y], marker='x', linestyle='None', mfc='red', mec='red', markersize=10 ) + ################################################## # lets zoom in to see the area of interest -ax.set_xlim(2650, 2735) -ax.set_ylim(6705, 6735) +ax1.set_xlim(2650, 2735) +ax1.set_ylim(6705, 6735) + +savefig("ellipse") show() -savefig("ellipse") + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-12-21 18:53:30
|
Revision: 4786 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4786&view=rev Author: jswhit Date: 2007-12-21 10:53:29 -0800 (Fri, 21 Dec 2007) Log Message: ----------- return masked array if data equals default netcdf _FillValue for that data type. Modified Paths: -------------- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py =================================================================== --- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py 2007-12-21 16:22:42 UTC (rev 4785) +++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py 2007-12-21 18:53:29 UTC (rev 4786) @@ -31,7 +31,8 @@ import itertools import mmap -from numpy import ndarray, empty, array, ma, squeeze +from numpy import ndarray, empty, array, ma, squeeze, zeros +import numpy from dap.client import open as open_remote from dap.dtypes import ArrayType, GridType, typemap @@ -55,6 +56,19 @@ NC_ATTRIBUTE = '\x00\x00\x00\x0c' _typecodes = dict([[_v,_k] for _k,_v in typemap.items()]) +# default _FillValue for netcdf types (apply also to corresponding +# DAP types). +_default_fillvals = {'c':'\0', + 'S':"", + 'b':-127, + 'B':-127, + 'h':-32767, + 'H':65535, + 'i':-2147483647L, + 'L':4294967295L, + 'q':-2147483647L, + 'f':9.9692099683868690e+36, + 'd':9.9692099683868690e+36} def NetCDFFile(file, maskandscale=True): """NetCDF File reader. API is the same as Scientific.IO.NetCDF. @@ -95,12 +109,21 @@ return f def _maskandscale(var,datout): + totalmask = zeros(datout.shape,numpy.bool) + fillval = None if hasattr(var, 'missing_value') and (datout == var.missing_value).any(): - datout = ma.masked_array(datout,mask=datout==var.missing_value, - fill_value=var.missing_value) - elif hasattr(var, '_FillValue') and (datout == var._FillValue).any(): - datout = ma.masked_array(datout,mask=datout==var._FillValue, - fill_value=var._FillValue) + fillval = var.missing_value + totalmask = totalmask + datout==fillval + if hasattr(var, '_FillValue') and (datout == var._FillValue).any(): + if fillval is None: + fillval = var._FillValue + totalmask = totalmask + datout==var._FillValue + elif (datout == _default_fillvals[var.typecode()]).any(): + if fillval is None: + fillval = _default_fillvals[var.typecode()] + totalmask = totalmask + datout==_default_fillvals[var.dtype] + if fillval is not None: + datout = ma.masked_array(datout,mask=totalmask,fill_value=fillval) try: datout = var.scale_factor*datout + var.add_offset except: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-21 15:15:04
|
Revision: 4784 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4784&view=rev Author: mdboom Date: 2007-12-21 07:13:14 -0800 (Fri, 21 Dec 2007) Log Message: ----------- Update unit test to use Arc instead of Ellipse. Modified Paths: -------------- branches/transforms/unit/ellipse_compare.py Modified: branches/transforms/unit/ellipse_compare.py =================================================================== --- branches/transforms/unit/ellipse_compare.py 2007-12-21 15:08:38 UTC (rev 4783) +++ branches/transforms/unit/ellipse_compare.py 2007-12-21 15:13:14 UTC (rev 4784) @@ -36,7 +36,7 @@ ax = fig.add_subplot(212, aspect='equal') ax.fill(x, y, alpha=0.2, facecolor='green', edgecolor='green', zorder=1) -e2 = patches.Ellipse((xcenter, ycenter), width, height, +e2 = patches.Arc((xcenter, ycenter), width, height, angle=angle, linewidth=2, fill=False, zorder=2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-21 15:09:15
|
Revision: 4783 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4783&view=rev Author: mdboom Date: 2007-12-21 07:08:38 -0800 (Fri, 21 Dec 2007) Log Message: ----------- Add size-dependent highly-accurate arc drawing. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/patches.py Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2007-12-20 17:18:12 UTC (rev 4782) +++ trunk/matplotlib/lib/matplotlib/patches.py 2007-12-21 15:08:38 UTC (rev 4783) @@ -973,6 +973,337 @@ __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd +class Arc(Ellipse): + """ + An elliptical arc. Because it performs various optimizations, it + can not be filled. + """ + def __str__(self): + return "Arc(%d,%d;%dx%d)"%(self.center[0],self.center[1],self.width,self.height) + + def __init__(self, xy, width, height, angle=0.0, theta1=0.0, theta2=360.0, **kwargs): + """ + xy - center of ellipse + width - length of horizontal axis + height - length of vertical axis + angle - rotation in degrees (anti-clockwise) + theta1 - starting angle of the arc in degrees + theta2 - ending angle of the arc in degrees + + If theta1 and theta2 are not provided, the arc will form a + complete ellipse. + + Valid kwargs are: + %(Patch)s + """ + fill = kwargs.pop('fill') + if fill: + raise ValueError("Arc objects can not be filled") + kwargs['fill'] = False + + Ellipse.__init__(self, xy, width, height, angle, **kwargs) + + self._theta1 = theta1 + self._theta2 = theta2 + + def draw(self, renderer): + """ + Ellipses are normally drawn using an approximation that uses + eight cubic bezier splines. The error of this approximation + is 1.89818e-6, according to this unverified source: + + Lancaster, Don. Approximating a Circle or an Ellipse Using + Four Bezier Cubic Splines. + + http://www.tinaja.com/glib/ellipse4.pdf + + There is a use case where very large ellipses must be drawn + with very high accuracy, and it is too expensive to render the + entire ellipse with enough segments (either splines or line + segments). Therefore, in the case where either radius of the + ellipse is large enough that the error of the spline + approximation will be visible (greater than one pixel offset + from the ideal), a different technique is used. + + In that case, only the visible parts of the ellipse are drawn, + with each visible arc using a fixed number of spline segments + (8), which should be adequate when the number of pixels across + the image is less than 5e5. The algorithm proceeds as + follows: + + 1. The points where the ellipse intersects the axes bounding + box are located. (This is done be performing an inverse + transformation on the axes bbox such that it is relative to + the unit circle -- this makes the intersection calculation + much easier than doing rotated ellipse intersection + directly). + + This uses the "line intersecting a circle" algorithm from: + + Vince, John. Geometry for Computer Graphics: Formulae, + Examples & Proofs. London: Springer-Verlag, 2005. + + 2. The angles of each of the intersection points are + calculated. + + 3. Proceeding counterclockwise starting in the positive + x-direction, each of the visible arc-segments between each + pair of intersections are drawn using the bezier arc + approximation technique implemented in arc(). + """ + # Do the usual GC handling stuff + if not self.get_visible(): return + gc = renderer.new_gc() + gc.set_foreground(self._edgecolor) + gc.set_linewidth(self._linewidth) + gc.set_alpha(self._alpha) + gc.set_antialiased(self._antialiased) + self._set_gc_clip(gc) + gc.set_capstyle('projecting') + if not self.fill or self._facecolor is None: rgbFace = None + else: rgbFace = colors.colorConverter.to_rgb(self._facecolor) + if self._hatch: + gc.set_hatch(self._hatch ) + + def iter_circle_intersect_on_line(x0, y0, x1, y1): + dx = x1 - x0 + dy = y1 - y0 + dr2 = dx*dx + dy*dy + D = x0*y1 - x1*y0 + D2 = D*D + discrim = dr2 - D2 + + # Single (tangential) intersection + if discrim == 0.0: + x = (D*dy) / dr2 + y = (-D*dx) / dr2 + yield x, y + elif discrim > 0.0: + # The definition of "sign" here is different from + # npy.sign: we never want to get 0.0 + if dy < 0.0: + sign_dy = -1.0 + else: + sign_dy = 1.0 + sqrt_discrim = npy.sqrt(discrim) + for sign in (1., -1.): + x = (D*dy + sign * sign_dy * dx * sqrt_discrim) / dr2 + y = (-D*dx + sign * npy.abs(dy) * sqrt_discrim) / dr2 + yield x, y + + def iter_circle_intersect_on_line_seg(x0, y0, x1, y1): + epsilon = 1e-9 + if x1 < x0: + x0e, x1e = x1, x0 + else: + x0e, x1e = x0, x1 + if y1 < y0: + y0e, y1e = y1, y0 + else: + y0e, y1e = y0, y1 + x0e -= epsilon + y0e -= epsilon + x1e += epsilon + y1e += epsilon + for x, y in iter_circle_intersect_on_line(x0, y0, x1, y1): + if x >= x0e and x <= x1e and y >= y0e and y <= y1e: + yield x, y + + def arc(theta1, theta2, trans, n=None): + """ + Returns an arc on the unit circle from angle theta1 to + angle theta2 (in degrees). The returned arc is already + transformed using the affine transformation matrix trans. + The arc is returned as an agg::path_storage object. + + If n is provided, it is the number of spline segments to make. + If n is not provided, the number of spline segments is determined + based on the delta between theta1 and theta2. + """ + # From Masionobe, L. 2003. "Drawing an elliptical arc using + # polylines, quadratic or cubic Bezier curves". + # + # http://www.spaceroots.org/documents/ellipse/index.html + + # degrees to radians + theta1 *= npy.pi / 180.0 + theta2 *= npy.pi / 180.0 + + twopi = npy.pi * 2.0 + halfpi = npy.pi * 0.5 + + eta1 = npy.arctan2(npy.sin(theta1), npy.cos(theta1)) + eta2 = npy.arctan2(npy.sin(theta2), npy.cos(theta2)) + eta2 -= twopi * npy.floor((eta2 - eta1) / twopi) + if (theta2 - theta1 > npy.pi) and (eta2 - eta1 < npy.pi): + eta2 += twopi + + # number of curve segments to make + if n is None: + n = int(2 ** npy.ceil((eta2 - eta1) / halfpi)) + + deta = (eta2 - eta1) / n + t = npy.tan(0.5 * deta) + alpha = npy.sin(deta) * (npy.sqrt(4.0 + 3.0 * t * t) - 1) / 3.0 + + steps = npy.linspace(eta1, eta2, n + 1, True) + cos_eta = npy.cos(steps) + sin_eta = npy.sin(steps) + + xA = cos_eta[:-1] + yA = sin_eta[:-1] + xA_dot = -yA + yA_dot = xA + + xB = cos_eta[1:] + yB = sin_eta[1:] + xB_dot = -yB + yB_dot = xB + + length = n * 3 + 1 + vertices = npy.zeros((length, 2), npy.float_) + vertices[0] = [xA[0], yA[0]] + end = length + + vertices[1::3, 0] = xA + alpha * xA_dot + vertices[1::3, 1] = yA + alpha * yA_dot + vertices[2::3, 0] = xB - alpha * xB_dot + vertices[2::3, 1] = yB - alpha * yB_dot + vertices[3::3, 0] = xB + vertices[3::3, 1] = yB + + vertices = affine_transform(vertices, trans) + + path = agg.path_storage() + path.move_to(*vertices[0]) + for i in range(1, length, 3): + path.curve4(*vertices[i:i+3].flat) + return path + + def point_in_polygon(x, y, poly): + inside = False + for i in range(len(poly) - 1): + p1x, p1y = poly[i] + p2x, p2y = poly[i+1] + if p1x < p2x: + xmin, xmax = p1x, p2x + else: + xmin, xmax = p2x, p1x + if p1y < p2y: + ymin, ymax = p1y, p2y + else: + ymin, ymax = p2y, p1y + if (y > ymin and + y <= ymax and + x <= xmax): + xinters = (y-p1y)*(p2x-p1x)/(p2y-p1y)+p1x + if p1x == p2x or x <= xinters: + inside = not inside + return inside + + def affine_transform(vertices, transform): + # This may seem silly, but it's faster than expanding the + # vertices array to Nx3 and then back to Nx2 + transform = transform.copy() + transform[0, 1], transform[1, 0] = transform[1, 0], transform[0, 1] + vertices = npy.dot(vertices, transform[0:2, 0:2]) + vertices += transform[0:2, 2:].flat + return vertices + + # Set up the master transform from unit circle, all the way to + # display space. + trans = self.get_transform() + scale = npy.array( + [[self.width * 0.5, 0.0, 0.0], + [0.0, self.height * 0.5, 0.0], + [0.0, 0.0, 1.0]], npy.float_) + theta = (self.angle / 180.0) * npy.pi + rotate = npy.array( + [[npy.cos(theta), -npy.sin(theta), 0.0], + [npy.sin(theta), npy.cos(theta), 0.0], + [0.0, 0.0, 1.0]], npy.float_) + translate = npy.array( + [[1.0, 0.0, self.center[0]], + [0.0, 1.0, self.center[1]], + [0.0, 0.0, 1.0]], npy.float_) + sx, b, c, sy, tx, ty = trans.as_vec6_val() + dataTrans = npy.array( + [[sx, b, tx], + [c, sy, ty], + [0, 0, 1]], npy.float_) + mainTrans = \ + npy.dot( + npy.dot( + npy.dot(dataTrans, translate), rotate), scale) + + # Determine the size of the ellipse in pixels, and use + # that as a threshold to use the fast (whole ellipse) + # technique or accurate (partial arcs) technique. + size = affine_transform( + npy.array([[self.width, self.height]], npy.float_), + mainTrans) + width = size[0,0] + height = size[0,1] + # We divide the error in half, to just be *really* + # conservative + inv_error = (1.0 / 1.89818e-6) * 0.5 + + if width < inv_error and height < inv_error: + path = arc(self._theta1, self._theta2, mainTrans) + renderer.draw_path(gc, rgbFace, path) + return + + # Transforms the axes box_path so that it is relative to the unit + # circle in the same way that it is relative to the desired + # ellipse. + axes_bbox = self.axes.bbox + box_path = npy.array( + [[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]], + npy.float_) + axesTrans = npy.array( + [[axes_bbox.width(), 0.0, axes_bbox.xmin()], + [0.0, axes_bbox.height(), axes_bbox.ymin()], + [0.0, 0.0, 1.0]], npy.float_) + boxTrans = npy.dot(npy.linalg.inv(mainTrans), axesTrans) + box_path = affine_transform(box_path, boxTrans) + + PI = npy.pi + TWOPI = PI * 2.0 + RAD2DEG = 180.0 / PI + DEG2RAD = PI / 180.0 + theta1 = self._theta1 + theta2 = self._theta2 + thetas = {} + # For each of the point pairs, there is a line segment + for p0, p1 in zip(box_path[:-1], box_path[1:]): + x0, y0 = p0 + x1, y1 = p1 + for x, y in iter_circle_intersect_on_line_seg(x0, y0, x1, y1): + theta = npy.arccos(x) + if y < 0: + theta = TWOPI - theta + # Convert radians to angles + theta *= RAD2DEG + if theta > theta1 and theta < theta2: + thetas[theta] = None + + thetas = thetas.keys() + thetas.sort() + thetas.append(theta2) + + last_theta = theta1 + theta1_rad = theta1 * DEG2RAD + inside = point_in_polygon(npy.cos(theta1_rad), npy.sin(theta1_rad), box_path) + for theta in thetas: + if inside: + path = arc(last_theta, theta, mainTrans, 8) + renderer.draw_path(gc, rgbFace, path) + inside = False + else: + inside = True + last_theta = theta + + class PolygonInteractor: """ An polygon editor. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-20 17:18:18
|
Revision: 4782 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4782&view=rev Author: mdboom Date: 2007-12-20 09:18:12 -0800 (Thu, 20 Dec 2007) Log Message: ----------- Major speed improvement for non-rectilinear projections. Modified Paths: -------------- branches/transforms/lib/matplotlib/axis.py branches/transforms/lib/matplotlib/lines.py branches/transforms/lib/matplotlib/transforms.py Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-12-20 17:14:36 UTC (rev 4781) +++ branches/transforms/lib/matplotlib/axis.py 2007-12-20 17:18:12 UTC (rev 4782) @@ -304,6 +304,11 @@ 'Set the location of tick in data coords with scalar loc' x = loc + nonlinear = (hasattr(self.axes, 'yaxis') and + self.axes.yaxis.get_scale() != 'linear' or + hasattr(self.axes, 'xaxis') and + self.axes.xaxis.get_scale() != 'linear') + if self.tick1On: self.tick1line.set_xdata((x,)) if self.tick2On: @@ -314,6 +319,12 @@ self.label1.set_x(x) if self.label2On: self.label2.set_x(x) + + if nonlinear: + self.tick1line._invalid = True + self.tick2line._invalid = True + self.gridline._invalid = True + self._loc = loc def get_view_interval(self): @@ -425,6 +436,12 @@ def update_position(self, loc): 'Set the location of tick in data coords with scalar loc' y = loc + + nonlinear = (hasattr(self.axes, 'yaxis') and + self.axes.yaxis.get_scale() != 'linear' or + hasattr(self.axes, 'xaxis') and + self.axes.xaxis.get_scale() != 'linear') + if self.tick1On: self.tick1line.set_ydata((y,)) if self.tick2On: @@ -435,6 +452,11 @@ self.label1.set_y( y ) if self.label2On: self.label2.set_y( y ) + if nonlinear: + self.tick1line._invalid = True + self.tick2line._invalid = True + self.gridline._invalid = True + self._loc = loc Modified: branches/transforms/lib/matplotlib/lines.py =================================================================== --- branches/transforms/lib/matplotlib/lines.py 2007-12-20 17:14:36 UTC (rev 4781) +++ branches/transforms/lib/matplotlib/lines.py 2007-12-20 17:18:12 UTC (rev 4782) @@ -396,9 +396,6 @@ self._xorig = x self._yorig = y self._invalid = True - else: - if hasattr(self, "_transformed_path"): - self._transformed_path._invalid = self._transformed_path.INVALID_NON_AFFINE def recache(self): #if self.axes is None: print 'recache no axes' Modified: branches/transforms/lib/matplotlib/transforms.py =================================================================== --- branches/transforms/lib/matplotlib/transforms.py 2007-12-20 17:14:36 UTC (rev 4781) +++ branches/transforms/lib/matplotlib/transforms.py 2007-12-20 17:18:12 UTC (rev 4782) @@ -93,22 +93,24 @@ """ # If we are an affine transform being changed, we can set the # flag to INVALID_AFFINE_ONLY - value = ((self.is_affine or self.is_bbox) - and self.INVALID_AFFINE - or self.INVALID) + value = (self.is_affine) and self.INVALID_AFFINE or self.INVALID # Shortcut: If self is already invalid, that means its parents # are as well, so we don't need to do anything. - if self._invalid == value or not len(self._parents): + if self._invalid == value: return + if not len(self._parents): + self._invalid = value + return + # Invalidate all ancestors of self using pseudo-recursion. parent = None stack = [self] while len(stack): root = stack.pop() # Stop at subtrees that have already been invalidated - if root._invalid == 0 or root.pass_through: + if root._invalid != value or root.pass_through: root._invalid = value stack.extend(root._parents.keys()) @@ -198,6 +200,7 @@ read-only access to its data. """ is_bbox = True + is_affine = True #* Redundant: Removed for performance # @@ -208,6 +211,7 @@ def _check(points): if ma.isMaskedArray(points): warnings.warn("Bbox bounds are a masked array.") + points = npy.asarray(points) if (points[1,0] - points[0,0] == 0 or points[1,1] - points[0,1] == 0): warnings.warn("Singular Bbox.") @@ -1011,6 +1015,8 @@ transform may only be replaced with another child transform of the same dimensions. """ + pass_through = True + def __init__(self, child): """ child: A Transform instance. This child may later be replaced @@ -1546,7 +1552,6 @@ This version is an optimization for the case where both child transforms are of type Affine2DBase. """ - is_separable = True def __init__(self, x_transform, y_transform): @@ -1917,8 +1922,8 @@ the transform already applied, along with the affine part of the path necessary to complete the transformation. """ - if (self._invalid & self.INVALID_NON_AFFINE or - self._transformed_path is None): + if ((self._invalid & self.INVALID_NON_AFFINE == self.INVALID_NON_AFFINE) + or self._transformed_path is None): self._transformed_path = \ self._transform.transform_path_non_affine(self._path) self._invalid = 0 @@ -1928,7 +1933,7 @@ """ Return a fully-transformed copy of the child path. """ - if (self._invalid & self.INVALID_NON_AFFINE + if ((self._invalid & self.INVALID_NON_AFFINE == self.INVALID_NON_AFFINE) or self._transformed_path is None): self._transformed_path = \ self._transform.transform_path_non_affine(self._path) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-20 17:14:55
|
Revision: 4781 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4781&view=rev Author: mdboom Date: 2007-12-20 09:14:36 -0800 (Thu, 20 Dec 2007) Log Message: ----------- Remove Mollweide from options, since it's currently broken anyway. Modified Paths: -------------- branches/transforms/lib/matplotlib/projections/__init__.py Modified: branches/transforms/lib/matplotlib/projections/__init__.py =================================================================== --- branches/transforms/lib/matplotlib/projections/__init__.py 2007-12-20 17:14:03 UTC (rev 4780) +++ branches/transforms/lib/matplotlib/projections/__init__.py 2007-12-20 17:14:36 UTC (rev 4781) @@ -1,4 +1,4 @@ -from geo import AitoffAxes, HammerAxes, MolleweideAxes, LambertAxes +from geo import AitoffAxes, HammerAxes, LambertAxes from polar import PolarAxes from matplotlib import axes @@ -25,7 +25,6 @@ PolarAxes, AitoffAxes, HammerAxes, - MolleweideAxes, LambertAxes) def get_projection_class(projection): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-20 17:14:29
|
Revision: 4780 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4780&view=rev Author: mdboom Date: 2007-12-20 09:14:03 -0800 (Thu, 20 Dec 2007) Log Message: ----------- I can't spell ;( Modified Paths: -------------- branches/transforms/lib/matplotlib/projections/geo.py Modified: branches/transforms/lib/matplotlib/projections/geo.py =================================================================== --- branches/transforms/lib/matplotlib/projections/geo.py 2007-12-20 16:54:34 UTC (rev 4779) +++ branches/transforms/lib/matplotlib/projections/geo.py 2007-12-20 17:14:03 UTC (rev 4780) @@ -397,12 +397,12 @@ return self.HammerTransform(resolution) -class MolleweideAxes(GeoAxes): - name = 'molleweide' +class MollweideAxes(GeoAxes): + name = 'mollweide' - class MolleweideTransform(Transform): + class MollweideTransform(Transform): """ - The base Molleweide transform. + The base Mollweide transform. """ input_dims = 2 output_dims = 2 @@ -410,9 +410,9 @@ def __init__(self, resolution): """ - Create a new Molleweide transform. Resolution is the number of steps + Create a new Mollweide transform. Resolution is the number of steps to interpolate between each input line segment to approximate its - path in curved Molleweide space. + path in curved Mollweide space. """ Transform.__init__(self) self._resolution = resolution @@ -441,10 +441,10 @@ transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ def inverted(self): - return MolleweideAxes.InvertedMolleweideTransform(self._resolution) + return MollweideAxes.InvertedMollweideTransform(self._resolution) inverted.__doc__ = Transform.inverted.__doc__ - class InvertedMolleweideTransform(Transform): + class InvertedMollweideTransform(Transform): input_dims = 2 output_dims = 2 is_separable = False @@ -459,7 +459,7 @@ transform.__doc__ = Transform.transform.__doc__ def inverted(self): - return MolleweideAxes.MolleweideTransform(self._resolution) + return MollweideAxes.MollweideTransform(self._resolution) inverted.__doc__ = Transform.inverted.__doc__ def __init__(self, *args, **kwargs): @@ -469,7 +469,7 @@ self.cla() def _get_core_transform(self, resolution): - return self.MolleweideTransform(resolution) + return self.MollweideTransform(resolution) class LambertAxes(GeoAxes): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-20 16:54:52
|
Revision: 4779 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4779&view=rev Author: mdboom Date: 2007-12-20 08:54:34 -0800 (Thu, 20 Dec 2007) Log Message: ----------- Minor speedup by not calculating the position of ticks/grids/text that aren't there. Modified Paths: -------------- branches/transforms/lib/matplotlib/axis.py Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-12-20 13:01:07 UTC (rev 4778) +++ branches/transforms/lib/matplotlib/axis.py 2007-12-20 16:54:34 UTC (rev 4779) @@ -94,14 +94,14 @@ self.label = self.label1 # legacy name self.label2 = self._get_text2() - self.update_position(loc) - self.gridOn = gridOn self.tick1On = tick1On self.tick2On = tick2On self.label1On = label1On self.label2On = label2On + self.update_position(loc) + def get_children(self): children = [self.tick1line, self.tick2line, self.gridline, self.label1, self.label2] return children @@ -304,11 +304,16 @@ 'Set the location of tick in data coords with scalar loc' x = loc - self.tick1line.set_xdata((x,)) - self.tick2line.set_xdata((x,)) - self.gridline.set_xdata((x, )) - self.label1.set_x(x) - self.label2.set_x(x) + if self.tick1On: + self.tick1line.set_xdata((x,)) + if self.tick2On: + self.tick2line.set_xdata((x,)) + if self.gridOn: + self.gridline.set_xdata((x,)) + if self.label1On: + self.label1.set_x(x) + if self.label2On: + self.label2.set_x(x) self._loc = loc def get_view_interval(self): @@ -420,13 +425,16 @@ def update_position(self, loc): 'Set the location of tick in data coords with scalar loc' y = loc - self.tick1line.set_ydata((y,)) - self.tick2line.set_ydata((y,)) - self.gridline.set_ydata((y, )) - - self.label1.set_y( y ) - self.label2.set_y( y ) - + if self.tick1On: + self.tick1line.set_ydata((y,)) + if self.tick2On: + self.tick2line.set_ydata((y,)) + if self.gridOn: + self.gridline.set_ydata((y, )) + if self.label1On: + self.label1.set_y( y ) + if self.label2On: + self.label2.set_y( y ) self._loc = loc @@ -1231,6 +1239,8 @@ for t in ticks: t.tick1On = True t.tick2On = True + for t in ticks: + t.update_position(t._loc) def tick_top(self): 'use ticks only on top' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-20 13:01:11
|
Revision: 4778 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4778&view=rev Author: mdboom Date: 2007-12-20 05:01:07 -0800 (Thu, 20 Dec 2007) Log Message: ----------- Minor efficiency improvement. Modified Paths: -------------- branches/transforms/src/_backend_agg.cpp Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-12-20 13:00:48 UTC (rev 4777) +++ branches/transforms/src/_backend_agg.cpp 2007-12-20 13:01:07 UTC (rev 4778) @@ -363,6 +363,9 @@ double x0, y0, x1, y1; unsigned code; + if (path.total_vertices() > 15) + return false; + code = path.vertex(&x0, &y0); trans.transform(&x0, &y0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-20 13:00:49
|
Revision: 4777 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4777&view=rev Author: mdboom Date: 2007-12-20 05:00:48 -0800 (Thu, 20 Dec 2007) Log Message: ----------- Minor bugfix in polar transforms. Modified Paths: -------------- branches/transforms/lib/matplotlib/projections/polar.py Modified: branches/transforms/lib/matplotlib/projections/polar.py =================================================================== --- branches/transforms/lib/matplotlib/projections/polar.py 2007-12-20 13:00:20 UTC (rev 4776) +++ branches/transforms/lib/matplotlib/projections/polar.py 2007-12-20 13:00:48 UTC (rev 4777) @@ -66,7 +66,7 @@ transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ def inverted(self): - return PolarAxes.InvertedPolarTransform() + return PolarAxes.InvertedPolarTransform(self._resolution) inverted.__doc__ = Transform.inverted.__doc__ class PolarAffine(Affine2DBase): @@ -107,6 +107,10 @@ output_dims = 2 is_separable = False + def __init__(self, resolution): + Transform.__init__(self) + self._resolution = resolution + def transform(self, xy): x = xy[:, 0:1] y = xy[:, 1:] @@ -117,7 +121,7 @@ transform.__doc__ = Transform.transform.__doc__ def inverted(self): - return PolarAxes.PolarTransform() + return PolarAxes.PolarTransform(self._resolution) inverted.__doc__ = Transform.inverted.__doc__ class ThetaFormatter(Formatter): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-20 13:00:24
|
Revision: 4776 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4776&view=rev Author: mdboom Date: 2007-12-20 05:00:20 -0800 (Thu, 20 Dec 2007) Log Message: ----------- Add very preliminary and experimental support for some geo projections. Modified Paths: -------------- branches/transforms/lib/matplotlib/projections/__init__.py Added Paths: ----------- branches/transforms/examples/geo_demo.py branches/transforms/lib/matplotlib/projections/geo.py Added: branches/transforms/examples/geo_demo.py =================================================================== --- branches/transforms/examples/geo_demo.py (rev 0) +++ branches/transforms/examples/geo_demo.py 2007-12-20 13:00:20 UTC (rev 4776) @@ -0,0 +1,16 @@ +import numpy as npy +npy.seterr("raise") + +from pylab import * + +subplot(221, projection="aitoff") +grid(True) + +subplot(222, projection="hammer") +grid(True) + +subplot(223, projection="lambert") +grid(True) + + +show() Modified: branches/transforms/lib/matplotlib/projections/__init__.py =================================================================== --- branches/transforms/lib/matplotlib/projections/__init__.py 2007-12-20 12:49:14 UTC (rev 4775) +++ branches/transforms/lib/matplotlib/projections/__init__.py 2007-12-20 13:00:20 UTC (rev 4776) @@ -1,3 +1,4 @@ +from geo import AitoffAxes, HammerAxes, MolleweideAxes, LambertAxes from polar import PolarAxes from matplotlib import axes @@ -21,7 +22,11 @@ projection_registry.register( axes.Axes, - PolarAxes) + PolarAxes, + AitoffAxes, + HammerAxes, + MolleweideAxes, + LambertAxes) def get_projection_class(projection): if projection is None: Added: branches/transforms/lib/matplotlib/projections/geo.py =================================================================== --- branches/transforms/lib/matplotlib/projections/geo.py (rev 0) +++ branches/transforms/lib/matplotlib/projections/geo.py 2007-12-20 13:00:20 UTC (rev 4776) @@ -0,0 +1,597 @@ +import math + +import numpy as npy +from matplotlib.numerix import npyma as ma + +import matplotlib +rcParams = matplotlib.rcParams +from matplotlib.artist import kwdocd +from matplotlib.axes import Axes +from matplotlib import cbook +from matplotlib.patches import Circle +from matplotlib.path import Path +from matplotlib.ticker import Formatter, Locator, NullLocator, FixedLocator, NullFormatter +from matplotlib.transforms import Affine2D, Affine2DBase, Bbox, \ + BboxTransformTo, IdentityTransform, Transform, TransformWrapper + +class GeoAxes(Axes): + """ + An abstract base class for geographic projections + """ + class ThetaFormatter(Formatter): + """ + Used to format the theta tick labels. Converts the native + unit of radians into degrees and adds a degree symbol. + """ + def __init__(self, round_to=1.0): + self._round_to = round_to + + def __call__(self, x, pos=None): + degrees = (x / npy.pi) * 180.0 + degrees = round(degrees / self._round_to) * self._round_to + # \u00b0 : degree symbol + return u"%d\u00b0" % degrees + + RESOLUTION = 75 + + def cla(self): + Axes.cla(self) + + self.set_longitude_grid(30) + self.set_latitude_grid(15) + self.set_longitude_grid_ends(75) + self.xaxis.set_minor_locator(NullLocator()) + self.yaxis.set_minor_locator(NullLocator()) + self.xaxis.set_ticks_position('none') + self.yaxis.set_ticks_position('none') + + self.grid(rcParams['axes.grid']) + + Axes.set_xlim(self, -npy.pi, npy.pi) + Axes.set_ylim(self, -npy.pi / 2.0, npy.pi / 2.0) + + def _set_lim_and_transforms(self): + self.dataLim = Bbox.unit() + self.viewLim = Bbox.unit() + self.transAxes = BboxTransformTo(self.bbox) + + # Transforms the x and y axis separately by a scale factor + # It is assumed that this part will have non-linear components + self.transScale = TransformWrapper(IdentityTransform()) + + # A (possibly non-linear) projection on the (already scaled) data + self.transProjection = self._get_core_transform(self.RESOLUTION) + + self.transAffine = self._get_affine_transform() + + # The complete data transformation stack -- from data all the + # way to display coordinates + self.transData = \ + self.transProjection + \ + self.transAffine + \ + self.transAxes + + # This is the transform for longitude ticks. + self._xaxis_pretransform = \ + Affine2D() \ + .scale(1.0, self._longitude_cap * 2.0) \ + .translate(0.0, -self._longitude_cap) + self._xaxis_transform = \ + self._xaxis_pretransform + \ + self.transData + self._xaxis_text1_transform = \ + Affine2D().scale(1.0, 0.0) + \ + self.transData + \ + Affine2D().translate(0.0, 4.0) + self._xaxis_text2_transform = \ + Affine2D().scale(1.0, 0.0) + \ + self.transData + \ + Affine2D().translate(0.0, -4.0) + + # This is the transform for latitude ticks. + yaxis_stretch = Affine2D().scale(npy.pi * 2.0, 1.0).translate(-npy.pi, 0.0) + yaxis_space = Affine2D().scale(1.0, 1.1) + self._yaxis_transform = \ + yaxis_stretch + \ + self.transData + yaxis_text_base = \ + yaxis_stretch + \ + self.transProjection + \ + (yaxis_space + \ + self.transAffine + \ + self.transAxes) + self._yaxis_text1_transform = \ + yaxis_text_base + \ + Affine2D().translate(-8.0, 0.0) + self._yaxis_text2_transform = \ + yaxis_text_base + \ + Affine2D().translate(8.0, 0.0) + + def _get_affine_transform(self): + transform = self._get_core_transform(1) + xscale, _ = transform.transform_point((npy.pi, 0)) + _, yscale = transform.transform_point((0, npy.pi / 2.0)) + return Affine2D() \ + .scale(0.5 / xscale, 0.5 / yscale) \ + .translate(0.5, 0.5) + + def update_layout(self, renderer): + t_text, b_text = self.xaxis.get_text_heights(renderer) + l_text, r_text = self.yaxis.get_text_widths(renderer) + originalPosition = self.get_position(True) + title_offset = (b_text - originalPosition.transformed( + self.figure.transFigure).height) / 2.0 + self.titleOffsetTrans.clear().translate(0, title_offset) + + def get_xaxis_transform(self): + return self._xaxis_transform + + def get_xaxis_text1_transform(self, pixelPad): + return self._xaxis_text1_transform, 'bottom', 'center' + + def get_xaxis_text2_transform(self, pixelPad): + return self._xaxis_text2_transform, 'top', 'center' + + def get_yaxis_transform(self): + return self._yaxis_transform + + def get_yaxis_text1_transform(self, pixelPad): + return self._yaxis_text1_transform, 'center', 'right' + + def get_yaxis_text2_transform(self, pixelPad): + return self._yaxis_text2_transform, 'center', 'left' + + def get_axes_patch(self): + return Circle((0.5, 0.5), 0.5) + + def set_yscale(self, *args, **kwargs): + if args[0] != 'linear': + raise NotImplementedError + + set_xscale = set_yscale + + def set_xlim(self, *args, **kwargs): + Axes.set_xlim(self, -npy.pi, npy.pi) + Axes.set_ylim(self, -npy.pi / 2.0, npy.pi / 2.0) + + set_ylim = set_xlim + + def format_coord(self, long, lat): + 'return a format string formatting the coordinate' + long = long * (180.0 / npy.pi) + lat = lat * (180.0 / npy.pi) + if lat >= 0.0: + ns = 'N' + else: + ns = 'S' + if long >= 0.0: + ew = 'E' + else: + ew = 'W' + return u'%f\u00b0%s, %f\u00b0%s' % (abs(lat), ns, abs(long), ew) + + def set_longitude_grid(self, degrees): + """ + Set the number of degrees between each longitude grid. + """ + number = (360.0 / degrees) + 1 + self.xaxis.set_major_locator( + FixedLocator( + npy.linspace(-npy.pi, npy.pi, number, True)[1:-1])) + self._logitude_degrees = degrees + self.xaxis.set_major_formatter(self.ThetaFormatter(degrees)) + + def set_latitude_grid(self, degrees): + """ + Set the number of degrees between each longitude grid. + """ + number = (180.0 / degrees) + 1 + self.yaxis.set_major_locator( + FixedLocator( + npy.linspace(-npy.pi / 2.0, npy.pi / 2.0, number, True)[1:-1])) + self._latitude_degrees = degrees + self.yaxis.set_major_formatter(self.ThetaFormatter(degrees)) + + def set_longitude_grid_ends(self, degrees): + """ + Set the latitude(s) at which to stop drawing the longitude grids. + """ + self._longitude_cap = degrees * (npy.pi / 180.0) + self._xaxis_pretransform \ + .clear() \ + .scale(1.0, self._longitude_cap * 2.0) \ + .translate(0.0, -self._longitude_cap) + + def get_data_ratio(self): + ''' + Return the aspect ratio of the data itself. + ''' + return 1.0 + + ### Interactive panning + + def can_zoom(self): + """ + Return True if this axes support the zoom box + """ + return False + + def start_pan(self, x, y, button): + pass + + def end_pan(self): + pass + + def drag_pan(self, button, key, x, y): + pass + + +class AitoffAxes(GeoAxes): + name = 'aitoff' + + class AitoffTransform(Transform): + """ + The base Aitoff transform. + """ + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, resolution): + """ + Create a new Aitoff transform. Resolution is the number of steps + to interpolate between each input line segment to approximate its + path in curved Aitoff space. + """ + Transform.__init__(self) + self._resolution = resolution + + def transform(self, ll): + longitude = ll[:, 0:1] + latitude = ll[:, 1:2] + + # Pre-compute some values + half_long = longitude / 2.0 + cos_latitude = npy.cos(latitude) + + alpha = npy.arccos(cos_latitude * npy.cos(half_long)) + # Mask this array, or we'll get divide-by-zero errors + alpha = ma.masked_where(alpha == 0.0, alpha) + # We want unnormalized sinc. numpy.sinc gives us normalized + sinc_alpha = ma.sin(alpha) / alpha + + x = (cos_latitude * npy.sin(half_long)) / sinc_alpha + y = (npy.sin(latitude) / sinc_alpha) + x.set_fill_value(0.0) + y.set_fill_value(0.0) + return npy.concatenate((x.filled(), y.filled()), 1) + transform.__doc__ = Transform.transform.__doc__ + + transform_non_affine = transform + transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__ + + def transform_path(self, path): + vertices = path.vertices + ipath = path.interpolated(self._resolution) + return Path(self.transform(ipath.vertices), ipath.codes) + transform_path.__doc__ = Transform.transform_path.__doc__ + + transform_path_non_affine = transform_path + transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ + + def inverted(self): + return AitoffAxes.InvertedAitoffTransform(self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + class InvertedAitoffTransform(Transform): + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, resolution): + Transform.__init__(self) + self._resolution = resolution + + def transform(self, xy): + # MGDTODO: Math is hard ;( + return xy + transform.__doc__ = Transform.transform.__doc__ + + def inverted(self): + return AitoffAxes.AitoffTransform(self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + def __init__(self, *args, **kwargs): + self._longitude_cap = npy.pi / 2.0 + GeoAxes.__init__(self, *args, **kwargs) + self.set_aspect(0.5, adjustable='box', anchor='C') + self.cla() + + def _get_core_transform(self, resolution): + return self.AitoffTransform(resolution) + + +class HammerAxes(GeoAxes): + name = 'hammer' + + class HammerTransform(Transform): + """ + The base Hammer transform. + """ + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, resolution): + """ + Create a new Hammer transform. Resolution is the number of steps + to interpolate between each input line segment to approximate its + path in curved Hammer space. + """ + Transform.__init__(self) + self._resolution = resolution + + def transform(self, ll): + longitude = ll[:, 0:1] + latitude = ll[:, 1:2] + + # Pre-compute some values + half_long = longitude / 2.0 + cos_latitude = npy.cos(latitude) + sqrt2 = npy.sqrt(2.0) + + alpha = 1.0 + cos_latitude * npy.cos(half_long) + x = (2.0 * sqrt2) * (cos_latitude * npy.sin(half_long)) / alpha + y = (sqrt2 * npy.sin(latitude)) / alpha + return npy.concatenate((x, y), 1) + transform.__doc__ = Transform.transform.__doc__ + + transform_non_affine = transform + transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__ + + def transform_path(self, path): + vertices = path.vertices + ipath = path.interpolated(self._resolution) + return Path(self.transform(ipath.vertices), ipath.codes) + transform_path.__doc__ = Transform.transform_path.__doc__ + + transform_path_non_affine = transform_path + transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ + + def inverted(self): + return HammerAxes.InvertedHammerTransform(self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + class InvertedHammerTransform(Transform): + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, resolution): + Transform.__init__(self) + self._resolution = resolution + + def transform(self, xy): + x = xy[:, 0:1] + y = xy[:, 1:2] + + quarter_x = 0.25 * x + half_y = 0.5 * y + z = npy.sqrt(1.0 - quarter_x*quarter_x - half_y*half_y) + longitude = 2 * npy.arctan((z*x) / (2.0 * (2.0*z*z - 1.0))) + latitude = npy.arcsin(y*z) + return npy.concatenate((longitude, latitude), 1) + transform.__doc__ = Transform.transform.__doc__ + + def inverted(self): + return HammerAxes.HammerTransform(self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + def __init__(self, *args, **kwargs): + self._longitude_cap = npy.pi / 2.0 + GeoAxes.__init__(self, *args, **kwargs) + self.set_aspect(0.5, adjustable='box', anchor='C') + self.cla() + + def _get_core_transform(self, resolution): + return self.HammerTransform(resolution) + + +class MolleweideAxes(GeoAxes): + name = 'molleweide' + + class MolleweideTransform(Transform): + """ + The base Molleweide transform. + """ + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, resolution): + """ + Create a new Molleweide transform. Resolution is the number of steps + to interpolate between each input line segment to approximate its + path in curved Molleweide space. + """ + Transform.__init__(self) + self._resolution = resolution + + def transform(self, ll): + longitude = ll[:, 0:1] + latitude = ll[:, 1:2] + + aux = 2.0 * npy.arcsin((2.0 * latitude) / npy.pi) + x = (2.0 * npy.sqrt(2.0) * longitude * npy.cos(aux)) / npy.pi + y = (npy.sqrt(2.0) * npy.sin(aux)) + + return npy.concatenate((x, y), 1) + transform.__doc__ = Transform.transform.__doc__ + + transform_non_affine = transform + transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__ + + def transform_path(self, path): + vertices = path.vertices + ipath = path.interpolated(self._resolution) + return Path(self.transform(ipath.vertices), ipath.codes) + transform_path.__doc__ = Transform.transform_path.__doc__ + + transform_path_non_affine = transform_path + transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ + + def inverted(self): + return MolleweideAxes.InvertedMolleweideTransform(self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + class InvertedMolleweideTransform(Transform): + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, resolution): + Transform.__init__(self) + self._resolution = resolution + + def transform(self, xy): + # MGDTODO: Math is hard ;( + return xy + transform.__doc__ = Transform.transform.__doc__ + + def inverted(self): + return MolleweideAxes.MolleweideTransform(self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + def __init__(self, *args, **kwargs): + self._longitude_cap = npy.pi / 2.0 + GeoAxes.__init__(self, *args, **kwargs) + self.set_aspect(0.5, adjustable='box', anchor='C') + self.cla() + + def _get_core_transform(self, resolution): + return self.MolleweideTransform(resolution) + + +class LambertAxes(GeoAxes): + name = 'lambert' + + class LambertTransform(Transform): + """ + The base Lambert transform. + """ + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, center_longitude, center_latitude, resolution): + """ + Create a new Lambert transform. Resolution is the number of steps + to interpolate between each input line segment to approximate its + path in curved Lambert space. + """ + Transform.__init__(self) + self._resolution = resolution + self._center_longitude = center_longitude + self._center_latitude = center_latitude + + def transform(self, ll): + longitude = ll[:, 0:1] + latitude = ll[:, 1:2] + clong = self._center_longitude + clat = self._center_latitude + cos_lat = npy.cos(latitude) + sin_lat = npy.sin(latitude) + diff_long = longitude - clong + cos_diff_long = npy.cos(diff_long) + + inner_k = (1.0 + + npy.sin(clat)*sin_lat + + npy.cos(clat)*cos_lat*cos_diff_long) + # Prevent divide-by-zero problems + inner_k = npy.where(inner_k == 0.0, 1e-15, inner_k) + k = npy.sqrt(2.0 / inner_k) + x = k*cos_lat*npy.sin(diff_long) + y = k*(npy.cos(clat)*sin_lat - + npy.sin(clat)*cos_lat*cos_diff_long) + + return npy.concatenate((x, y), 1) + transform.__doc__ = Transform.transform.__doc__ + + transform_non_affine = transform + transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__ + + def transform_path(self, path): + vertices = path.vertices + ipath = path.interpolated(self._resolution) + return Path(self.transform(ipath.vertices), ipath.codes) + transform_path.__doc__ = Transform.transform_path.__doc__ + + transform_path_non_affine = transform_path + transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ + + def inverted(self): + return LambertAxes.InvertedLambertTransform( + self._center_longitude, + self._center_latitude, + self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + class InvertedLambertTransform(Transform): + input_dims = 2 + output_dims = 2 + is_separable = False + + def __init__(self, center_longitude, center_latitude, resolution): + Transform.__init__(self) + self._resolution = resolution + self._center_longitude = center_longitude + self._center_latitude = center_latitude + + def transform(self, xy): + x = xy[:, 0:1] + y = xy[:, 1:2] + clong = self._center_longitude + clat = self._center_latitude + p = npy.sqrt(x*x + y*y) + p = npy.where(p == 0.0, 1e-9, p) + c = 2.0 * npy.arcsin(0.5 * p) + sin_c = npy.sin(c) + cos_c = npy.cos(c) + + lat = npy.arcsin(cos_c*npy.sin(clat) + + ((y*sin_c*npy.cos(clat)) / p)) + long = clong + npy.arctan( + (x*sin_c) / (p*npy.cos(clat)*cos_c - y*npy.sin(clat)*sin_c)) + + return npy.concatenate((long, lat), 1) + transform.__doc__ = Transform.transform.__doc__ + + def inverted(self): + return LambertAxes.LambertTransform( + self._center_longitude, + self._center_latitude, + self._resolution) + inverted.__doc__ = Transform.inverted.__doc__ + + def __init__(self, *args, **kwargs): + self._longitude_cap = npy.pi / 2.0 + self._center_longitude = kwargs.pop("center_longitude", 0.0) + self._center_latitude = kwargs.pop("center_latitude", 0.0) + GeoAxes.__init__(self, *args, **kwargs) + self.set_aspect('equal', adjustable='box', anchor='C') + self.cla() + + def cla(self): + GeoAxes.cla(self) + self.yaxis.set_major_formatter(NullFormatter()) + + def _get_core_transform(self, resolution): + return self.LambertTransform( + self._center_longitude, + self._center_latitude, + resolution) + + def _get_affine_transform(self): + return Affine2D() \ + .scale(0.25) \ + .translate(0.5, 0.5) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-12-20 12:49:17
|
Revision: 4775 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4775&view=rev Author: jswhit Date: 2007-12-20 04:49:14 -0800 (Thu, 20 Dec 2007) Log Message: ----------- fix typo, allow seconds field to be optional Modified Paths: -------------- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py =================================================================== --- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py 2007-12-19 20:51:16 UTC (rev 4774) +++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/netcdftime.py 2007-12-20 12:49:14 UTC (rev 4775) @@ -706,7 +706,7 @@ jdelta = time_value/86400. - self.tzoffset/1440. elif self.units in ['minute','minutes']: jdelta = time_value/1440. - self.tzoffset/1440. - elif self.units in ['hours','hours']: + elif self.units in ['hour','hours']: jdelta = time_value/24. - self.tzoffset/1440. elif self.units in ['day','days']: jdelta = time_value - self.tzoffset/1440. @@ -764,8 +764,10 @@ (?P<hour>\d{1,2}) # hh or h : # (?P<min>\d{1,2}) # mm or m - : # - (?P<sec>\d{1,2}) # ss or s + (?: + \: + (?P<sec>\d{1,2}) # ss or s (optional) + )? # (?: # [optional decisecond] \. # . This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-19 20:51:42
|
Revision: 4774 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4774&view=rev Author: mdboom Date: 2007-12-19 12:51:16 -0800 (Wed, 19 Dec 2007) Log Message: ----------- Fix aspect ratio bug. Modified Paths: -------------- branches/transforms/lib/matplotlib/axes.py Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-12-18 21:10:20 UTC (rev 4773) +++ branches/transforms/lib/matplotlib/axes.py 2007-12-19 20:51:16 UTC (rev 4774) @@ -1330,7 +1330,7 @@ if not self.get_visible(): return renderer.open_group('axes') - self.apply_aspect(self.get_position()) + self.apply_aspect(self.get_position(True)) if self.axison and self._frameon: self.axesPatch.draw(renderer) @@ -5079,7 +5079,7 @@ right """ - ax2 = self.figure.add_axes(self.get_position(), sharex=self, frameon=False) + ax2 = self.figure.add_axes(self.get_position(True), sharex=self, frameon=False) ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') self.yaxis.tick_left() @@ -5095,7 +5095,7 @@ top """ - ax2 = self.figure.add_axes(self.get_position(), sharey=self, frameon=False) + ax2 = self.figure.add_axes(self.get_position(True), sharey=self, frameon=False) ax2.xaxis.tick_top() ax2.xaxis.set_label_position('top') self.xaxis.tick_bottom() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-12-18 21:10:22
|
Revision: 4773 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4773&view=rev Author: mdboom Date: 2007-12-18 13:10:20 -0800 (Tue, 18 Dec 2007) Log Message: ----------- Merged revisions 4758-4772 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4768 | mdboom | 2007-12-18 14:17:13 -0500 (Tue, 18 Dec 2007) | 2 lines Update information about the backends (Ps and Pdf were not mentioned.) ........ r4769 | mdboom | 2007-12-18 15:57:40 -0500 (Tue, 18 Dec 2007) | 2 lines Update list of supported math symbols. ........ r4770 | mdboom | 2007-12-18 15:59:56 -0500 (Tue, 18 Dec 2007) | 2 lines Update list of supported backends. ........ Modified Paths: -------------- branches/transforms/lib/matplotlib/mathtext.py branches/transforms/setup.cfg.template Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4757 + /trunk/matplotlib:1-4772 Modified: branches/transforms/lib/matplotlib/mathtext.py =================================================================== --- branches/transforms/lib/matplotlib/mathtext.py 2007-12-18 21:09:25 UTC (rev 4772) +++ branches/transforms/lib/matplotlib/mathtext.py 2007-12-18 21:10:20 UTC (rev 4773) @@ -81,48 +81,85 @@ Allowed TeX symbols: - [MGDTODO: This list is no longer exhaustive and needs to be updated] + $ \% \AA \AE \BbbC \BbbN \BbbP \BbbQ \BbbR \BbbZ \Bumpeq \Cap \Colon + \Cup \Delta \Doteq \Downarrow \Equiv \Finv \Gamma \H \Im \L \Lambda + \Ldsh \Leftarrow \Leftrightarrow \Lleftarrow \Lsh \Nearrow \Nwarrow + \O \OE \Omega \P \Phi \Pi \Psi \Rdsh \Re \Rightarrow \Rrightarrow + \Rsh \S \Searrow \Sigma \Subset \Supset \Swarrow \Theta \Uparrow + \Updownarrow \Upsilon \Vdash \Vert \Vvdash \Xi \_ \__sqrt__ \ac + \acute \acwopencirclearrow \adots \ae \aleph \alpha \angle \approx + \approxeq \approxident \arceq \ast \asymp \backcong \backprime + \backsim \backsimeq \backslash \bar \barleftarrow \barwedge \because + \beta \beth \between \bigcap \bigcirc \bigcup \bigodot \bigoplus + \bigotimes \bigstar \bigtriangledown \bigtriangleup \biguplus + \bigvee \bigwedge \blacksquare \blacktriangle \blacktriangledown + \blacktriangleleft \blacktriangleright \bot \bowtie \boxbar \boxdot + \boxminus \boxplus \boxtimes \breve \bullet \bumpeq \c \candra \cap + \carriagereturn \cdot \cdotp \cdots \check \checkmark \chi \circ + \circeq \circledR \circledS \circledast \circledcirc \circleddash + \circumflexaccent \clubsuit \clubsuitopen \colon \coloneq + \combiningacuteaccent \combiningbreve \combiningdiaeresis + \combiningdotabove \combininggraveaccent \combiningoverline + \combiningrightarrowabove \combiningtilde \complement \cong \coprod + \copyright \cup \cupdot \curlyeqprec \curlyeqsucc \curlyvee + \curlywedge \curvearrowleft \curvearrowright \cwopencirclearrow \d + \dag \daleth \danger \dashv \ddag \ddddot \dddot \ddot \ddots + \degree \delta \diamond \diamondsuit \digamma \div \divideontimes + \dot \doteq \dotminus \dotplus \dots \doublebarwedge ? \downarrow + \downdownarrows \downharpoonleft \downharpoonright \downzigzagarrow + \ell \emdash \emptyset \endash \enspace \epsilon \eqcirc \eqcolon + \eqdef \eqgtr \eqless \eqsim \equiv \eta \eth \exists \fallingdotseq + \flat \forall \frakC \frakZ \frown \gamma \geq \geqq \gg \ggg \gimel + \gneqq \gnsim \grave \greater \gtrdot \gtreqless \gtrless \gtrsim + \hat \heartsuit \hookleftarrow \hookrightarrow \i \iiint \iint + \imageof \imath \in \infty \int \intercal \invnot \iota \jmath \k + \kappa \kernelcontraction \l \lambda \lambdabar \lasp \lbrace + \lbrack \lceil \leftangle \leftarrow \leftarrowtail \leftbrace + \leftharpoonaccent \leftharpoondown \leftharpoonup \leftleftarrows + \leftparen \leftrightarrow \leftrightarrows \leftrightharpoons + \leftthreetimes \leq \leqq \less \lessdot \lesseqgtr \lessgtr + \lesssim \lfloor \ll \llcorner \lll \lneqq \lnsim \looparrowleft + \looparrowright \lq \lrcorner \ltimes \maltese \mapsdown \mapsfrom + \mapsto \mapsup \measeq \measuredangle \mho \mid \minus \models \mp + \mu \multimap \nLeftarrow \nLeftrightarrow \nRightarrow \nVDash + \nVdash \nabla \napprox \natural \ncong \ne \nearrow \neg \nequiv + \nexists \ngeq \ngtr \ni \nleftarrow \nleftrightarrow \nleq \nless + \nmid \not \notin \nparallel \nprec \nrightarrow \nsim \nsime + \nsubset \nsubseteq \nsucc \nsupset \nsupseteq \ntriangleleft + \ntrianglelefteq \ntriangleright \ntrianglerighteq \nu \nvDash + \nvdash \nwarrow \o \obar \ocirc \odot \oe \oiiint \oiint \oint + \omega \ominus \oplus \origof \oslash \otimes \overarc + \overleftarrow \overleftrightarrow \parallel \partial \phi \pi + \pitchfork \pm \prec \preccurlyeq \preceq \precnsim \precsim \prime + \prod \propto \prurel \psi \quad \questeq \rasp \rbrace \rbrack + \rceil \rfloor \rho \rightangle \rightarrow \rightarrowbar + \rightarrowtail \rightbrace \rightharpoonaccent \rightharpoondown + \rightharpoonup \rightleftarrows \rightleftharpoons \rightparen + \rightrightarrows \rightthreetimes \rightzigzagarrow \risingdotseq + \rq \rtimes \scrB \scrE \scrF \scrH \scrI \scrL \scrM \scrR \scre + \scrg \scro \scurel \searrow \sharp \sigma \sim \simeq \slash + \smallsetminus \smile \solbar \spadesuit \spadesuitopen + \sphericalangle \sqcap \sqcup \sqsubset \sqsubseteq \sqsupset + \sqsupseteq \ss \star \stareq \sterling \subset \subseteq \subsetneq + \succ \succcurlyeq \succeq \succnsim \succsim \sum \supset \supseteq + \supsetneq \swarrow \t \tau \textasciiacute \textasciicircum + \textasciigrave \textasciitilde \textexclamdown \textquestiondown + \textquotedblleft \textquotedblright \therefore \theta \thickspace + \thinspace \tilde \times \to \top \triangledown \triangleleft + \trianglelefteq \triangleq \triangleright \trianglerighteq + \turnednot \twoheaddownarrow \twoheadleftarrow \twoheadrightarrow + \twoheaduparrow \ulcorner \underbar \uparrow \updownarrow + \updownarrowbar \updownarrows \upharpoonleft \upharpoonright \uplus + \upsilon \upuparrows \urcorner \vDash \varepsilon \varkappa + \varnothing \varphi \varpi \varrho \varsigma \vartheta \vartriangle + \vartriangleleft \vartriangleright \vdash \vdots \vec \vee \veebar + \veeeq \vert \wedge \wedgeq \widehat \widetilde \wp \wr \xi \yen + \zeta \{ \| \} - \/ \Delta \Downarrow \Gamma \Im \LEFTangle \LEFTbrace \LEFTbracket - \LEFTparen \Lambda \Leftarrow \Leftbrace \Leftbracket \Leftparen - \Leftrightarrow \Omega \P \Phi \Pi \Psi \RIGHTangle \RIGHTbrace - \RIGHTbracket \RIGHTparen \Re \Rightarrow \Rightbrace \Rightbracket - \Rightparen \S \SQRT \Sigma \Sqrt \Theta \Uparrow \Updownarrow - \Upsilon \Vert \Xi \aleph \alpha \approx \angstrom \ast \asymp - \backslash \beta \bigcap \bigcirc \bigcup \bigodot \bigoplus - \bigotimes \bigtriangledown \bigtriangleup \biguplus \bigvee - \bigwedge \bot \bullet \cap \cdot \chi \circ \clubsuit \coprod \cup - \dag \dashv \ddag \delta \diamond \diamondsuit \div \downarrow \ell - \emptyset \epsilon \equiv \eta \exists \flat \forall \frown \gamma - \geq \gg \heartsuit \hspace \imath \in \infty \int \iota \jmath - \kappa \lambda \langle \lbrace \lceil \leftangle \leftarrow - \leftbrace \leftbracket \leftharpoondown \leftharpoonup \leftparen - \leftrightarrow \leq \lfloor \ll \mid \mp \mu \nabla \natural - \nearrow \neg \ni \nu \nwarrow \odot \oint \omega \ominus \oplus - \oslash \otimes \phi \pi \pm \prec \preceq \prime \prod \propto \psi - \rangle \rbrace \rceil \rfloor \rho \rightangle \rightarrow - \rightbrace \rightbracket \rightharpoondown \rightharpoonup - \rightparen \searrow \sharp \sigma \sim \simeq \slash \smile - \spadesuit \sqcap \sqcup \sqrt \sqsubseteq \sqsupseteq \subset - \subseteq \succ \succeq \sum \supset \supseteq \swarrow \tau \theta - \times \top \triangleleft \triangleright \uparrow \updownarrow - \uplus \upsilon \varepsilon \varphi \varphi \varrho \varsigma - \vartheta \vdash \vee \vert \wedge \wp \wr \xi \zeta - - BACKENDS - mathtext currently works with GTK, Agg, GTKAgg, TkAgg and WxAgg and - PS, though only horizontal and vertical rotations are supported in - *Agg + mathtext currently works with all backends. - mathtext now embeds the TrueType computer modern fonts into the PS - file, so what you see on the screen should be what you get on paper. - - Backends which don't support mathtext will just render the TeX - string as a literal. Stay tuned. - - KNOWN ISSUES: - Certainly there are some... Modified: branches/transforms/setup.cfg.template =================================================================== --- branches/transforms/setup.cfg.template 2007-12-18 21:09:25 UTC (rev 4772) +++ branches/transforms/setup.cfg.template 2007-12-18 21:10:20 UTC (rev 4773) @@ -13,12 +13,12 @@ #verbose = True [provide_packages] -# By default, matplotlib checks for a few dependencies and -# installs them if missing. This feature can be turned off +# By default, matplotlib checks for a few dependencies and +# installs them if missing. This feature can be turned off # by uncommenting the following lines. Acceptible values are: # True: install, overwrite an existing installation # False: do not install -# auto: install only if the package is unavailable. This +# auto: install only if the package is unavailable. This # is the default behavior # ## Date/timezone support: @@ -30,28 +30,28 @@ #configobj = False [gui_support] -# Matplotlib supports multiple GUI toolkits, including Cocoa, -# GTK, Fltk, Qt, Qt4, Tk, and WX. Support for many of these -# toolkits requires AGG, the Anti-Grain Geometry library, which +# Matplotlib supports multiple GUI toolkits, including Cocoa, +# GTK, Fltk, Qt, Qt4, Tk, and WX. Support for many of these +# toolkits requires AGG, the Anti-Grain Geometry library, which # is provided by matplotlib and built by default. # -# Some backends are written in pure Python, and others require -# extension code to be compiled. By default, matplotlib checks -# for these GUI toolkits during installation and, if present, -# compiles the required extensions to support the toolkit. GTK -# support requires the GTK runtime environment and PyGTK. Wx -# support requires wxWidgets and wxPython. Tk support requires -# Tk and Tkinter. The other GUI toolkits do not require any -# extension code, and can be used as long as the libraries are +# Some backends are written in pure Python, and others require +# extension code to be compiled. By default, matplotlib checks +# for these GUI toolkits during installation and, if present, +# compiles the required extensions to support the toolkit. GTK +# support requires the GTK runtime environment and PyGTK. Wx +# support requires wxWidgets and wxPython. Tk support requires +# Tk and Tkinter. The other GUI toolkits do not require any +# extension code, and can be used as long as the libraries are # installed on your system. -# +# # You can uncomment any the following lines if you know you do # not want to use the GUI toolkit. Acceptible values are: -# True: build the extension. Exits with a warning if the +# True: build the extension. Exits with a warning if the # required dependencies are not available # False: do not build the extension # auto: build if the required dependencies are available, -# otherwise skip silently. This is the default +# otherwise skip silently. This is the default # behavior # #gtk = False @@ -62,18 +62,20 @@ [rc_options] # User-configurable options # -# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, -# GTKCairo, FltkAgg, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg. -# Only the Agg and SVG backends do not require external -# dependencies. Do not choose GTK, GTKAgg, GTKCairo, TkAgg or -# WXAgg if you have disabled the relevent extension modules. -# Agg will be used by default. +# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, +# GTKCairo, FltkAgg, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg. +# +# The Agg, Ps, Pdf and SVG backends do not require external +# dependencies. Do not choose GTK, GTKAgg, GTKCairo, TkAgg or WXAgg if +# you have disabled the relevent extension modules. Agg will be used +# by default. +# #backend = Agg # -# The numerix module was historically used to provide +# The numerix module was historically used to provide # compatibility between the Numeric, numarray, and NumPy array -# packages. Now that NumPy has emerge as the universal array -# package for python, numerix is not really necessary and is -# maintained to provide backward compatibility. Do not change +# packages. Now that NumPy has emerge as the universal array +# package for python, numerix is not really necessary and is +# maintained to provide backward compatibility. Do not change # this unless you have a compelling reason to do so. #numerix = numpy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |