Re: regrid from 0-360 to -180-180

From: Kyle Griffin <ksgriffin2_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 18 2013 - 09:22:15 MST

Hi Jonathan,

If the cyclic points are identical and you don't mind doing without, you
could just subscript the data similar to:

x_flip = lonFlip(x(lat|:,lon|{0:359}))

No promises that exact code will work, but essentially you would just want
to leave out the last longitude point (the cyclic one). In order to restore
the cyclic nature of the data, you would just need to set gsnAddCyclic =
True when you go to plot it, if you're plotting on a horizontal map.
You could also try to code the lonFlip code yourself, similar to:

x_flip = new(dimsizes(x),typeof(x))
x_flip&lon = fspan(-180,180,nlon)

x_flip(:,{0:180}) = x(:,{0:180})
x_flip(:,{-180:0}) = x(:,{180:360})

This does assume your cyclic points are identical, of course.

Hope that helps some.


Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
1225 W Dayton St, Madison, WI 53706
Room 1421 Email:

On Fri, Jan 18, 2013 at 10:04 AM, jbuzan <> wrote:

> Hello NCL-talk,
> I am working with multiple gridded files (some that are 0360, and others
> that are -180180) and I need to merge the files together. I prefer to use
> the -180180 format. The issue, though, is that they have cyclic points,
> which prevents me from using lonFlip.
> Is there a recommended solution to this issue?
> -Jonathan
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Jan 18 09:22:47 2013

This archive was generated by hypermail 2.1.8 : Sat Jan 19 2013 - 10:23:16 MST