From: Jeff Whitaker <jswhit@fa...>  20071011 22:08:34

Adam Mercer wrote: > On 11/10/2007, Jeff Whitaker <jswhit@...> wrote: > > >> Adam: I assume your data is on a latitudelongitude grid? You've asked >> for a mollweide projection centered on the Greenwich meridian. Your >> data is not centered on Greenwich  but the error message is trying to >> say that you can shift your grid (with the shiftgrid function) so that >> is has the same orientation as the map projection region. This only >> comes into play with global projections that 'wraparound' at the edges, >> like the mollweide and mercator projections. The orthographic >> projection does not 'wrap around'  hence you don't get the error message. >> > > Looking at the shiftmap function it looks like I should shift the > coordinate grid so that my longitude runs from 180 to 180 instead of > 0 to 360, therefore the following shiftgrid call should do this > > values, lon = basemap.shiftgrid(180, values, lon) > > However I still get the same error and the corruption in the resulting > plot. I feel like I'm missing something obvious here but can't find > it. > > Cheers > > Adam > Adam: From the basemap docs; shiftgrid(lon0, datain, lonsin, start=True) shift global lat/lon grid east or west. assumes wraparound (or cyclic point) is included. lon0: starting longitude for shifted grid (ending longitude if start=False). lon0 must be on input grid (within the range of lonsin). datain: original data. lonsin: original longitudes. start[True]: if True, lon0 represents the starting longitude of the new grid. if False, lon0 is the ending longitude. returns dataout,lonsout (data and longitudes on shifted grid). You did values, lon = basemap.shiftgrid(180, values, lon) but I think you want values, lon = basemap.shiftgrid(180, values, lon, start=False) HTH, Jeff  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 