Re: Change start-point of longitude for a map

From: Mark Chan <cym263_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 31 2011 - 08:48:01 MDT

Hi Rick,

Thanks to you and Dennis for answering my questions, and I really appreciate it.
It is a bit too many stuff to add for output several plot formats, so I prefer
to just change format name each time. However, your second suggestion by using
"function" is quite interesting. Do you have any simple example that I can
follow?

With my best regards,
Mark

----- Original Message ----
From: "brownrig@ucar.edu" <brownrig@ucar.edu>
To: Mark Chan <cym263@yahoo.com>; ncl-talk@ucar.edu
Sent: Wed, March 30, 2011 10:28:27 PM
Subject: Re: Change start-point of longitude for a map

Hi Mark,

To accomplish the second part of your question, you essentially have to do
everything involving a "wks" variable twice; something like:

  wksX11 = gsn_open_wks("x11", "output")
  wksPS = gsn_open_wks("ps", "output")
...
  plotX11 = gsn_contour_map(wksX11, ...)
  plotPS = gsn_contour_map(wksPS, ...)
...
  polyX11 = gsn_add_polygon(wksX11, plotX11, ...)
  polyPS = gsn_add_polygon(wksPS, plotPS, ...)
...
  frame(wksX11)
  frame(wksPS)

See what I'm getting at? It's perhaps a bit awkward, but one way to manage it
*might* be to separate concerns, where all the file reading and analysis takes
place in the main body of the script, and all the resource management and
drawing is performed in a parametrized function that takes as an argument, among
other things, the workstation-type you want to draw to:

  ; read files...
...
  ; extract variables, perform analysis, etc...
...
  generatePlot("x11", ...)
  generatePlot("ps", ...)
  generatePlot("png", ...)
...

Hope that helps,
Rick

On Wed, 30 Mar 2011 19:52:07 -0700 (PDT)
Mark Chan <cym263@yahoo.com> wrote:
> NCL users,
>
> There is a global map with longitude from -180 to 180. Are there any easy way
>to change the map with longitude from 0 to 360?
> I was trying to use "data=lonFlip(data)" but the map didn't change. Can anyone
>help?
>
>
> Besides, we often use "wks = gsn_open_wks ("x11", "output")" for output, how
>is it possible to output both "x11" and "ps" at the same run?
>
> Thanks a lot in advance!
> Mark
>
> _______________________________________________
> 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 Thu Mar 31 08:48:07 2011

This archive was generated by hypermail 2.1.8 : Tue Apr 05 2011 - 09:01:21 MDT