Hello,
I think you cam really close with your script. I took pieces of your
script, modified it, used my own data file, and came up with what I
think you want. (Plot and script attached.)
The key was to set mpFillDrawOrder = "PostDraw", so the map fill masks
every region minus the Brazil states after the contour fill plot is
applied.
Hope that helps, let the group know if that isn't what you were after...
Adam
On 06/09/2010 11:45 AM, carina.padilha@ufpel.edu.br wrote:
>
>
> Hi
>
> I am using station data from some cities of south of Brazil. They are stored
> into a .csv file, where the first field is longitude, the second field is
> latitude and the next field is the variable. I made a script that fill the area
> from the point of the data, that means, it is filled in part of south of Brazil
> but also it is filled over part of the other countries. I want to see a figure
> that fill south of Brazil and don't plot the variable over the other countries
> of South America, nor over the Atlantic Ocean. In fact, I want to fill just the
> south state of Brazil. I want something like this example:
> http://www.ncl.ucar.edu/Applications/Images/mask_8_lg.png. Is there a way to
> make this using ncl? Perhaps converting
> this file to grid and using the grid file? The figure generated by the script is
> attached.
> Above, the script that I made:
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
>
>
> begin
>
>
> dados = "dados_2010_04.csv"
>
> lines = asciiread(dados,-1,"string")
>
>
> campo1 = str_get_field(lines,1,";")
>
> lon = stringtofloat(campo1)
>
> campo2 = str_get_field(lines,2,";")
>
> lat = stringtofloat(campo2)
>
> campo3 = str_get_field(lines,3,";")
>
> dec1 = stringtofloat(campo3)
>
>
> wks = gsn_open_wks("ps","figura1")
>
>
>
> gsn_define_colormap(wks,"BlRe")
>
>
>
> res = True
>
> res@gsnFrame = False
>
> res@gsnMaximize = True
>
> res@gsnPaperOrientation = "portrait"
>
> res@cnFillOn = True
>
> res@cnFillColors = (/70,66,60,43,40,36,31,28,17,14/)
>
> res@cnLevelSelectionMode = "ExplicitLevels"
>
> res@cnLevels = (/20,30,40,50,60,70,80,90,100,150/)
>
>
>
>
> ;;;;;;;;;;;;Title
>
> ; tabela de acentos
>
> atilde = "a:H-13V2F35:D:FV-2H3:"
>
> cedil = "c:H-13F35:K:FH2:"
>
> ecirc = "e:H-13V2F35:C:FV-2H3:"
>
> degree = ":S:o:N:"
>
> res@tiMainString = "Precipita"+cedil+atilde+"o 1"+degree+" dec"+ecirc+"ndio de
> abril de 2010"
>
>
> res@sfXArray = lon
>
> res@sfYArray = lat
>
> res@mpProjection = "LambertConformal"
>
> res@mpLambertParallel1F = -30
>
> res@mpLambertParallel2F = -20
>
> res@mpLambertMeridianF = -45
>
> res@mpLimitMode = "LatLon"
>
> res@mpMinLatF = -34
>
> res@mpMaxLatF = -27
>
> res@mpMinLonF = -58
>
> res@mpMaxLonF = -49
>
>
>
> res@mpDataSetName = "Earth..4"
>
> res@mpOutlineOn = True
>
> res@mpDataBaseVersion = "MediumRes"
>
> res@mpOutlineSpecifiers = (/"Brazil:states"/)
>
> res@mpFillAreaSpecifiers = (/"Land", "Brazil:states","Water"/)
>
> res@mpSpecifiedFillColors = (/0,-1,49/)
>
> res@mpOutlineBoundarySets = "AllBoundaries"
>
>
>
> map = gsn_csm_contour_map(wks,dec1,res)
>
> draw(map)
>
>
> end
>
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-- __________________________________________________ Adam Phillips asphilli@ucar.edu National Center for Atmospheric Research tel: (303) 497-1726 Climate and Global Dynamics Division fax: (303) 497-1333 P.O. Box 3000 Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2.1.8 : Fri Jun 11 2010 - 09:33:23 MDT