[ncl-talk] missing values rtest

Noelia otero noeli1680 at gmail.com
Thu Sep 4 15:45:56 MDT 2014


Hi all,

I have some problems using rtest when I have "missing values". I want to
plot one field and overlaying the significant values of a second one, but
the problem is that the pattern also appears in the areas with missing
values.

My try is below:

       ; defining i=0 (for one model)

        cor = corFiles[i]->cor(0,:,:)
        reg = corFiles[i]->reg(0,:,:)
        lat = corFiles[i]->lat
        lon = corFiles[i]->lon
        lon at long_name = "longitude"
        lon at units = "degrees_east"
        lat at long_name = "latitude"
        lat at units = "degrees_north"

        um = rtest(reg(lat|:, lon|:), siz(i), 0) ; rtest for the regression
        um!0 = "lat"
        um!1 = "lon"
        um&lat = lat
        um&lon = lon

   ; Plot 1
       res              = True
        res at gsnAddCyclic = False
        res at gsnDraw = False
        res at gsnFrame = False
        res at cnFillOn       = True
        res at cnLinesOn    = False
        res at mpMinLonF = min(cor&lon)
        res at mpMinLatF = min(cor&lat)
        res at mpMaxLonF = max(cor&lon)
        res at mpMaxLatF = max(cor&lat)
        res at lbLabelBarOn = False
        res at cnLevelSelectionMode = "ManualLevels"      ; set manual contour
levels
        res at cnMinLevelValF = -1.00    ; set min colour level
        res at cnMaxLevelValF = 1.00     ; set max colour level
        res at cnLevelSpacingF = 0.2     ; set colour spacing

        plot   = gsn_csm_contour_map_ce(wks,cor, res)

    ;plot 2

       res2 = True
        res2 at gsnAddCyclic = False
        res2 at gsnDraw = False
        res2 at gsnFrame = False
        res at cnFillOn       = True
        res at cnLinesOn    = False
        res2 at cnLevelSelectionMode = "ManualLevels"
        res2 at cnMinLevelValF = 0.00
        res2 at cnMaxLevelValF = 1.00
        res2 at cnLevelSpacingF = 0.01
        res2 at cnInfoLabelOn = False
        res2 at cnLinesOn = False
        res2 at cnLineLabelsOn = False
        res2 at cnFillScaleF = 0.6

        plot2 = gsn_csm_contour(wks,um,res2)

   ;Overlay
       opt = True
        opt at gsnShadeFillType = "pattern"      ; pattern fill
        opt at cnFillPatterns    =17
        opt at cnFillScales = 0.3
        opt at gsnShadeLow = 7                   ; use pattern #2

        plot2 = gsn_contour_shade(plot2,0.05,-999,opt)  ; the sginificant
values

   overlay(plot,plot2)

I also wanted to take the chance to ask, is there any way to put the
pattern like a dashed line instead a continue line?? (I had read that the
color can't be changed, but I am not sure), would there be any way to
change the color of the pattern?

Many thanks in advance for your help,

cheers,

Noelia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140904/83586984/attachment.html 


More information about the ncl-talk mailing list