[SciPy-User] shiftgrid difficulties
David Huard
david.huard at gmail.com
Thu Aug 27 09:42:06 EDT 2009
Bruce,
You need to add a cyclic point first before applying shiftgrid.
See basemap.addcyclic
David
On Tue, Aug 25, 2009 at 5:33 PM, Bruce Ford <bruce at clearscienceinc.com>wrote:
>
> mpl_toolkits_basemap.shiftgrid looks straight forward enough, but I cannot
> find a working combination. Let me explain:
>
> I'm trying to plot a variable that I've extracted from a NetCDF file.
>
> When I plot it, I get something that looks like the attached file...it only
> plots in the Eastern hemisphere (0-180).
>
> The longitude array is [ 0. 1. 2. ... 356. 357. 358. 359.]
>
> When trying "sig_wav_ht,lon = shiftgrid(180,sig_wav_ht,lon,start=False)" or
> any other combination using different lon0 I get the same error
>
> "cyclic point not included"
>
> What am I missing?
>
> Some of the code prior to the shiftgrid method:
>
> file1 = sc_settings.data_dir + "/ww3/ww3.199301.nc"
> nc = NetCDFFile(file1)
> for var in nc.variables:
> print var
> sig_wav_ht = nc.variables['sig_wav_ht'][1,:,:]
> lon = nc.variables['longitude'][:]
> print lon
> lat = nc.variables['latitude'][:]
> sig_wav_ht,lon = shiftgrid(180,sig_wav_ht,lon,start=False)
>
> Any help would be appreciated.
>
> Bruce
>
>
> ---------------------------------------
> Bruce W. Ford
> Clear Science, Inc.
> bruce at clearscienceinc.com
> bruce.w.ford.ctr at navy.smil.mil
> http://www.ClearScienceInc.com
> Phone/Fax: 904-379-9704
> 8241 Parkridge Circle N.
> Jacksonville, FL 32211
> Skype: bruce.w.ford
> Google Talk: fordbw at gmail.com
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090827/1f0049c6/attachment.html>
More information about the SciPy-User
mailing list