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

From: jbuzan <jbuzan_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 18 2013 - 09:55:57 MST

Kyle,

I believe the 'lonFlip' code may have worked.
Thanks,

-Jonathan

On Jan 18, 2013, at 11:22 AM, Kyle Griffin wrote:

> 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))
> copy_VarMeta(x_flip)
> 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
>
> ----------------------------------------
> Kyle S. Griffin
> Department of Atmospheric and Oceanic Sciences
> University of Wisconsin - Madison
> 1225 W Dayton St, Madison, WI 53706
> Room 1421 Email: ksgriffin2@wisc.edu
>
>
> On Fri, Jan 18, 2013 at 10:04 AM, jbuzan <jbuzan@purdue.edu> wrote:
> Hello NCL-talk,
>
> I am working with multiple gridded files (some that are 0–360, and others that are -180–180) and I need to merge the files together. I prefer to use the -180–180 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:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jan 18 09:56:15 2013

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