Revision: 8880
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8880&view=rev
Author:   jswhit
Date:     2011-01-04 14:05:31 +0000 (Tue, 04 Jan 2011)

Log Message:
-----------
beginnings of support for astronomical conventions for longitude (via 
'celestial'
keyword).

Modified Paths:
--------------
    trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2011-01-04 
00:45:25 UTC (rev 8879)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2011-01-04 
14:05:31 UTC (rev 8880)
@@ -255,6 +255,8 @@
                   Allowed values are
                   ``C``, ``SW``, ``S``, ``SE``, ``E``, ``NE``,
                   ``N``, ``NW``, and ``W``.
+ celestial        use astronomical conventions for longitude (i.e.
+                  negative longitudes to the east of 0). Default False.
  ax               set default axes instance
                   (default None - matplotlib.pyplot.gca() may be used
                   to get the current axes instance).
@@ -443,6 +445,7 @@
                        boundinglat=None,
                        fix_aspect=True,
                        anchor='C',
+                       celestial=False,
                        ax=None):
         # docstring is added after __init__ method definition
 
@@ -451,6 +454,8 @@
         self.fix_aspect = fix_aspect
         # where to put plot in figure (default is 'C' or center)
         self.anchor = anchor
+        # geographic or celestial coords?
+        self.celestial = celestial
         # map projection.
         self.projection = projection
 
@@ -887,8 +892,13 @@
         Input arguments lon, lat can be either scalar floats,
         sequences, or numpy arrays.
         """
-        return self.projtran(x,y,inverse=inverse)
+        if self.celestial and not inverse:
+            x = -x
+        xout,yout = self.projtran(x,y,inverse=inverse)
+        if self.celestial and inverse:
+            xout = -xout
 
+
     def makegrid(self,nx,ny,returnxy=False):
         """
         return arrays of shape (ny,nx) containing lon,lat coordinates of


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to