Revision: 7563
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7563&view=rev
Author:   jswhit
Date:     2009-08-24 23:32:07 +0000 (Mon, 24 Aug 2009)

Log Message:
-----------
pass date to nightshade method

Modified Paths:
--------------
    trunk/toolkits/basemap/examples/daynight.py

Modified: trunk/toolkits/basemap/examples/daynight.py
===================================================================
--- trunk/toolkits/basemap/examples/daynight.py 2009-08-24 22:45:15 UTC (rev 
7562)
+++ trunk/toolkits/basemap/examples/daynight.py 2009-08-24 23:32:07 UTC (rev 
7563)
@@ -64,10 +64,10 @@
     return lons2,lats2,daynight
 
 class Basemap2(Basemap):
-    def nightshade(self,color="0.5",nlons=1441,alpha=0.5,zorder=None):
+    def nightshade(self,date,color="0.5",nlons=1441,alpha=0.5,zorder=None):
         # create grid of day=0, night=1
         # 1441 means use a 0.25 degree grid.
-        lons,lats,daynight = daynightgrid(d,nlons)
+        lons,lats,daynight = daynightgrid(date,nlons)
         x,y = self(lons,lats)
         # contour the day-night grid, coloring the night area
         # with the specified color and transparency.
@@ -81,8 +81,6 @@
                c.set_zorder(zorder)
         return CS
 
-# current time in UTC.
-d = datetime.utcnow()
 
 # miller projection 
 map = Basemap2(projection='mill',lon_0=0)
@@ -95,6 +93,7 @@
 map.fillcontinents(color='coral',lake_color='aqua')
 # shade the night areas gray, with alpha transparency so the 
 # map shows through.
-CS=map.nightshade()
+# use current time in UTC.
+CS=map.nightshade(datetime.utcnow())
 plt.title('Day/Night Map for %s (UTC)' %d )
 plt.show()


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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to