[ncl-talk] masking only over Myanmar

Karin Meier-Fleischer meier-fleischer at dkrz.de
Tue Sep 6 08:43:08 MDT 2016


Hi Gaeun,

please send your replies always to ncl-talk so everyone who is 
interested in can follow.

You have to set

   res4 at mpFillOn = True

because you want to fill the map area of Myanmar.

If I run the following short script no error occurs:

begin
   wks = gsn_open_wks("png","plot_country_fill_area_by_name")

   res                       =  True
   res at pmTickMarkDisplayMode = "Always"      ;-- turn on map tickmarks
   res at mpDataSetName         = "Earth..4"    ;-- new database
   res at mpDataBaseVersion     = "MediumRes"   ;-- Medium resolution database
   res at mpOutlineOn           =  True         ;-- turn on map outlines
   res at mpFillOn              =  True         ;-- turn on map fill
   res at mpOutlineBoundarySets = "National"    ;-- draw only national bounds
   res at mpLandFillColor       = "white"       ;-- set map land fill to white
   res at mpFillAreaSpecifiers  = (/"Myanmar"/) ;-- fill listed states
   res at mpSpecifiedFillColors = (/"red"/)     ;-- use generated color array

   map = gsn_csm_map(wks,res)    ;-- create the map
end

Bye,
Karin


Am 06.09.16 um 16:20 schrieb 김가은:
> Dear Karin
>
> Thanks for your advice Karin!
>
> but the thing is if I set the resource like this:
>
>   res4 at mpFillOn                         = False
>   ;res4 at mpOutlineOn                      = True
>   res4 at mpDataBaseVersion               = "MediumRes"
>   res4 at mpDataSetName                    = "Earth..4"
>   ;res4 at mpOutlineBoundarySets            = "National"
>
> I keep getting segmentation fault :(
> is there any wrong with this?
>
> Regards,
> Gaeun
>
>
>
>
>
> 2016-09-06 15:20 GMT+09:00 Karin Meier-Fleischer 
> <meier-fleischer at dkrz.de <mailto:meier-fleischer at dkrz.de>>:
>
>     Hi Gaeun,
>
>     you have to set the mpDataBaseVersion resource to Ncarg4_1 or the
>     alias MediumRes when
>     accessing the MapPlot database Earth..4.  See
>     http://www.ncl.ucar.edu/Document/HLUs/Classes/MapPlotData4_1_earth_4.shtml
>     <http://www.ncl.ucar.edu/Document/HLUs/Classes/MapPlotData4_1_earth_4.shtml>
>
>     Insert the following line to your script
>
>     res3 at mpDataBaseVersion = "MediumRes"
>
>
>     Bye,
>     Karin
>
>
>>     Am 06.09.2016 um 03:11 schrieb 김가은 <gaeun.kim0921 at gmail.com
>>     <mailto:gaeun.kim0921 at gmail.com>>:
>>
>>     Hi, me again. always thanks for your big help.
>>
>>     I'm trying to present data only over Myanmar territory
>>     like this example :
>>     https://www.ncl.ucar.edu/Applications/Images/mask_4_lg.png
>>     <https://www.ncl.ucar.edu/Applications/Images/mask_4_lg.png>
>>
>>     and this is what I've done:
>>
>>     ;---- Source for plot (Myanmar)
>>       fill_specs = (/"water", "Land"/)
>>       mask_specs = (/"Myanmar"/)
>>       res3    = res
>>       res3 at mpDataSetName    = "Earth..4"
>>       res3 at mpFillBoundarySets   = "NoBoundaries"
>>       res3 at mpFillAreaSpecifiers   = fill_specs
>>       res3 at mpSpecifiedFillColors    = (/7,2/)
>>
>>       res3 at mpAreaMaskingOn    = 1
>>       res3 at mpMaskAreaSpecifiers   = mask_specs
>>
>>       res3 at mpMinLonF    = 90 ;123 ;25  Horn of Africa
>>       res3 at mpMaxLonF    = 105 ;132 ;53
>>       res3 at mpMinLatF    = 0 ;32 ;-10
>>       res3 at mpMaxLatF    = 30 ;45 ;20
>>     ;---- Source for Panel
>>       pres3   = pres
>>       pres3 at txString = "Total Precipitation of ICON (40km) over Myanmar"
>>     ;---- Draw panel plot (Myanmar)
>>       res3 at gsnCenterString              = "SEP 2016"
>>       plot_3(0) = gsn_csm_contour_map_ce(wks,Total_p(0,:,:),res3)
>>       res3 at gsnCenterString              = "OCT 2016"
>>       plot_3(1) = gsn_csm_contour_map_ce(wks,Total_p(1,:,:),res3)
>>       res3 at gsnCenterString              = "NOV 2016"
>>       plot_3(2) = gsn_csm_contour_map_ce(wks,Total_p(2,:,:),res3)
>>       res3 at gsnCenterString              = "SON 2016"
>>       plot_3(3) = gsn_csm_contour_map_ce(wks,Total_p(3,:,:),res3)
>>       gsn_panel(wks,plot_3,(/2,2/),pres3)
>>
>>     the result is ...
>>     warning:MapV40DHUpdateDrawList: invalid boundary specification
>>     string: "myanmar"
>>     warning:MapV40DHUpdateDrawList: invalid boundary specification
>>     string: "myanmar"
>>     warning:MapV40DHUpdateDrawList: invalid boundary specification
>>     string: "myanmar"
>>     warning:MapV40DHUpdateDrawList: invalid boundary specification
>>     string: "myanmar"
>>
>>     could anyone give me an advice?
>>
>>     Regards,
>>     Gaeun
>>
>>     _______________________________________________
>>     ncl-talk mailing list
>>     ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>>     List instructions, subscriber options, unsubscribe:
>>     http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>     <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
>

-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany

Phone:    +49 (0)40 460094 126
Fax:      +49 (0)40 460094 270
E-Mail:   meier-fleischer at dkrz.de
URL:      www.dkrz.de

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160906/0eaa7591/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_country_fill_area_by_name.png
Type: image/png
Size: 73102 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160906/0eaa7591/attachment-0001.png 


More information about the ncl-talk mailing list