Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Hatch, Sara J <sara.j.hatch@jp...>  20090312 22:47:51
Attachments:
text/plain
basemapBug.png

From: Jeff Whitaker <jswhit@fa...>  20090312 23:05:26

Hatch, Sara J wrote: > > Matplotlib Folks, > > I tried to use the orthographic projection in the basemap toolkit and > I’m finding that the parallel lines are not behaving correctly, i.e., > there are horizontal lines connecting the left and right side of the > map boundary where a curved latitude line intersects the map boundary. > I’ve included a sample script below and a figure illustrating the problem. > > import pylab > > import mpl_toolkits.basemap as basemap > > ortho = > basemap.Basemap(projection='ortho',lon_0=0,lat_0=50,rsphere=1737.4) > > ortho.drawparallels(pylab.arange(90,90,30)) > > ortho.drawmeridians(pylab.arange(0,360,30)) > > ortho.drawmapboundary(fill_color='w') > > In addition, how do I change the x/y coordinates the center of the > projection to be (0,0)? With the above code, the center of the > bounding circle is at (1737.4,1737.4). > > Thanks for the help, > > Sara > Sara: If you take out the rsphere=1734.4 (thereby using the default value of 6370997), the jumpy lines go away. rsphere=1734.4 means assume the earth is a perfect sphere with a radius of 1734.4 meters. That's an awfully small earth  I think the jumpy lines are a result of roundoff errors in the map projection calculation for very small spheres. Still, that shouldn't happen, so I will look into it. Regarding the x/y coordinate of the middle of the plot  Basemap assigns the lower left corner of the map projection region an x/y value of 0,0 for most map projections. Jeff 
From: Jeff Whitaker <jswhit@fa...>  20090313 02:26:36

Hatch, Sara J wrote: > Jeff, > > My plan was to use the orthographic projection to represent the Moon (hence the 1737.4 km radius) and to plot a spacecraft trajectory around it. If I had read the rsphere documentation past the first half sentence I would have noticed that it was in meters instead of kilometers, sorry about that. Once I implemented this change, the horizontal lines go away. > Sara: OK, great. > Regarding the origin location: I have my spacecraft trajectory calculated with the origin being coincident with the center of the Moon. I can easily translate my coordinates to work with the origin not being the center of the projection, but would it be possible to implement some way to change where the origin is on the projection? > No, sorry  there's no easy way to do that. Jeff > Thanks, > Sara > > > > Original Message > From: Jeff Whitaker [mailto:jswhit@...] > Sent: Thursday, March 12, 2009 4:05 PM > To: Hatch, Sara J > Cc: matplotlibusers@... > Subject: Re: [Matplotlibusers] Erroneous Horizontal Lines when Using Basemap > > Hatch, Sara J wrote: > >> Matplotlib Folks, >> >> I tried to use the orthographic projection in the basemap toolkit and >> I'm finding that the parallel lines are not behaving correctly, i.e., >> there are horizontal lines connecting the left and right side of the >> map boundary where a curved latitude line intersects the map boundary. >> I've included a sample script below and a figure illustrating the problem. >> >> import pylab >> >> import mpl_toolkits.basemap as basemap >> >> ortho = >> basemap.Basemap(projection='ortho',lon_0=0,lat_0=50,rsphere=1737.4) >> >> ortho.drawparallels(pylab.arange(90,90,30)) >> >> ortho.drawmeridians(pylab.arange(0,360,30)) >> >> ortho.drawmapboundary(fill_color='w') >> >> In addition, how do I change the x/y coordinates the center of the >> projection to be (0,0)? With the above code, the center of the >> bounding circle is at (1737.4,1737.4). >> >> Thanks for the help, >> >> Sara >> >> > Sara: If you take out the rsphere=1734.4 (thereby using the default > value of 6370997), the jumpy lines go away. rsphere=1734.4 means assume > the earth is a perfect sphere with a radius of 1734.4 meters. That's an > awfully small earth  I think the jumpy lines are a result of roundoff > errors in the map projection calculation for very small spheres. Still, > that shouldn't happen, so I will look into it. > > Regarding the x/y coordinate of the middle of the plot  Basemap assigns > the lower left corner of the map projection region an x/y value of 0,0 > for most map projections. > > Jeff > > 