[ncl-talk] landseamask
Ehsan Taghizadeh
ehsantaghizadeh at yahoo.com
Thu Dec 20 06:41:13 MST 2018
Dear MaryYour answer is exactly what I want. However I still have 2 problems and I'll be thankful for any help about them.1. Caspian sea and Black sea didn't fill (WRF1.png in attached)! So I added following line: res_ter at mpInlandWaterFillColor = "SkyBlue"
and it seems works (WRF2.png in attached).2. However in both figures I missed last shaded contours (here precipitation) on water lands! So I added following line too: res_tot at cnFillDrawOrder = "PostDraw" ; Also can try "Predraw"Now I missed contour lines for both precipitation and boundaries (WRF3.png in attached)! Beside that I've got RasterFill for precipitation. I've used res_tot at cnFillMode = "RasterFill"however it didn't affect for figures (WRF1.png and WRF2.png), but it affected WRF3.png!
My plot lines are as below: plot_terrain = gsn_csm_contour_map(wks,HGT,res_ter) add_outlines_to_map(wks,plot_terrain) ; OK add_places_to_map(wks,plot_terrain) ; OK plot_raintot = gsn_csm_contour(wks,RainTotal,res_tot)
overlay(plot_terrain, plot_raintot) draw(plot_terrain) frame(wks)
I hope my email is clear and I ask my problem correctly. Also I attached my script, even though it seems sloppy and doesn't have input data!Any help will be appreciated.
SincerelyEhsan On Wednesday, December 19, 2018, 7:55:28 PM GMT+3:30, Mary Haley <haley at ucar.edu> wrote:
Ehsan,
Do you mean that you want to fill the ocean in some solid color and hence mask any data in that area? If so, you can try:
res at mpFillOn = True res at mpOceanFillColor = "SkyBlue" ; use whatever color you want res at mpLandFillColor = "Transparent" ; to make sure land doesn't get filled
You might also need to set some draw order resources, to make sure the filled contours and filled map areas get drawn in the right order:
res at cnFillDrawOrder = "Draw" ; Also can try "predraw" res at mpFillDrawOrder = "PostDraw"
You can see some masking examples at:
http://www.ncl.ucar.edu/Applications/mask.shtml
Use your browser search to look for "draworder".
--Mary
On Wed, Dec 19, 2018 at 8:13 AM Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com> wrote:
Hi,May I ask how to fill sea (lake, ...) areas differently from land. I've tried using "https://www.ncl.ucar.edu/Applications/grid_fill.shtml" (grid_fill_5.ncl) and I've got attached map.That part which I used from grid_fill_5.ncl are:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Read/open NCL'ls crude (1x1) land-sea mask;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a2 = addfile("$NCARG_ROOT/lib/ncarg/data/cdf/landsea.nc","r") lsdata = a2->LSMASK lsm = landsea_mask(lsdata, xlat, xlong)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
HGT2 := HGT ; replicate for plot HGT2 = where(lsm.eq.0 , HGT2 at _FillValue , HGT2) HGT2 = where(lsm.eq.2 , HGT2 at _FillValue , HGT2) HGT2 = where(lsm.eq.4 , HGT2 at _FillValue , HGT2);;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
where "HGT" is "Terrain Height" of WRF. The issue of the attached file is raster filled of sea areas. However is there a better way to fill sea areas?
SincerelyEhsan_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181220/a12739c2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRF1.png
Type: image/png
Size: 342851 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181220/a12739c2/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRF2.png
Type: image/png
Size: 332578 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181220/a12739c2/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRF3.png
Type: image/png
Size: 263479 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181220/a12739c2/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WRF_pcp_tv.ncl
Type: application/octet-stream
Size: 13361 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181220/a12739c2/attachment-0001.obj>
More information about the ncl-talk
mailing list