You can subscribe to this list here.
2003 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}
(3) 
_{Jun}

_{Jul}

_{Aug}
(12) 
_{Sep}
(12) 
_{Oct}
(56) 
_{Nov}
(65) 
_{Dec}
(37) 

2004 
_{Jan}
(59) 
_{Feb}
(78) 
_{Mar}
(153) 
_{Apr}
(205) 
_{May}
(184) 
_{Jun}
(123) 
_{Jul}
(171) 
_{Aug}
(156) 
_{Sep}
(190) 
_{Oct}
(120) 
_{Nov}
(154) 
_{Dec}
(223) 
2005 
_{Jan}
(184) 
_{Feb}
(267) 
_{Mar}
(214) 
_{Apr}
(286) 
_{May}
(320) 
_{Jun}
(299) 
_{Jul}
(348) 
_{Aug}
(283) 
_{Sep}
(355) 
_{Oct}
(293) 
_{Nov}
(232) 
_{Dec}
(203) 
2006 
_{Jan}
(352) 
_{Feb}
(358) 
_{Mar}
(403) 
_{Apr}
(313) 
_{May}
(165) 
_{Jun}
(281) 
_{Jul}
(316) 
_{Aug}
(228) 
_{Sep}
(279) 
_{Oct}
(243) 
_{Nov}
(315) 
_{Dec}
(345) 
2007 
_{Jan}
(260) 
_{Feb}
(323) 
_{Mar}
(340) 
_{Apr}
(319) 
_{May}
(290) 
_{Jun}
(296) 
_{Jul}
(221) 
_{Aug}
(292) 
_{Sep}
(242) 
_{Oct}
(248) 
_{Nov}
(242) 
_{Dec}
(332) 
2008 
_{Jan}
(312) 
_{Feb}
(359) 
_{Mar}
(454) 
_{Apr}
(287) 
_{May}
(340) 
_{Jun}
(450) 
_{Jul}
(403) 
_{Aug}
(324) 
_{Sep}
(349) 
_{Oct}
(385) 
_{Nov}
(363) 
_{Dec}
(437) 
2009 
_{Jan}
(500) 
_{Feb}
(301) 
_{Mar}
(409) 
_{Apr}
(486) 
_{May}
(545) 
_{Jun}
(391) 
_{Jul}
(518) 
_{Aug}
(497) 
_{Sep}
(492) 
_{Oct}
(429) 
_{Nov}
(357) 
_{Dec}
(310) 
2010 
_{Jan}
(371) 
_{Feb}
(657) 
_{Mar}
(519) 
_{Apr}
(432) 
_{May}
(312) 
_{Jun}
(416) 
_{Jul}
(477) 
_{Aug}
(386) 
_{Sep}
(419) 
_{Oct}
(435) 
_{Nov}
(320) 
_{Dec}
(202) 
2011 
_{Jan}
(321) 
_{Feb}
(413) 
_{Mar}
(299) 
_{Apr}
(215) 
_{May}
(284) 
_{Jun}
(203) 
_{Jul}
(207) 
_{Aug}
(314) 
_{Sep}
(321) 
_{Oct}
(259) 
_{Nov}
(347) 
_{Dec}
(209) 
2012 
_{Jan}
(322) 
_{Feb}
(414) 
_{Mar}
(377) 
_{Apr}
(179) 
_{May}
(173) 
_{Jun}
(234) 
_{Jul}
(151) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 






1
(23) 
2
(13) 
3
(1) 
4
(17) 
5
(3) 
6
(10) 
7
(7) 
8
(7) 
9
(4) 
10
(13) 
11
(20) 
12
(13) 
13
(17) 
14
(20) 
15
(14) 
16
(3) 
17
(5) 
18
(15) 
19
(18) 
20
(14) 
21
(2) 
22
(13) 
23
(8) 
24
(3) 
25
(7) 
26
(10) 
27
(17) 
28
(20) 
29
(42) 

From: Jeff Whitaker <jswhit@fa...>  20080213 22:17:09

Evan Mason wrote: > Hi Jeff > > Here are the corners: > > lon_corners = N.array([4.09300764,35.76003475,43.72330207, > 12.05627497]) > lat_corners = N.array([41.90278813, 49.2136974, 14.7209971, 7.41008784]) > > The reason for the differences is that the matlab script is very > fiddly, lots of trial and error to get the grid in the right place. > The attraction of using basemap is it allows me to specify the > corners, so that I have it right first time, that's the idea anyway. > > That would be great if you could turn off that rotation, maybe a > keyword True/False.... > > Thanks, Evan Evan: I've changed Basemap in svn so you can set 'no_rot=True' when creating a Basemap instance for the 'omerc' projection to get what you want. If you don't feel like upgrading (since that requires upgrading matplotlib to svn head at the same time), this will work in the version you have: from matplotlib.toolkits.basemap import Basemap, pyproj from pylab import * p = pyproj.Proj(lon_2=27.8,lon_1=19.9,no_rot=True,proj='omerc',\ lat_2=11.0,lat_1=45.5) xmax,ymax = p(4.093,41.9027) # upper right corner xmin,ymin = p(43.723,14.721) # lower left corner x = linspace(xmin,xmax,35) y = linspace(ymin,ymax,35) x, y = meshgrid(x,y) lonr,latr = p(x,y, inverse=True) m = Basemap(llcrnrlon=60,llcrnrlat=5,\ urcrnrlon=15,urcrnrlat=60,resolution='i') m.drawcoastlines() m.scatter(lonr.flatten(),latr.flatten(),5,marker='o') m.drawmeridians(arange(60,21,10),labels=[0,0,0,1]) m.drawparallels(arange(0,61,10),labels=[1,0,0,0]) show() Let me know if this fixes it for you. Jeff > > > > On Feb 13, 2008 12:56 PM, Jeff Whitaker <jswhit@... > <mailto:jswhit@...>> wrote: > > Evan Mason wrote: > > Hi Jeff > > > > By losing the memory I mean that the grid is no longer rotated; that > > the rotation I introduced through lat1, lon1, lat2, lon2 is > lost. If > > you look at the latitude of the two bottom corners you see that they > > are the same, they should be different. In other words, I want my > > great circle not to be the equator or a meridian, instead I want > it to > > be between lat1, lon1, lat2, lon2. See for example: > > > http://erg.usgs.gov/isb/pubs/MapProjections/projections.html#mercator > > > > Attached is a png from the matlab script. Here you can see the > > rotation that I am looking for. The latitude of the two bottom > > corners is different, unlike what happens presently with my basemap > > script. > > > > Thanks, Evan > > Evan: OK, I was confused by your use of the term 'losing the memory'. > Basemap didn't lose the rotation, it never had it in the first place. > It looks like matlab and Basemap define the projection regions > differently. They both are right, but are showing you different > regions > of the same projection. The difference is that proj4 (and therefore > Basemap) automatically rotates the y axis to lie along true north. I > think I know how to modify Basemap to display the region you want, by > turning off that rotation. Can you send me the lat/lon values of > the 4 > corners of the region that matlab produces? > > Jeff > > P.S. I don't know if this is relevant or not, but you appear to be > giving matlab different points to define the center of the projection > than you did in Basemap (the lons you gave matlab are > 23.75,28.25, the > lons you give in Basemap are 27.8 and 19.9). > > > > > > > > On Feb 13, 2008 10:48 AM, Jeff Whitaker <jswhit@... > <mailto:jswhit@...> > > <mailto:jswhit@... <mailto:jswhit@...>>> wrote: > > > > Evan Mason wrote: > > > Thanks for the replies. The map you produced, Jeff, looks > as it > > > should. However, I am trying to make an ocean model grid, > and so I > > > require two 2d arrays of lon and lat, at my desired grid > spacing. > > > This is why I try the steps: > > > > > > dl = 20000. > > > nx = int((M.xmax  M.xmin) / dl) + 1 > > > ny = int((M.ymax  M.ymin) / dl) + 1 > > > lonr, latr = M.makegrid(nx, ny) < it seems to be here > that it > > loses > > > 'memory' of omerc projection that I specified, and maybe > there is a > > > bug here? > > > > Evan: Why do you say it 'loses' memory of the projection? > The values > > look fine to me  they are just equally spaced points in map > > projection > > coordinates that cover the map projection region. Take a > look at > > > > M = Basemap(projection = 'omerc', \ > > resolution = 'l', \ > > llcrnrlon = 43.7, \ > > llcrnrlat = 14.7, \ > > urcrnrlon = 4.0, \ > > urcrnrlat = 41.9, \ > > lat_2 = 11.0, \ > > lat_1 = 45.5, \ > > lon_2 = 27.8, \ > > lon_1 = 19.9) > > dl = 200000. > > nx = int((M.xmax  M.xmin) / dl) + 1 > > ny = int((M.ymax  M.ymin) / dl) + 1 > > lonr, latr,x,y= M.makegrid(nx, ny, returnxy=True) > > M.drawcoastlines() > > M.scatter(x.flatten(), y.flatten(),5,marker='o') > > M.drawparallels(arange(10,51,10)) > > M.drawmeridians(arange(50,1,10)) > > show() > > > > > > If you have matlab, the following lines do what I am > looking for: > > > > > > incx = 0.00310/2; > > > incy = 0.00306/2; > > > Xstr = 0.275; > > > Xend = 0.275; > > > Ystr = 0.17; > > > Yend = 0.8; > > > X = [Xstr:incx:Xend]; > > > Y = [Ystr:incy:Yend]; > > > [XX,YY] = meshgrid(X,Y); > > > [Lonr,Latr] = m_xy2ll(XX,YY); > > > m_proj('Oblique Mercator','lon',[23.75 28.25],'lat',[45.5 > > > 11],'direction','vertical'); > > > plot(Lonr, Latr, 'c.') > > > > Sorry, I don't have matlab  but it looks at first glance > like it > > ought > > to be doing the same thing. > > > > Jeff > > > > > > > > > > > > Evan > > > > > > > > > > > > > > > > > > On Feb 13, 2008 5:14 AM, Jeff Whitaker <jswhit@... > <mailto:jswhit@...> > > <mailto:jswhit@... <mailto:jswhit@...>> > > > <mailto:jswhit@... <mailto:jswhit@...> > <mailto:jswhit@... <mailto:jswhit@...>>>> wrote: > > > > > > Evan Mason wrote: > > > > Hi, I am having some problems using the oblique mercator > > > projection in > > > > basemap. I want to define a rectangular orthogonal > grid, > > rotated > > > > clockwise by about 13 degrees. I want to define grid > > cells of size, > > > > say, about 20x20 km. The script I have so far is > below. The > > > problem > > > > is that at some point (the makegrid step) I lose the > rotation, > > > as seen > > > > in the plot. > > > > > > > > I'd appreciate any help with this, thanks, Evan > > > > > > > > > > > > from matplotlib.toolkits.basemap import Basemap > > > > > > > > M = Basemap(projection = 'omerc', \ > > > > resolution = None, \ > > > > llcrnrlon = 43.7, \ > > > > llcrnrlat = 14.7, \ > > > > urcrnrlon = 4.0, \ > > > > urcrnrlat = 41.9, \ > > > > lat_2 = 11.0, \ > > > > lat_1 = 45.5, \ > > > > lon_2 = 27.8, \ > > > > lon_1 = 19.9) > > > > > > > > dl = 20000. > > > > nx = int((M.xmax  M.xmin) / dl) + 1 > > > > ny = int((M.ymax  M.ymin) / dl) + 1 > > > > > > > > lonr, latr = M.makegrid(nx, ny) > > > > > > > > plot(lonr, latr, 'c.') > > > > show() > > > > > > Evan: I have to admit, I'm not too familiar with the > > Oblique Mercator > > > projection. What exactly should it look like? > > > > > > If I plot > > > > > > M = Basemap(projection = 'omerc', \ > > > resolution = 'l', \ > > > llcrnrlon = 43.7, \ > > > llcrnrlat = 14.7, \ > > > urcrnrlon = 4.0, \ > > > urcrnrlat = 41.9, \ > > > lat_2 = 11.0, \ > > > lat_1 = 45.5, \ > > > lon_2 = 27.8, \ > > > lon_1 = 19.9) > > > M.drawcoastlines() > > > M.drawparallels(arange(10,51,10)) > > > M.drawmeridians(arange(50,1,10)) > > > M.show() > > > > > > I see a reasonable looking map, but then I don't > really know > > exactly > > > what to expect. > > > > > > It seems that there are two ways to specify oblique > mercator > > in proj4 > > > > > > 1) by specifying 2 points (lon1,lat1), (lon2,lat2) > along the > > > central line > > > 2) by specifying a central point and an azimuth that > passes > > > through the > > > central point. > > > > > > Basemap uses (1), but every example on the web I've seen > > uses (2). It > > > could be there are bugs in (1), and (2) would produce more > > reasonable > > > results in your case. If you can give me an example > of what > > your map > > > *should* look like, it would help a lot. > > > > > > Jeff > > > > > > > > > > > > > > >  > > > Jeffrey S. Whitaker Phone : (303)4976313 > > > NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 > > > 325 Broadway Boulder, CO, USA 803053328 > > > > > > > > > > > >  > > Jeffrey S. Whitaker Phone : (303)4976313 > > Meteorologist FAX : (303)4976449 > > NOAA/OAR/PSD R/PSD1 Email : > Jeffrey.S.Whitaker@... <mailto:Jeffrey.S.Whitaker@...> > > <mailto:Jeffrey.S.Whitaker@... > <mailto:Jeffrey.S.Whitaker@...>> > > 325 Broadway Office : Skaggs Research Cntr 1D124 > > Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg > > > > > > > > >  > > > > >  > Jeffrey S. Whitaker Phone : (303)4976313 > Meteorologist FAX : (303)4976449 > NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... > <mailto:Jeffrey.S.Whitaker@...> > 325 Broadway Office : Skaggs Research Cntr 1D124 > Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg > >  Jeffrey S. Whitaker Phone : (303)4976313 Meteorologist FAX : (303)4976449 NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... 325 Broadway Office : Skaggs Research Cntr 1D124 Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg 
From: Evan Mason <evanmason@gm...>  20080213 20:07:07

By losing the memory I mean that the grid is no longer rotated; that the rotation I introduced through lat1, lon1, lat2, lon2 is lost. If you look at the latitude of the two bottom corners you see that they are the same, they should be different  for the matlab script they are different. In other words, I want my great circle not to be the equator or a meridian, instead I want it to be between lat1, lon1, lat2, lon2. See for example: http://erg.usgs.gov/isb/pubs/MapProjections/projections.html#mercator At present, basemap seems to be reverting to a standard mercator projection. Evan On Feb 13, 2008 10:48 AM, Jeff Whitaker <jswhit@...> wrote: > Evan Mason wrote: > > Thanks for the replies. The map you produced, Jeff, looks as it > > should. However, I am trying to make an ocean model grid, and so I > > require two 2d arrays of lon and lat, at my desired grid spacing. > > This is why I try the steps: > > > > dl = 20000. > > nx = int((M.xmax  M.xmin) / dl) + 1 > > ny = int((M.ymax  M.ymin) / dl) + 1 > > lonr, latr = M.makegrid(nx, ny) < it seems to be here that it loses > > 'memory' of omerc projection that I specified, and maybe there is a > > bug here? > > Evan: Why do you say it 'loses' memory of the projection? The values > look fine to me  they are just equally spaced points in map projection > coordinates that cover the map projection region. Take a look at > > M = Basemap(projection = 'omerc', \ > resolution = 'l', \ > llcrnrlon = 43.7, \ > llcrnrlat = 14.7, \ > urcrnrlon = 4.0, \ > urcrnrlat = 41.9, \ > lat_2 = 11.0, \ > lat_1 = 45.5, \ > lon_2 = 27.8, \ > lon_1 = 19.9) > dl = 200000. > nx = int((M.xmax  M.xmin) / dl) + 1 > ny = int((M.ymax  M.ymin) / dl) + 1 > lonr, latr,x,y= M.makegrid(nx, ny, returnxy=True) > M.drawcoastlines() > M.scatter(x.flatten(), y.flatten(),5,marker='o') > M.drawparallels(arange(10,51,10)) > M.drawmeridians(arange(50,1,10)) > show() > > > > If you have matlab, the following lines do what I am looking for: > > > > incx = 0.00310/2; > > incy = 0.00306/2; > > Xstr = 0.275; > > Xend = 0.275; > > Ystr = 0.17; > > Yend = 0.8; > > X = [Xstr:incx:Xend]; > > Y = [Ystr:incy:Yend]; > > [XX,YY] = meshgrid(X,Y); > > [Lonr,Latr] = m_xy2ll(XX,YY); > > m_proj('Oblique Mercator','lon',[23.75 28.25],'lat',[45.5 > > 11],'direction','vertical'); > > plot(Lonr, Latr, 'c.') > > Sorry, I don't have matlab  but it looks at first glance like it ought > to be doing the same thing. > > Jeff > > > > > > > > Evan > > > > > > > > > > > > On Feb 13, 2008 5:14 AM, Jeff Whitaker <jswhit@... > > <mailto:jswhit@...>> wrote: > > > > Evan Mason wrote: > > > Hi, I am having some problems using the oblique mercator > > projection in > > > basemap. I want to define a rectangular orthogonal grid, rotated > > > clockwise by about 13 degrees. I want to define grid cells of > size, > > > say, about 20x20 km. The script I have so far is below. The > > problem > > > is that at some point (the makegrid step) I lose the rotation, > > as seen > > > in the plot. > > > > > > I'd appreciate any help with this, thanks, Evan > > > > > > > > > from matplotlib.toolkits.basemap import Basemap > > > > > > M = Basemap(projection = 'omerc', \ > > > resolution = None, \ > > > llcrnrlon = 43.7, \ > > > llcrnrlat = 14.7, \ > > > urcrnrlon = 4.0, \ > > > urcrnrlat = 41.9, \ > > > lat_2 = 11.0, \ > > > lat_1 = 45.5, \ > > > lon_2 = 27.8, \ > > > lon_1 = 19.9) > > > > > > dl = 20000. > > > nx = int((M.xmax  M.xmin) / dl) + 1 > > > ny = int((M.ymax  M.ymin) / dl) + 1 > > > > > > lonr, latr = M.makegrid(nx, ny) > > > > > > plot(lonr, latr, 'c.') > > > show() > > > > Evan: I have to admit, I'm not too familiar with the Oblique > Mercator > > projection. What exactly should it look like? > > > > If I plot > > > > M = Basemap(projection = 'omerc', \ > > resolution = 'l', \ > > llcrnrlon = 43.7, \ > > llcrnrlat = 14.7, \ > > urcrnrlon = 4.0, \ > > urcrnrlat = 41.9, \ > > lat_2 = 11.0, \ > > lat_1 = 45.5, \ > > lon_2 = 27.8, \ > > lon_1 = 19.9) > > M.drawcoastlines() > > M.drawparallels(arange(10,51,10)) > > M.drawmeridians(arange(50,1,10)) > > M.show() > > > > I see a reasonable looking map, but then I don't really know exactly > > what to expect. > > > > It seems that there are two ways to specify oblique mercator in > proj4 > > > > 1) by specifying 2 points (lon1,lat1), (lon2,lat2) along the > > central line > > 2) by specifying a central point and an azimuth that passes > > through the > > central point. > > > > Basemap uses (1), but every example on the web I've seen uses (2). > It > > could be there are bugs in (1), and (2) would produce more > reasonable > > results in your case. If you can give me an example of what your > map > > *should* look like, it would help a lot. > > > > Jeff > > > > > > > > > >  > > Jeffrey S. Whitaker Phone : (303)4976313 > > NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 > > 325 Broadway Boulder, CO, USA 803053328 > > > > > > >  > Jeffrey S. Whitaker Phone : (303)4976313 > Meteorologist FAX : (303)4976449 > NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... > 325 Broadway Office : Skaggs Research Cntr 1D124 > Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg > > 
From: Jeff Whitaker <jswhit@fa...>  20080213 18:49:09

Evan Mason wrote: > Thanks for the replies. The map you produced, Jeff, looks as it > should. However, I am trying to make an ocean model grid, and so I > require two 2d arrays of lon and lat, at my desired grid spacing. > This is why I try the steps: > > dl = 20000. > nx = int((M.xmax  M.xmin) / dl) + 1 > ny = int((M.ymax  M.ymin) / dl) + 1 > lonr, latr = M.makegrid(nx, ny) < it seems to be here that it loses > 'memory' of omerc projection that I specified, and maybe there is a > bug here? Evan: Why do you say it 'loses' memory of the projection? The values look fine to me  they are just equally spaced points in map projection coordinates that cover the map projection region. Take a look at M = Basemap(projection = 'omerc', \ resolution = 'l', \ llcrnrlon = 43.7, \ llcrnrlat = 14.7, \ urcrnrlon = 4.0, \ urcrnrlat = 41.9, \ lat_2 = 11.0, \ lat_1 = 45.5, \ lon_2 = 27.8, \ lon_1 = 19.9) dl = 200000. nx = int((M.xmax  M.xmin) / dl) + 1 ny = int((M.ymax  M.ymin) / dl) + 1 lonr, latr,x,y= M.makegrid(nx, ny, returnxy=True) M.drawcoastlines() M.scatter(x.flatten(), y.flatten(),5,marker='o') M.drawparallels(arange(10,51,10)) M.drawmeridians(arange(50,1,10)) show() > > If you have matlab, the following lines do what I am looking for: > > incx = 0.00310/2; > incy = 0.00306/2; > Xstr = 0.275; > Xend = 0.275; > Ystr = 0.17; > Yend = 0.8; > X = [Xstr:incx:Xend]; > Y = [Ystr:incy:Yend]; > [XX,YY] = meshgrid(X,Y); > [Lonr,Latr] = m_xy2ll(XX,YY); > m_proj('Oblique Mercator','lon',[23.75 28.25],'lat',[45.5 > 11],'direction','vertical'); > plot(Lonr, Latr, 'c.') Sorry, I don't have matlab  but it looks at first glance like it ought to be doing the same thing. Jeff > > > > Evan > > > > > > On Feb 13, 2008 5:14 AM, Jeff Whitaker <jswhit@... > <mailto:jswhit@...>> wrote: > > Evan Mason wrote: > > Hi, I am having some problems using the oblique mercator > projection in > > basemap. I want to define a rectangular orthogonal grid, rotated > > clockwise by about 13 degrees. I want to define grid cells of size, > > say, about 20x20 km. The script I have so far is below. The > problem > > is that at some point (the makegrid step) I lose the rotation, > as seen > > in the plot. > > > > I'd appreciate any help with this, thanks, Evan > > > > > > from matplotlib.toolkits.basemap import Basemap > > > > M = Basemap(projection = 'omerc', \ > > resolution = None, \ > > llcrnrlon = 43.7, \ > > llcrnrlat = 14.7, \ > > urcrnrlon = 4.0, \ > > urcrnrlat = 41.9, \ > > lat_2 = 11.0, \ > > lat_1 = 45.5, \ > > lon_2 = 27.8, \ > > lon_1 = 19.9) > > > > dl = 20000. > > nx = int((M.xmax  M.xmin) / dl) + 1 > > ny = int((M.ymax  M.ymin) / dl) + 1 > > > > lonr, latr = M.makegrid(nx, ny) > > > > plot(lonr, latr, 'c.') > > show() > > Evan: I have to admit, I'm not too familiar with the Oblique Mercator > projection. What exactly should it look like? > > If I plot > > M = Basemap(projection = 'omerc', \ > resolution = 'l', \ > llcrnrlon = 43.7, \ > llcrnrlat = 14.7, \ > urcrnrlon = 4.0, \ > urcrnrlat = 41.9, \ > lat_2 = 11.0, \ > lat_1 = 45.5, \ > lon_2 = 27.8, \ > lon_1 = 19.9) > M.drawcoastlines() > M.drawparallels(arange(10,51,10)) > M.drawmeridians(arange(50,1,10)) > M.show() > > I see a reasonable looking map, but then I don't really know exactly > what to expect. > > It seems that there are two ways to specify oblique mercator in proj4 > > 1) by specifying 2 points (lon1,lat1), (lon2,lat2) along the > central line > 2) by specifying a central point and an azimuth that passes > through the > central point. > > Basemap uses (1), but every example on the web I've seen uses (2). It > could be there are bugs in (1), and (2) would produce more reasonable > results in your case. If you can give me an example of what your map > *should* look like, it would help a lot. > > Jeff > > > > >  > Jeffrey S. Whitaker Phone : (303)4976313 > NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 > 325 Broadway Boulder, CO, USA 803053328 > >  Jeffrey S. Whitaker Phone : (303)4976313 Meteorologist FAX : (303)4976449 NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... 325 Broadway Office : Skaggs Research Cntr 1D124 Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg 
From: Eric Firing <efiring@ha...>  20080213 18:44:28

José GómezDans wrote: > Hi, > Is there a simple way to come up with a random colourmap? I need to plot > discrete values, and I would like that the colours do not show a trend, to > easily distinguish them? It might help if you described the application. I am guessing that you have a small number of values (5? 10? 15?) and that using direct indexing with a ListedColormap will be the simplest way to get what you want. I have recently made this easier in svn, as illustrated by the second panel in examples/colorbar_only.py, but this is not yet available in a released version of mpl. A simpler use of a ListedColormap is given in examples/contourf_demo.py, in the last plot; this is the same in recent mpl releases as in svn. > > I read the cookbook entry on "Doing your own colormap", but can't seem to > bring my mind into it! Are you referring to this http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations ? Eric > > Cheers! > Jose 
From: <kc106_2005matplotlib@ya...>  20080213 18:43:34

Well, looks like nobody has an answer to this question. How'bout py2exe or other ways of creating exe files out of matplotlib projects? Has anybody been able to do that?  kc106_2005matplotlib@... wrote: > Has anybody been able to create an exe of their > python > applications involving matplotlib using pyinstall > (ver > 1.3)? I am getting a: > > RuntimeError: Could not find the matplotlib > data > files > > when I attempt to run the exe created. > > In searching the web, it appears this is an issue > when > others tried to use py2exe as well. Unfortunately, > the few hits I saw doesn't include enough details to > inspire me as to what I should be doing in my > pyinstall .spec file. > > Does anybody has an example or information about > this? > > Thanks, > >  > John Henry >  John Henry 
From: Evan Mason <evanmason@gm...>  20080213 18:39:23

Thanks for the replies. The map you produced, Jeff, looks as it should. However, I am trying to make an ocean model grid, and so I require two 2d arrays of lon and lat, at my desired grid spacing. This is why I try the steps: dl = 20000. nx = int((M.xmax  M.xmin) / dl) + 1 ny = int((M.ymax  M.ymin) / dl) + 1 lonr, latr = M.makegrid(nx, ny) < it seems to be here that it loses 'memory' of omerc projection that I specified, and maybe there is a bug here? If you have matlab, the following lines do what I am looking for: incx = 0.00310/2; incy = 0.00306/2; Xstr = 0.275; Xend = 0.275; Ystr = 0.17; Yend = 0.8; X = [Xstr:incx:Xend]; Y = [Ystr:incy:Yend]; [XX,YY] = meshgrid(X,Y); [Lonr,Latr] = m_xy2ll(XX,YY); m_proj('Oblique Mercator','lon',[23.75 28.25],'lat',[45.511],'direction','vertical'); plot(Lonr, Latr, 'c.') Evan On Feb 13, 2008 5:14 AM, Jeff Whitaker <jswhit@...> wrote: > Evan Mason wrote: > > Hi, I am having some problems using the oblique mercator projection in > > basemap. I want to define a rectangular orthogonal grid, rotated > > clockwise by about 13 degrees. I want to define grid cells of size, > > say, about 20x20 km. The script I have so far is below. The problem > > is that at some point (the makegrid step) I lose the rotation, as seen > > in the plot. > > > > I'd appreciate any help with this, thanks, Evan > > > > > > from matplotlib.toolkits.basemap import Basemap > > > > M = Basemap(projection = 'omerc', \ > > resolution = None, \ > > llcrnrlon = 43.7, \ > > llcrnrlat = 14.7, \ > > urcrnrlon = 4.0, \ > > urcrnrlat = 41.9, \ > > lat_2 = 11.0, \ > > lat_1 = 45.5, \ > > lon_2 = 27.8, \ > > lon_1 = 19.9) > > > > dl = 20000. > > nx = int((M.xmax  M.xmin) / dl) + 1 > > ny = int((M.ymax  M.ymin) / dl) + 1 > > > > lonr, latr = M.makegrid(nx, ny) > > > > plot(lonr, latr, 'c.') > > show() > > Evan: I have to admit, I'm not too familiar with the Oblique Mercator > projection. What exactly should it look like? > > If I plot > > M = Basemap(projection = 'omerc', \ > resolution = 'l', \ > llcrnrlon = 43.7, \ > llcrnrlat = 14.7, \ > urcrnrlon = 4.0, \ > urcrnrlat = 41.9, \ > lat_2 = 11.0, \ > lat_1 = 45.5, \ > lon_2 = 27.8, \ > lon_1 = 19.9) > M.drawcoastlines() > M.drawparallels(arange(10,51,10)) > M.drawmeridians(arange(50,1,10)) > M.show() > > I see a reasonable looking map, but then I don't really know exactly > what to expect. > > It seems that there are two ways to specify oblique mercator in proj4 > > 1) by specifying 2 points (lon1,lat1), (lon2,lat2) along the central line > 2) by specifying a central point and an azimuth that passes through the > central point. > > Basemap uses (1), but every example on the web I've seen uses (2). It > could be there are bugs in (1), and (2) would produce more reasonable > results in your case. If you can give me an example of what your map > *should* look like, it would help a lot. > > Jeff > > > > >  > Jeffrey S. Whitaker Phone : (303)4976313 > NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 > 325 Broadway Boulder, CO, USA 803053328 > > 
From: Christopher Barker <Chris.B<arker@no...>  20080213 18:24:45

José GómezDans wrote: > I need to plot > discrete values, and I would like that the colours do not show a trend, to > easily distinguish them? > > I read the cookbook entry on "Doing your own colormap", but can't seem to > bring my mind into it! Once you gfigure that out (sorry, I don't have any hints off the top of my head), this page may help you choose colors to use: http://geography.uoregon.edu/datagraphics/color_scales.htm Chris  Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 5266959 voice 7600 Sand Point Way NE (206) 5266329 fax Seattle, WA 98115 (206) 5266317 main reception Chris.Barker@... 
From: Jim Vickroy <Jim.V<ickroy@no...>  20080213 18:07:14

Hello all, Could someone offer suggestions for (preferably) python code to compute: * day/night terminator position * solar zenith angle I'm developing a basemap application that is required to hide contour data in the night regions of the earth. The projections will be Mercator and polar stereographic; presumably, it will suffice to have Mercatorbased terminator map only. Thanks for any suggestions.  jv 
From: José GómezDans <jgomezdans@gm...>  20080213 18:03:18

Hi, Is there a simple way to come up with a random colourmap? I need to plot discrete values, and I would like that the colours do not show a trend, to easily distinguish them? I read the cookbook entry on "Doing your own colormap", but can't seem to bring my mind into it! Cheers! Jose 
From: Tommy Grav <tgrav@ma...>  20080213 13:58:15

On Feb 12, 2008, at 8:39 PM, Evan Mason wrote: > dl = 20000. > nx = int((M.xmax  M.xmin) / dl) + 1 > ny = int((M.ymax  M.ymin) / dl) + 1 > > lonr, latr = M.makegrid(nx, ny) > > plot(lonr, latr, 'c.') > show() I think you might be looking for M.plot() rather than plot()?? plot() will just overwrite the basemap in the figure (although that might be possible to fix with some axismagic, but that is far beyond my knowledge of matplotlib). Cheers Tommy 
From: Jeff Whitaker <jswhit@fa...>  20080213 13:16:50

jlu wrote: > Has anyone had any luck plotting a Healpix (sky pixelization used in > astronomy) map using matplotlib basemap... or any other python > plotting package for that matter? > > Cheers, > Jessica > Jessica: I don't know anything about Healpix, but if you are more specific about what the problem is I may be able to help. For instance, how are the locations of the pixels in your image defined? Jeff  Jeffrey S. Whitaker Phone : (303)4976313 NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 325 Broadway Boulder, CO, USA 803053328 
From: Jeff Whitaker <jswhit@fa...>  20080213 13:14:28

Evan Mason wrote: > Hi, I am having some problems using the oblique mercator projection in > basemap. I want to define a rectangular orthogonal grid, rotated > clockwise by about 13 degrees. I want to define grid cells of size, > say, about 20x20 km. The script I have so far is below. The problem > is that at some point (the makegrid step) I lose the rotation, as seen > in the plot. > > I'd appreciate any help with this, thanks, Evan > > > from matplotlib.toolkits.basemap import Basemap > > M = Basemap(projection = 'omerc', \ > resolution = None, \ > llcrnrlon = 43.7, \ > llcrnrlat = 14.7, \ > urcrnrlon = 4.0, \ > urcrnrlat = 41.9, \ > lat_2 = 11.0, \ > lat_1 = 45.5, \ > lon_2 = 27.8, \ > lon_1 = 19.9) > > dl = 20000. > nx = int((M.xmax  M.xmin) / dl) + 1 > ny = int((M.ymax  M.ymin) / dl) + 1 > > lonr, latr = M.makegrid(nx, ny) > > plot(lonr, latr, 'c.') > show() Evan: I have to admit, I'm not too familiar with the Oblique Mercator projection. What exactly should it look like? If I plot M = Basemap(projection = 'omerc', \ resolution = 'l', \ llcrnrlon = 43.7, \ llcrnrlat = 14.7, \ urcrnrlon = 4.0, \ urcrnrlat = 41.9, \ lat_2 = 11.0, \ lat_1 = 45.5, \ lon_2 = 27.8, \ lon_1 = 19.9) M.drawcoastlines() M.drawparallels(arange(10,51,10)) M.drawmeridians(arange(50,1,10)) M.show() I see a reasonable looking map, but then I don't really know exactly what to expect. It seems that there are two ways to specify oblique mercator in proj4 1) by specifying 2 points (lon1,lat1), (lon2,lat2) along the central line 2) by specifying a central point and an azimuth that passes through the central point. Basemap uses (1), but every example on the web I've seen uses (2). It could be there are bugs in (1), and (2) would produce more reasonable results in your case. If you can give me an example of what your map *should* look like, it would help a lot. Jeff  Jeffrey S. Whitaker Phone : (303)4976313 NOAA/OAR/CDC R/PSD1 FAX : (303)4976449 325 Broadway Boulder, CO, USA 803053328 
From: jlu <jlu@as...>  20080213 06:57:50

Has anyone had any luck plotting a Healpix (sky pixelization used in astronomy) map using matplotlib basemap... or any other python plotting package for that matter? Cheers, Jessica 
From: Phil Austin <phaustin@gm...>  20080213 03:32:12

John Hunter wrote: > On Feb 12, 2008 12:17 PM, Neal Becker <ndbecker2@...> wrote: > >> If invoked from Mx pyshell doesn't work. >> >> Now if I could just figure out where to modify the way pyshell invokes >> ipython to add the pylab. Doc say Cu Mx pyshell would prompt for args, >> but the doc lies. I use: (require `pythonmode) ; for pythonmode.el from http://sourceforge.net/projects/python ; If you are using the default emacs pythonmode, comment out the following ; two lines (setq pyshellswitchbuffersonexecute nil) (setq pypythoncommandargs '("pylab" "colors" "LightBG" "p" "phil")) (require `ipython) 
From: John Hunter <jdh2358@gm...>  20080213 02:16:43

On Feb 12, 2008 12:23 PM, Pierre GM <pgmdevlist@...> wrote: > self.plot(current._datesshift, current._series, lw=lw, ls=ls, c=c, > scalex=False, scaley=False) > self.highlightedline = len(self.lines)1 # > return self.highlightedline > > As you see, I have an extra attribute (highlightedfreq) that stores the index > of the highlighted line: when I need to deselect the highlighted curve, I > just delete the corresponding element of the lines list. I haven't tested this, but a more direct route may be (plot returns a list of lines and the "myline," idiom extracts the first element into the variable "myline") myline, = ax.plot(x, y, ...) and then later when you want to remove: ax.lines.remove(myline) Hope this helps, JDH 
From: John Hunter <jdh2358@gm...>  20080213 01:57:14

On Feb 12, 2008 12:17 PM, Neal Becker <ndbecker2@...> wrote: > If invoked from Mx pyshell doesn't work. > > Now if I could just figure out where to modify the way pyshell invokes > ipython to add the pylab. Doc say Cu Mx pyshell would prompt for args, > but the doc lies. You can probably get help with this on the ipython mailing list. JDH 
From: Evan Mason <evanmason@gm...>  20080213 01:39:34

Hi, I am having some problems using the oblique mercator projection in basemap. I want to define a rectangular orthogonal grid, rotated clockwise by about 13 degrees. I want to define grid cells of size, say, about 20x20 km. The script I have so far is below. The problem is that at some point (the makegrid step) I lose the rotation, as seen in the plot. I'd appreciate any help with this, thanks, Evan from matplotlib.toolkits.basemap import Basemap M = Basemap(projection = 'omerc', \ resolution = None, \ llcrnrlon = 43.7, \ llcrnrlat = 14.7, \ urcrnrlon = 4.0, \ urcrnrlat = 41.9, \ lat_2 = 11.0, \ lat_1 = 45.5, \ lon_2 = 27.8, \ lon_1 = 19.9) dl = 20000. nx = int((M.xmax  M.xmin) / dl) + 1 ny = int((M.ymax  M.ymin) / dl) + 1 lonr, latr = M.makegrid(nx, ny) plot(lonr, latr, 'c.') show() 