Re: Re: ncl-talk Digest, Vol 29, Issue 18

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 21 Apr 2006 09:09:09 -0600

Hi Siraj,

Welcome to NCL. We strongly suggest that you review the web page
documentation for new NCL-users that can be found here:

http://www.ncl.ucar.edu/get_started.shtml

Specifically, take a look at the "Line-by-Line description" link on that
page, it's a good way to get oriented to NCL scripting.

To directly answer your question, here is a simple NCL script that will
read in a 3D variable SLP (dimensioned time x lat x lon) and plot the
first timestep:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
a = addfile("rcm.nc","r")
printVarSummary(a)
arr = a->SLP ; substitute a 3D variable name in the file for
                        ; SLP
wks = gsn_open_wks("x11","test")
plot = gsn_csm_contour_map_ce(wks,arr(0,:,:),False)
end

Good luck,
Adam

Siraj Ul Islam wrote:
> hi,
> I am new user to NCL. I have downloaded and have installed this
> software and have perform all checks as written in the documnetation.
> Now for a quick start I wand to display my variables in it. I have .nc
> file (From my RCM).
> What is the first step to open the file??
>
>
> On 4/20/06, *ncl-talk-request_at_ucar.edu
> <mailto:ncl-talk-request_at_ucar.edu>* <ncl-talk-request_at_ucar.edu
> <mailto:ncl-talk-request_at_ucar.edu>> wrote:
>
> Send ncl-talk mailing list submissions to
> ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
> ncl-talk-request_at_ucar.edu <mailto:ncl-talk-request_at_ucar.edu>
>
> You can reach the person managing the list at
> ncl-talk-owner_at_ucar.edu <mailto:ncl-talk-owner_at_ucar.edu>
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
> 1. What does OPeNDAP stand for? (Foo, Alex (Space Technology))
> 2. What does OPeNDAP stand for? (Foo, Alex (Space Technology))
> 3. Re: What does OPeNDAP stand for? (Adam Phillips)
> 4. Re: What does OPeNDAP stand for? (Rick Grubin)
> 5. Multiple plot file name versus single resource file name
> (Gary J Robinson)
> 6. using named colors (Marjolaine Rouault)
> 7. Re: using named colors (Adam Phillips)
> 8. Re: using named colors (Mary Haley)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 19 Apr 2006 13:16:53 -0700
> From: "Foo, Alex (Space Technology)" <alex.foo_at_ngc.com
> <mailto:alex.foo_at_ngc.com>>
> Subject: What does OPeNDAP stand for?
> To: <ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>>
> Message-ID:
>
> <8A99FAAA2E47A845BA1AD11822E98C1701C9220D_at_XCGC3006.northgrum.com
> <mailto:8A99FAAA2E47A845BA1AD11822E98C1701C9220D_at_XCGC3006.northgrum.com>>
> Content-Type: text/plain; charset="us-ascii"
>
> > ______________________________________________
> > From: Foo, Alex (Space Technology)
> > Sent: Wednesday, April 19, 2006 1:04 PM
> > To: 'haley_at_ucar.edu <mailto:haley_at_ucar.edu>'
> > Cc: Foo, Alex (Space Technology)
> > Subject:
> >
> > Mary,
> >
> > I am about to download the latest version NCL 4.2.0 for my installed
> > WRFSI_V2.1.2.
> > Should I download OPeNDAP-enabled one or the not-OPeNDAP-enabled one?
> > What does OPeNDAP stand for?
> >
> > Thanks.
> >
> > Alex Erxuan Foo, Northrop Grumman Space Technology
> > Models&Simulations,System Engineering,(310)813-5501
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20060419/f917e999/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Wed, 19 Apr 2006 13:28:44 -0700
> From: "Foo, Alex (Space Technology)" < alex.foo_at_ngc.com
> <mailto:alex.foo_at_ngc.com>>
> Subject: What does OPeNDAP stand for?
> To: <ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>>
> Message-ID:
> <
> 8A99FAAA2E47A845BA1AD11822E98C1701C9220E_at_XCGC3006.northgrum.com
> <mailto:8A99FAAA2E47A845BA1AD11822E98C1701C9220E_at_XCGC3006.northgrum.com>>
> Content-Type: text/plain; charset="us-ascii"
>
> > ______________________________________________
> > From: Foo, Alex (Space Technology)
> > Sent: Wednesday, April 19, 2006 1:04 PM
> > To: 'haley_at_ucar.edu <mailto:haley_at_ucar.edu>'
> > Cc: Foo, Alex (Space Technology)
> > Subject:
> >
> > Mary,
> >
> > I am about to download the latest version NCL 4.2.0 for my installed
> > WRFSI_V2.1.2.
> > Should I download OPeNDAP-enabled one or the not-OPeNDAP-enabled one?
> > What does OPeNDAP stand for?
> >
> > Thanks.
> >
> > Alex Erxuan Foo, Northrop Grumman Space Technology
> > Models&Simulations,System Engineering,(310)813-5501
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20060419/59bb991c/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Wed, 19 Apr 2006 14:34:42 -0600
> From: Adam Phillips < asphilli_at_cgd.ucar.edu
> <mailto:asphilli_at_cgd.ucar.edu>>
> Subject: Re: What does OPeNDAP stand for?
> To: "Foo, Alex (Space Technology)" <alex.foo_at_ngc.com
> <mailto:alex.foo_at_ngc.com>>
> Cc: ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> Message-ID: <44469EE2.7060902_at_cgd.ucar.edu
> <mailto:44469EE2.7060902_at_cgd.ucar.edu>>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Alex,
>
> Take a look at these sites:
>
> http://www.ncl.ucar.edu/Applications/opendap.shtml
> http://www.opendap.org/
>
> Adam
>
> Foo, Alex (Space Technology) wrote:
> > ______________________________________________
> > *From: * Foo, Alex (Space Technology)
> > *Sent: * Wednesday, April 19, 2006 1:04 PM
> > *To: * 'haley_at_ucar.edu <mailto:haley_at_ucar.edu> '
> > *Cc: * Foo, Alex (Space Technology)
> > *Subject: *
> >
> > Mary,
> >
> > I am about to download the latest version NCL 4.2.0 for my installed
> > WRFSI_V2.1.2.
> > Should I download OPeNDAP-enabled one or the not-OPeNDAP-enabled
> one?
> > What does OPeNDAP stand for?
> >
> > Thanks.
> >
> > Alex Erxuan Foo, Northrop Grumman Space Technology
> > Models&Simulations,System Engineering,(310)813-5501
> >
> >
> >
> ------------------------------------------------------------------------
>
> >
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> --------------------------------------------------------------
> Adam Phillips asphilli_at_ucar.edu
> <mailto:asphilli_at_ucar.edu>
> National Center for Atmospheric Research tel: (303) 497-1726
> ESSL/CGD/CAS fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 19 Apr 2006 14:39:28 -0600
> From: Rick Grubin <grubin_at_ucar.edu <mailto:grubin_at_ucar.edu>>
> Subject: Re: What does OPeNDAP stand for?
> To: "Foo, Alex (Space Technology)" <alex.foo_at_ngc.com
> <mailto:alex.foo_at_ngc.com>>
> Cc: ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> Message-ID: <3d6aeca0666ee1473d0f0fb0bac60d6a_at_ucar.edu
> <mailto:3d6aeca0666ee1473d0f0fb0bac60d6a_at_ucar.edu>>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Hello Alex,
>
> > I am about to download the latest version NCL 4.2.0 for my installed
> > WRFSI_V2.1.2.
> > Should I download OPeNDAP-enabled one or the not-OPeNDAP-enabled one?
> > What does OPeNDAP stand for?
>
> OPeNDAP stands for OPen Network Data Access Protocol; see
> http://www.opendap.org
>
> OPeNDAP functionality allows a user to access data remotely, rather
> than having to download/copy to a local system.
>
> As an example, to open a file local to your host:
>
> f = addfile("my.data", "r")
>
> If "my.data" resided elsewhere (not local to your host) and you didn't
> want to/couldn't download it, you could say:
>
> f = addfile(" http://fully/qualified/path/to/the/file/my.data", "r")
>
> See the documentation:
> http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/isfilepresent.shtml
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/isfilepresent.shtml>
>
> and the example:
>
> http://www.ncl.ucar.edu/Applications/opendap.shtml
>
> -Rick.
> ----
> Rick Grubin NCAR/CISL/SCD/VETS
> Visualization + Enabling Technologies
> grubin_at_ucar.edu <mailto:grubin_at_ucar.edu> 303.497.1832
>
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 20 Apr 2006 10:55:06 +0100
> From: Gary J Robinson < gazza_at_mail.nerc-essc.ac.uk
> <mailto:gazza_at_mail.nerc-essc.ac.uk>>
> Subject: Multiple plot file name versus single resource
> file name
> To: ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> Message-ID:
> < D3CBA055-CE25-4F4C-BECB-2D5A56CCA473_at_mail.nerc-essc.ac.uk
> <mailto:D3CBA055-CE25-4F4C-BECB-2D5A56CCA473_at_mail.nerc-essc.ac.uk>>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> I am trying to create a set of PDF files that use the same
> resources. If I use the gsn_open_wks function then I can either
> specify the output file name(s) in the second argument OR specify
> the single resource file - resulting in the output file having to be
> renamed. The latter is not an option as I have multiple jobs running
> the same script, which could cause filename conflicts. I therefore
> use the first option and rely on the resources to be picked up from
> the hluresfile. Unfortunately, as I am invoking the ncl script from
> within a wrapper C program (via the system() function), this doesn't
> always work for some strange reason. Has anyone got any suggestions?
>
>
> Dr Gary J Robinson
>
> Using NCL 4.2.0.a033 on Linux, Solaris 10 and Mac OS X 10.4.6
>
>
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Thu, 20 Apr 2006 13:45:02 +0200
> From: Marjolaine Rouault < marjolaine_at_telkomsa.net
> <mailto:marjolaine_at_telkomsa.net>>
> Subject: using named colors
> To: ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> Message-ID: < 200604201345.02797.marjolaine_at_telkomsa.net
> <mailto:200604201345.02797.marjolaine_at_telkomsa.net>>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
> I am trying to generate a map with my own colors for the land and
> ocean fills.
> I am using named colors from the NCL color database. When using the
> ncl script
> color_17.ncl (from the NCL Home> Application examples> Plot techniques
> section), all my colors come out perfectly as they should.
>
> However, when using the same colors in my own script, the colors change
> completely. For example, PeachPuff becomes yellow and BurlyWood
> becomes grey.
>
> Can anyone help?
>
> Marjolaine Rouault
>
>
> ------------------------------
>
> Message: 7
> Date: Thu, 20 Apr 2006 08:21:43 -0600
> From: Adam Phillips <asphilli_at_cgd.ucar.edu
> <mailto:asphilli_at_cgd.ucar.edu>>
> Subject: Re: using named colors
> To: Marjolaine Rouault <marjolaine_at_telkomsa.net
> <mailto:marjolaine_at_telkomsa.net>>
> Cc: ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> Message-ID: <444798F7.40300_at_cgd.ucar.edu
> <mailto:444798F7.40300_at_cgd.ucar.edu>>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Marjolaine,
>
> Just to be sure, are you using gsn_define_colormap to define your new
> colormap?
>
> colors = (/"white", "black", "PeachPuff", "MintCream", "SlateBlue", \
> "Khaki", "OliveDrab","BurlyWood", "LightSalmon", "Coral", \
> "HotPink", "LemonChiffon", "AliceBlue",
> "LightGrey", \
> "MediumTurquoise", "DarkSeaGreen", "Peru", "Tomato", \
> "Orchid","PapayaWhip"/)
> gsn_define_colormap(wks, colors)
>
> color_17.ncl doesn't define a colormap for you to use in a plot, it
> simply draws each color that is passed into the procedure
> gsn_draw_named_colors.
>
> If you are indeed using gsn_define_colormap, please let us know and send
> us your script...
> Adam
>
> Marjolaine Rouault wrote:
> > Hi,
> >
> > I am trying to generate a map with my own colors for the land and
> ocean fills.
> > I am using named colors from the NCL color database. When using
> the ncl script
> > color_17.ncl (from the NCL Home> Application examples> Plot
> techniques
> > section), all my colors come out perfectly as they should.
> >
> > However, when using the same colors in my own script, the colors
> change
> > completely. For example, PeachPuff becomes yellow and BurlyWood
> becomes grey.
> >
> > Can anyone help?
> >
> > Marjolaine Rouault
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> --------------------------------------------------------------
> Adam Phillips asphilli_at_ucar.edu
> <mailto:asphilli_at_ucar.edu>
> National Center for Atmospheric Research tel: (303) 497-1726
> ESSL/CGD/CAS fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
>
>
> ------------------------------
>
> Message: 8
> Date: Thu, 20 Apr 2006 07:33:50 -0600
> From: Mary Haley < haley_at_ucar.edu <mailto:haley_at_ucar.edu>>
> Subject: Re: using named colors
> To: Marjolaine Rouault <marjolaine_at_telkomsa.net
> <mailto:marjolaine_at_telkomsa.net>>
> Cc: ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> Message-ID: <9026528c7e66b4cd19e26786621914e2_at_ucar.edu
> <mailto:9026528c7e66b4cd19e26786621914e2_at_ucar.edu>>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Hi Marjolaine,
>
> In order to use named colors, they actually have to be in your color
> map. In
> the gsn_draw_named_colors procedure, it is taking the list of name
> colors and loading
> them into a colormap before it draws them.
>
> You can load them directly using gsn_define_colormap:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>
> begin
> wks = gsn_open_wks("x11","color")
>
> colors = (/"white", "black", "PeachPuff", "MintCream",
> "SlateBlue", \
> "Khaki", "OliveDrab","BurlyWood", "LightSalmon", "Coral", \
> "HotPink", "LemonChiffon", "AliceBlue",
> "LightGrey", \
> "MediumTurquoise", "DarkSeaGreen", "Peru", "Tomato", \
> "Orchid","PapayaWhip"/)
>
> gsn_define_colormap(wks,colors)
> gsn_draw_colormap(wks) ; draw current colormap
> end
>
> If you already have a color map that you need to use, and you just need
> to add
> these colors, you can do it with gsn_merge_colormaps:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>
> begin
> wks = gsn_open_wks("x11","color")
>
> colors = (/"white", "black", "PeachPuff", "MintCream",
> "SlateBlue", \
> "Khaki", "OliveDrab","BurlyWood", "LightSalmon", "Coral", \
> "HotPink", "LemonChiffon", "AliceBlue",
> "LightGrey", \
> "MediumTurquoise", "DarkSeaGreen", "Peru", "Tomato", \
> "Orchid","PapayaWhip"/)
>
> gsn_merge_colormaps(wks,"rainbow",colors)
> gsn_draw_colormap(wks) ; draw current colormap
> end
>
> When using gsn_merge_colormaps, the second two arguments can be
> predefined
> colormap names (like "rainbow" or "BlWhRe"), an array of RGB triplets,
> or a list
> of named colors.
>
> --Mary
>
>
> On Apr 20, 2006, at 5:45 AM, Marjolaine Rouault wrote:
>
> > Hi,
> >
> > I am trying to generate a map with my own colors for the land and
> > ocean fills.
> > I am using named colors from the NCL color database. When using the
> > ncl script
> > color_17.ncl (from the NCL Home> Application examples> Plot
> techniques
> > section), all my colors come out perfectly as they should.
> >
> > However, when using the same colors in my own script, the colors
> change
> > completely. For example, PeachPuff becomes yellow and BurlyWood
> > becomes grey.
> >
> > Can anyone help?
> >
> > Marjolaine Rouault
> > _______________________________________________
> > ncl-talk mailing list
> > ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu <mailto:ncl-talk_at_ucar.edu>
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 29, Issue 18
> ****************************************
>
>
>
>
> --
> Siraj Ul Islam
> 1: Research Fellow (Climate Section)
> Global Change Impact Studies Centre
> First Floor Saudi Pak tower
> Blue Area Islamabad Pakistan
> Ph : 92-51-9219785
> Fax : 92-51-9219787
>
> 2: Mphil Scholar
> Computational Physics and Simulation Group
> Department of Physics
> Quaid e Azam University
> Islamabad.
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 21 2006 - 09:09:09 MDT

This archive was generated by hypermail 2.2.0 : Mon Apr 24 2006 - 09:06:45 MDT