Re: Adding Tropical Cyclone Symbol

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 16 2012 - 10:21:37 MDT

You can do this using NhlNewMarker to add the tropical cyclone symbol to your marker table, and then gsn_add_text to attach this marker to your map.

1. First you need to find the symbol in our font tables

   NCL Home Page -> Popular Links -> Font Tables

It's in the "Weather2" font table, character "p".

2. Use NhlNewMarker to add this marker to the existing marker table.

http://www.ncl.ucar.edu/Document/Functions/Built-in/NhlNewMarker.shtml

3. Use gsn_add_polymarker to attach this marker to the map.

4. Draw the map with the attached marker(s) using "draw".

Here's a sample code:

------------------------------------------------------------------------------------------------------------------------------------------------------------

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
 wks = gsn_open_wks ("x11","cyclone")

;---Create a map so we can add a marker to it.
 res = True
 res@gsnDraw = False
 res@gsnFrame = False
 map = gsn_csm_map (wks,res)

;---Set some parameters to add a cyclone to existing marker table
 mstring = "p"
 fontnum = 37
 xoffset = 0.0
 yoffset = 0.0
 ratio = 1.0
 size = 1.0
 angle = 0.

 cyc_id = NhlNewMarker(wks, mstring, fontnum, xoffset, yoffset, \
                       ratio, size, angle)

;---Using the new marker id, attach two markers to the existing map
 mkres = True
 mkres@gsMarkerIndex = cyc_id

 dum = gsn_add_polymarker(wks,map,(/-55,-60/),(/20,21/),mkres)

;---Drawing the map will also draw the marker symbol
 draw(map)
 frame(wks)

end

------------------------------------------------------------------------------------------------------------------------------------------------------------

--Mary

On Oct 13, 2012, at 4:04 PM, Xi Chang wrote:

> Dear NCL,
>
> Anybody can tell me how could I add the tropical cyclone/storm symbol
> on my lat-lon map. Thanks in advance
>
> --Xi
> _______________________________________________
> 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 Tue Oct 16 10:21:50 2012

This archive was generated by hypermail 2.1.8 : Tue Oct 23 2012 - 11:10:04 MDT