[ncl-talk] need help to edit maps to exclude color on the ocean and contour values on land points

Ruksana Abedin ruksana.abedin at gmail.com
Mon Nov 21 06:55:22 MST 2016


Dear Mary,

Thank you very much for pointing at the issue and the fix for it. Now, the
plot could be corrected with no color on the ocean points.

But what about excluding the data values on the contours randomly on the
land points? How can I disable this option? I have not set any resource for
this, it is done somehow automatically. Please can you help me to avoid
these values on the maps?

Best regards,
Ruksana


On Mon, Nov 21, 2016 at 12:37 PM, Mary Haley <haley at ucar.edu> wrote:

> Ruksana,
>
> It is very important that you look at your data before you assume that NCL
> is plotting it incorrectly.
>
> If you look at "ppt3" with printVarSummary and printMinMax, you will see
> that your missing values are not set correctly.
>
> Here's the printVarSummary, which claims the missing value is -99.9:
>
> Variable: ppt3
> Type: float
> Total Size: 3480 bytes
>             870 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 1] x [lat | 30] x [lon | 29]
> Coordinates:
>             time: [14400..14400]
>             lat: [15.25..29.75]
>             lon: [  83..  97]
> Number Of Attributes: 5
>   long_name : daily precipitation analysis interpolated onto 0.5deg grids
> [mm/day]
>   units : mm/day
>   _FillValue : -99.9
>   missing_value : -99.9
>   level_description : Earth surface
>
> However, if you do a printMinMax on pp3, you will see a maximum value of
> 1e+20, which seems suspicious:
>
> daily precipitation analysis interpolated onto 0.5deg grids [mm/day]
> (mm/day) : min=-2497.37   max=1e+20
>
> My guess is that you need to set the missing value of ppt3 to 1e20:
>
> ppt3 at _FillValue = 1e20
>
> --Mary
>
>
>
> On Sat, Nov 19, 2016 at 2:35 PM, Ruksana Abedin <ruksana.abedin at gmail.com>
> wrote:
>
>> Hi,
>>
>> I have plotted a panel of two bias maps. The plot, input files and the
>> script is attached. Problem is although my data is only on land points, on
>> the first bias map, the ocean is colored as orange, which should not be the
>> case. And the maps show few values of the contours on the land points
>> irregularly, but I do not want any values to be shown. Can you please help
>> me to do these two corections?
>>
>> Thank you for your time and kind efforts.
>>
>> Best regards,
>> Ruksana
>>
>>
>>
>> begin
>>
>> ; read in data
>>
>> f3=addfile(".........../WAH_APHRO_1998_2007_ANN_sum_precip_bias.nc",
>> "r");
>> f4=addfile(".........../WAH_GPCC_1998_2007_ANN_sum_precip_bias.nc", "r");
>>
>> ppt3 = f3->precip
>> time = f3->time
>> lat = f3->lat
>> lon = f3->lon
>>
>> ppt4 = f4->precip
>> time = f4->time
>> lat = f4->lat
>> lon = f4->lon
>>
>> wks = gsn_open_wks("eps","ppt1")
>> plot = new(2,graphic)
>>
>> printVarSummary(ppt3)
>> printVarSummary(ppt4)
>>
>>  gsn_define_colormap(wks,"percent_11lev")      ; choose colormap for
>> bias map
>>   ;gsn_reverse_colormap(wks)
>>   res                          = True
>>   res at gsnDraw                  = False
>>   res at gsnFrame                   = False
>>   res at cnInfoLabelOn            = False
>>   res at cnFillOn                 = True                 ; turn on color
>>   res at cnLinesOn                = False             ; turn off contour
>> lines
>>   res at cnLevelSpacingF          = 0.10              ; contour interval
>>   res at cnFillDrawOrder          = "PreDraw"         ; draw contours first
>>   res at lbLabelStride            = 2                 ; stride on label bar
>>   res at gsnSpreadColors          = True              ; use full colormap
>>   res at gsnSpreadColorEnd        = -3                ; -3 don't use land
>> color
>>   res at gsnAddCyclic             = False             ; regional data
>>   res at gsnStringFontHeightF     = 0.01
>>   res at tiMainString             = ""
>>   res at gsnRightString           = ""
>>   ;res at mpProjection            = "LambertConformal"
>>   ;res at gsnMaskLambertConformal = True
>>   res at gsnLeftString            = ""
>>   res at mpMaxLatF                = 30;max(lat)  ; zoom in on region
>>   res at mpMinLatF                = 15;min(lat)
>>   res at mpMinLonF                = 83;min(lon)
>>   res at mpMaxLonF                = 97; max(lon)
>>   res at mpCenterLonF             = 10                ; def is zero
>>   res at mpLandFillColor          = "Transparent"
>>   res at cnLevelSelectionMode= "ManualLevels"
>>
>>   res at cnMinLevelValF      =  -2150.00       ;for bias maps
>>   res at cnMaxLevelValF      =  4450;100
>>   res at cnLevelSpacingF     = 150 ; 150
>>
>>   res at lbLabelBarOn         = False
>>   res at lbLabelAutoStride   = True
>>   ppt3 at _FillValue    = 0.0
>>   ppt3 at _FillValue    = -999
>>
>> plot(0) = gsn_csm_contour_map(wks,ppt3(0,:,:),res)
>> plot(1) = gsn_csm_contour_map(wks,ppt4(0,:,:),res)
>>
>> ;***********************************************************
>> ; create panel
>> ;***********************************************************
>>
>> resP                          = True
>> resP at gsnFrame                 = False
>> resP at gsnMaximize              = True
>> resP at gsnPanelLabelBar         = True
>> resP at lbLabelFontHeightF       = 0.01
>> gsn_panel(wks,plot,(/2,2/),resP)          ; now draw as one plot
>>
>> end
>>
>>
>> _______________________________________________
>> 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/20161121/2cefe8b6/attachment.html 


More information about the ncl-talk mailing list