<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Adv,<br>
<br>
I'd run the script below with another CMIP5 tas_Amon file I had and
I got a <br>
plot with data values (colors). The plot is attached.<br>
<br>
It is your script but I cleaned it and made some indents which makes
it more readable.<br>
Try to run it with your data.<br>
;---------------------------------------------------------<br>
<font color="#3366ff"><tt>begin</tt><tt><br>
</tt><tt><br>
</tt><tt> f1 =
addfile("$HOME/data/CMIP5/atmos/tas_Amon_MPI-ESM-LR_historical_r3i1p1_185001-200512.nc",
"r") ; note the "s" of addfile</tt><tt><br>
</tt><tt> u1 = f1->tas</tt><tt><br>
</tt><tt> printVarSummary(u1) ; [time|
720]x[lat| 91]x[lon| 180]</tt><tt><br>
</tt><tt><br>
</tt><tt> ua1=u1(lat|:,lon|:,time|1332:)</tt><tt><br>
</tt><tt> ua11=u1(time|1332:,lat|:,lon|:)</tt><tt><br>
</tt><tt> printVarSummary(ua1) ;
[time| 720]x[lat| 91]x[lon| 180]</tt><tt><br>
</tt><tt><br>
</tt><tt> ua11 = ua11-273.15</tt><tt><br>
</tt><tt> ua11@units = "degC"</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> yyyymm = cd_calendar(ua11&time, -1)</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> yyyy = yyyymm/100</tt><tt><br>
</tt><tt> dimx = dimsizes(ua11)</tt><tt><br>
</tt><tt> ntim = dimx(0) ; all years and months</tt><tt><br>
</tt><tt><br>
</tt><tt> year = ispan(yyyy(0), yyyy(ntim-2), 1)</tt><tt><br>
</tt><tt> print(year)</tt><tt><br>
</tt><tt> nyrs = dimsizes(year)</tt><tt><br>
</tt><tt> print(nyrs)</tt><tt><br>
</tt><tt><br>
</tt><tt> xann1 = month_to_annual(ua11 , 1)
; [year| 60]x[lat| 91]x[lon| 180]</tt><tt><br>
</tt><tt> printVarSummary(xann1)</tt><tt><br>
</tt><tt> xann1&year = year</tt><tt><br>
</tt><tt><br>
</tt><tt> rc1 = regCoef(year,xann1(lat|:,lon|:,year|:))</tt><tt><br>
</tt><tt> copy_VarCoords(ua11(0,:,:), rc1)</tt><tt><br>
</tt><tt> rc1 = rc1*45</tt><tt><br>
</tt><tt> tval1 = onedtond(rc1@tval , dimsizes(rc1))</tt><tt><br>
</tt><tt> printVarSummary(tval1)</tt><tt><br>
</tt><tt> df1 = onedtond(rc1@nptxy, dimsizes(rc1)) - 2</tt><tt><br>
</tt><tt> printVarSummary(df1)</tt><tt><br>
</tt><tt> b = 0.5</tt><tt><br>
</tt><tt> t4 = onedtond(0.5,dimsizes(rc1))</tt><tt><br>
</tt><tt> prob1 = (1-betainc(df1/(df1+tval1^2),df1/2.0,t4))</tt><tt><br>
</tt><tt> print(prob1)</tt><tt><br>
</tt><tt> printVarSummary(prob1)</tt><tt><br>
</tt><tt> copy_VarCoords(rc1,prob1)</tt><tt><br>
</tt><tt> printVarSummary(prob1)</tt><tt><br>
</tt><tt><br>
</tt><tt> print(prob1)</tt><tt><br>
</tt><tt> print(min(prob1))</tt><tt><br>
</tt><tt> print(max(prob1))</tt><tt><br>
</tt><tt> printVarSummary(prob1)</tt><tt><br>
</tt><tt><br>
</tt><tt>;**************************************************</tt><tt><br>
</tt><tt>; plot parameters</tt><tt><br>
</tt><tt>;**************************************************</tt><tt><br>
</tt><tt><br>
</tt><tt> wks =
gsn_open_wks("png","NorthernPlains_Significant_AirTemp_1961-2005")
; Open ps file</tt><tt><br>
</tt><tt> gsn_define_colormap(wks,"gui_default") ;
assign colormap</tt><tt><br>
</tt><tt><br>
</tt><tt> plot = new(1,graphic) ; create a
plot array</tt><tt><br>
</tt><tt><br>
</tt><tt> res = True</tt><tt><br>
</tt><tt> res@gsnDraw = False ; don't
draw</tt><tt><br>
</tt><tt> res@gsnFrame = False ; don't
advance frame</tt><tt><br>
</tt><tt> res@gsnAddCyclic = False</tt><tt><br>
</tt><tt> res@gsnTickMarksOn = False</tt><tt><br>
</tt><tt><br>
</tt><tt> res@lbLabelBarOn = False ; turn off
individual cb's</tt><tt><br>
</tt><tt><br>
</tt><tt> res@txFontHeightF = 0.030 ; adjust
font height of gsnLeftString/gsnRightString titles</tt><tt><br>
</tt><tt> </tt><tt><br>
</tt><tt> res@cnInfoLabelOn = False ; turn off
cn info label</tt><tt><br>
</tt><tt> res@cnLinesOn = False ; turn off
contour lines</tt><tt><br>
</tt><tt> res@cnFillOn = True ; color
plot desired</tt><tt><br>
</tt><tt> res@cnLineLabelsOn = False</tt><tt><br>
</tt><tt> res@cnLevelSelectionMode = "ExplicitLevels" ; set
explicit contour levels</tt><tt><br>
</tt><tt>; res@cnLevels = (/
10,20,30,40,50,60,70,80,90,100/)</tt><tt><br>
</tt><tt> res@cnLevels = (/
0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.1/)</tt><tt><br>
</tt><tt><br>
</tt><tt> res@vpWidthF = 0.90 ; change
aspect ratio of plot</tt><tt><br>
</tt><tt> res@vpHeightF = 0.90</tt><tt><br>
</tt><tt> res@vpXF = 0.05</tt><tt><br>
</tt><tt> res@vpYF = 0.95</tt><tt><br>
</tt><tt><br>
</tt><tt> res@mpGridAndLimbOn = False</tt><tt><br>
</tt><tt> res@mpLimitMode = "LatLon"</tt><tt><br>
</tt><tt> res@mpMinLatF = 40.</tt><tt><br>
</tt><tt> res@mpMaxLatF = 49.</tt><tt><br>
</tt><tt> res@mpMinLonF = 242.</tt><tt><br>
</tt><tt> res@mpMaxLonF = 264.</tt><tt><br>
</tt><tt> res@mpCenterLonF = 252</tt><tt><br>
</tt><tt> res@mpPerimOn = True ;
draw box around map</tt><tt><br>
</tt><tt> res@mpGeophysicalLineThicknessF = 3.0</tt><tt><br>
</tt><tt> res@mpGeophysicalLineColor = "Black"; (/22/)</tt><tt><br>
</tt><tt>; res@mpNationalLineThicknessF = 3.0</tt><tt><br>
</tt><tt> res@mpOutlineBoundarySets =
"GeophysicalAndUSStates" ; add state boundaries</tt><tt><br>
</tt><tt> res@mpNationalLineColor =
res@mpGeophysicalLineColor</tt><tt><br>
</tt><tt> res@mpUSStateLineThicknessF = 3.0</tt><tt><br>
</tt><tt> res@mpUSStateLineColor =
res@mpGeophysicalLineColor</tt><tt><br>
</tt><tt><br>
</tt><tt> plot(0) = gsn_csm_contour_map_ce(wks,prob1,res)</tt><tt><br>
</tt><tt><br>
</tt><tt>;************************************************</tt><tt><br>
</tt><tt>; create panel</tt><tt><br>
</tt><tt>;************************************************</tt><tt><br>
</tt><tt> resP = True ;
modify the panel plot</tt><tt><br>
</tt><tt>; resP@gsnFrame = False ;
don't advance the frame, so we can use gsn_text_ndc</tt><tt><br>
</tt><tt> resP@gsnPanelLabelBar = True ; add
common colorbar</tt><tt><br>
</tt><tt> resP@lbLabelFontHeightF = 0.015 ; set
font height of Label Bar labels</tt><tt><br>
</tt><tt> resP@gsnPanelBottom = 0.2 ;
shrink panel plot by setting bottom edge of plot</tt><tt><br>
</tt><tt> resP@gsnPanelTop = 0.9 ;
shrink panel plot by setting top edge of plot</tt><tt><br>
</tt><tt> resP@pmLabelBarWidthF = 0.7 ; make
thinner</tt><tt><br>
</tt><tt> resP@pmLabelBarHeightF = 0.09</tt><tt><br>
</tt><tt> resP@gsnPanelYWhiteSpacePercent = 5. ;
increase spacing along Y-axis between panel plots</tt><tt><br>
</tt><tt> resP@txString =
"NorthernPlains_AirTemperature_Significant_1961-2005"</tt><tt><br>
</tt><tt><br>
</tt><tt> gsn_panel(wks,plot,(/1,1/),resP) ; now
draw as one plot</tt><tt><br>
</tt><tt><br>
</tt><tt>end</tt></font><br>
;---------------------------------------------------------<br>
<br>
Bye, Karin<br>
<br>
<div class="moz-cite-prefix">Am 13.07.15 um 21:33 schrieb Adv:<br>
</div>
<blockquote
cite="mid:CAHfbfHuLL9i5J4OsOe6GhO-Sj9+S8uBFDrMhoApwDkks+3_+=g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>Hi,<br>
</div>
Sorry about it. Here is the printVarSummary out.<br>
Variable: prob1<br>
Type: float<br>
Total Size: 221184 bytes<br>
55296 values<br>
Number of Dimensions: 2<br>
Dimensions and sizes: [lat | 192] x [lon | 288]<br>
Coordinates: <br>
lat: [ -90.. 90]<br>
lon: [ 0..358.75]<br>
</div>
Thanks<br>
</div>
Adv<br>
<div>
<div>
<div><br>
<br>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Jul 13, 2015 at 1:44 PM, Karin
Meier-Fleischer <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:meier-fleischer@dkrz.de" target="_blank">meier-fleischer@dkrz.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Hi Adv,<br>
<br>
please always reply to ncl-talk!<br>
<br>
Without any information about your data it is not possible
to help.<br>
Please send the output of the printVarSummary(prob1).<br>
<br>
Does your data include the selected region of the map?<br>
<br>
Bye,<br>
Karin<br>
<br>
<div>Am 13.07.15 um 17:30 schrieb Adv:<br>
</div>
<div>
<div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>Hi,<br>
</div>
I get a plot not the values. I have attached
here the output of this script.<br>
</div>
I don't understand. <br>
<br>
</div>
Thanks,<br>
</div>
Adv<br>
<div>
<div>
<div>
<div> <br>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Jul 13, 2015 at
1:53 AM, Karin Meier-Fleischer <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:meier-fleischer@dkrz.de"
target="_blank">meier-fleischer@dkrz.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex">Hi Adv,<br>
<br>
first you have set<br>
<br>
resP@gsnFrame = False<br>
<br>
which will let NCL end without drawing a
frame! Delete the line and you<br>
will get your plot.<br>
<br>
Bye,<br>
Karin<br>
<br>
Am 13.07.15 um 04:54 schrieb Adv:<br>
<div>
<div>> Hi ,<br>
> Could someone point out the error
in this script? It plots no values.<br>
> Many times i checked, the values
are proper. I think graphical part<br>
> has issues.<br>
><br>
>
;****************************************************<br>
>
;****************************************************<br>
> load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
>
;***************************************************<br>
><br>
>
;***************************************************<br>
> begin<br>
>
;***************************************************<br>
> ;prec*.25x.25cpc1948-present-usa
grid<br>
>
;others*2.25x2.25cpc1948-present-globalgrid<br>
> f1 =
addfile("tas_Amon_CCSM4_historical_r3i1p1_185001-200512.nc",<br>
> "r") ; note the "s" of addfile<br>
> u1 = f1->tas<br>
> printVarSummary(u1)
; [time| 720]x[lat|<br>
> 91]x[lon| 180]<br>
> ;;;;;;1961-2005;;;;;;;;;;;;;;;;;<br>
> ua1=u1(lat|:,lon|:,time|1332:)<br>
> ua11=u1(time|1332:,lat|:,lon|:)<br>
> printVarSummary(ua1)
; [time| 720]x[lat|<br>
> 91]x[lon| 180]<br>
> ua11 = ua11-273.15<br>
> ua11@units= "degC"<br>
> ;return<br>
> yyyymm =
cd_calendar(ua11&time, -1)<br>
> yyyy = yyyymm/100<br>
> dimx = dimsizes(ua11)<br>
> ntim = dimx(0) ;
all years and months<br>
><br>
> year = ispan(yyyy(0),
yyyy(ntim-2), 1)<br>
> print(year)<br>
> nyrs = dimsizes(year)<br>
> print(nyrs)<br>
> ;return<br>
> ;delete(u)<br>
> xann1 = month_to_annual(ua11 , 1)
; [year| 60]x[lat|<br>
> 91]x[lon| 180]<br>
> printVarSummary(xann1)<br>
> xann1&year = year<br>
> rc1 =
regCoef(year,xann1(lat|:,lon|:,year|:))<br>
> copy_VarCoords(ua11(0,:,:), rc1)<br>
> rc1=rc1*45<br>
> tval1 = onedtond(rc1@tval ,
dimsizes(rc1))<br>
> printVarSummary(tval1)<br>
> df1 = onedtond(rc1@nptxy,
dimsizes(rc1)) - 2<br>
> printVarSummary(df1)<br>
> b = 0.5<br>
> t4=onedtond(0.5,dimsizes(rc1))<br>
> prob1 =
(1-betainc(df1/(df1+tval1^2),df1/2.0,t4))<br>
> print(prob1)<br>
> printVarSummary(prob1)<br>
> copy_VarCoords(rc1,prob1)<br>
> printVarSummary(prob1)<br>
> ;return<br>
> print(prob1)<br>
> print(min(prob1))<br>
> print(max(prob1))<br>
> printVarSummary(prob1)<br>
>
;**************************************************<br>
> ; plot parameters<br>
>
;**************************************************<br>
><br>
> wks =<br>
>
gsn_open_wks("x11","NorthernPlains_Significant_AirTemp_1961-2005")
;<br>
> Open ps file<br>
>
gsn_define_colormap(wks,"gui_default")
; assign colormap<br>
> plot = new(1,graphic)
; create a plot array<br>
><br>
> res = True<br>
> res@gsnDraw = False
; don't draw<br>
> res@gsnFrame = False
; don't advance frame<br>
> res@cnInfoLabelOn = False
; turn off cn info label<br>
> res@cnLinesOn = False
; turn off contour lines<br>
> res@cnFillOn = True
; color plot desired<br>
> res@cnLineLabelsOn = False<br>
> res@lbLabelBarOn = False
; turn off individual cb's<br>
> res@txFontHeightF = 0.030
; adjust font height of<br>
> gsnLeftString/gsnRightString titles<br>
> res@cnLevelSelectionMode =
"ExplicitLevels" ;
set<br>
> explicit contour levels<br>
> ; res@cnLevels = (/
10,20,30,40,50,60,70,80,90,100/)<br>
> res@cnLevels = (/
0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.1/)<br>
> res@vpWidthF = 0.90
; change aspect ratio<br>
> of plot<br>
> res@vpHeightF = 0.90<br>
> res@vpXF = 0.05<br>
> res@vpYF = 0.95<br>
><br>
> ; map resources for projection<br>
> res@mpGridAndLimbOn = False<br>
> res@gsnTickMarksOn = False<br>
>
;***************************************************<br>
> res@mpLimitMode =
"LatLon"<br>
> res@mpMinLatF = 40.<br>
> res@mpMaxLatF = 49.<br>
> res@mpMinLonF = 242.<br>
> res@mpMaxLonF = 264.<br>
> res@mpCenterLonF = 252<br>
><br>
> res@mpPerimOn =
True ; draw box<br>
> around map<br>
><br>
> res@mpGeophysicalLineThicknessF =
3.0<br>
> res@mpGeophysicalLineColor =
"Black"; (/22/)<br>
> ;res@mpNationalLineThicknessF =
3.0<br>
> res@mpOutlineBoundarySets =
"GeophysicalAndUSStates" ; add state<br>
> boundaries<br>
> res@mpNationalLineColor =
res@mpGeophysicalLineColor<br>
> res@mpUSStateLineThicknessF = 3.0<br>
> res@mpUSStateLineColor =
res@mpGeophysicalLineColor<br>
><br>
> res@gsnAddCyclic = False<br>
> ; to take advantage of NCL's
automatic labeling, we need to assign
som<br>
> attributes:<br>
><br>
><br>
> plot(0) =
gsn_csm_contour_map_ce(wks,prob1,res)<br>
> ;return<br>
>
;************************************************<br>
> ; create panel<br>
>
;************************************************<br>
> resP = True
; modify the panel plot<br>
> resP@gsnFrame = False
; don't advance the<br>
> frame, so we can use gsn_text_ndc<br>
> resP@gsnPanelLabelBar = True
; add common colorbar<br>
> resP@lbLabelFontHeightF = 0.015
; set font height of<br>
> Label Bar labels<br>
> resP@gsnPanelBottom = 0.2
; shrink panel plot<br>
> by setting bottom edge of plot<br>
> resP@gsnPanelTop = 0.9
; shrink panel plot by<br>
> setting top edge of plot<br>
> resP@pmLabelBarWidthF = 0.7
; make thinner<br>
> resP@pmLabelBarHeightF = 0.09<br>
> resP@gsnPanelYWhiteSpacePercent =
5. ; increase spacing<br>
> along Y-axis between panel plots<br>
> resP@txString =
"NorthernPlains_AirTemperature_Significant_1961-2005"<br>
> gsn_panel(wks,plot,(/1,1/),resP)
; now draw as one plot<br>
><br>
><br>
><br>
> end<br>
><br>
> Thank you,<br>
> Adv<br>
</div>
</div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a moz-do-not-send="true"
href="mailto:ncl-talk@ucar.edu"
target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options,
unsubscribe:<br>
<a moz-do-not-send="true"
href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk"
rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>