<div dir="ltr"><div><div><div><div><div><div><div><div><div>Adv: I suggest that the original papers be read. <br><br>As I recall, the original application of the Cressman method required the user to provide a 1st guess field. The 1st guess grid was interpolated to the raw data point(s) and *anomalies* (differences) were calculated. Then, the ***anomalies*** were interpolated to the target grid. The final step was to add the interpolated anomalies to the 1st guess grid. <br><br></div>The *deprecated* function [ obj_anal_ic_deprecated ] you used allows the user to associate with the optional argument various 1st guess options. You used<br><br> grid = obj_anal_ic_deprecated(lon, lat, z1, lonn, latt, rscan, True)<br><br></div>but provided no suitable argument to the function. Hence, as noted in the documentation, the function uses 0.0 as the 1st guess. IMHO ... the worst choice.<br><br></div>opt=True<br></div>opt@zonal = True<br><br></div>Really, there is no substitute for data points. Further ...lots of data points<br><br><br></div>FYI: 'deprecated' means we suggest that other functions be used.<br><br><br>===<br></div>One example of an alternative method<br><br><a href="https://www.ncl.ucar.edu/Applications/ESMF.shtml">https://www.ncl.ucar.edu/Applications/ESMF.shtml</a><br></div>Example 21.<br><br></div>This will *not* extrapolated beyond the scope of the data.<br><div><div><div><br><br><div><div><div><div><br> </div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 23, 2016 at 4:32 PM, Daniel Barandiaran <span dir="ltr"><<a href="mailto:dbarandiaran@gmail.com" target="_blank">dbarandiaran@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Picking rscan values is a process that involves lots of testing, and there is no hard and fast rule for picking them. I have used this function as well, and have also seen the "lensing" effects you are seeing. I think this is something that just occurs as a result of the way the extrapolation is executed. In my experience it seems to occur most along the edges of the grid you are converting to, or in areas with sparse observations. A clearer understanding of what is happening under the hood will probably be found by reading the 1959 Cressman paper on objective analysis which this function is based on.<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Jan 23, 2016 at 4:24 PM, Adv <span dir="ltr"><<a href="mailto:advita6@gmail.com" target="_blank">advita6@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_quote"><br><div dir="ltr"><div><div>Hi Ncl users,<br><br></div>This is the code i use to produce attached plots . I didn't get any error. But there is a skewed parts here and there in the plots. I don't understand where is the problem. I think problem is choosing the rscan array. Could someone help me to pick right one? Figure shows unsmoothened values. <br><br></div><div>I would appreciate any help and suggestions. <br></div><div><div><div>Thank you,<br></div><div>Adv<br></div><div><br></div><div><div>;****************************************************<br>;****************************************************<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>;***************************************************<br><br>;***************************************************<br>begin<br>;***************************************************<br>strll = asciiread("stationmac.txt", -1, "string") ;<br> print(strll) ; STATION","STATION_NAME", "LAT", "LON"<br> print("=====")<br><br>sloc = str_get_field(strll , 2, ",")<br> lat = tofloat( str_get_field(strll , 3, ",") )<br> lon = tofloat( str_get_field(strll , 4, ",") )<br> print(sloc +" : "+lat+" "+lon)<br>mnlat=(min(lat))<br>mxlat=(max(lat))<br>mnlon=(min(lon))<br>mxlon=(max(lon))<br>;print(lon)<br>print(mnlon)<br>print(mxlon)<br>print(mnlat)<br>print(mxlat)<br>mlon = 390<br>dlon = -90.35 / mlon<br>lonn = fspan (-116, (mlon - 1) * dlon, mlon)<br>print(lonn)<br>mlat = 390<br>dlon = -90.35 / mlon<br>lonn = fspan (-116, (mlon - 1) * dlon, mlon)<br>print(lonn)<br>mlat = 390<br>dlat = 49.0 / mlat<br>latt = fspan (40.01, (mlat - 1) * dlat, mlat)<br>print(latt)<br>diri="/home/dailysimms/prec-obs/"<br>z1 = asciiread(diri+"t_avg_Jan-Dec1965-2005",-1,"float")<br>print(z1)<br>printVarSummary(z1)<br>;a = (/1,2,3,4,5,6,7,8/)<br>;Dimensions and sizes: [192372]<br>;390 rows by 50 columns<br>a0 = onedtond(z1,(/390,492/))<br>printVarSummary(a0)<br>v = ispan (0,390,1)<br>print(v)<br>;tenth of mm<br>x=(regCoef(v,z1))*492<br>print(x)<br>set_default_fillvalue("string", "")<br> opt = True<br> rscan = (/5,3,1 /)<br>grid = obj_anal_ic_deprecated(lon, lat, z1, lonn, latt, rscan, True)<br>printVarSummary(grid)<br>;return<br>;print(grid)<br>print(min(grid))<br>print(max(grid))<br>;return<br>grid&lat@units="degrees_north"<br>grid&lon@units="degrees_east"<br>printVarSummary(grid)<br>;return<br>;**************************************************<br>; plot parameters<br>;**************************************************<br><br> wks = gsn_open_wks("x11","Climatemn_Temp_1965-2005") ; Open ps file<br> gsn_define_colormap(wks,"testcmap")<br> plot = new(1,graphic)<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.015 ; adjust font height of gsnLeftString/gsnRightString titles<br>;res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels<br>;res@cnLevels = (/-2,-1,0,1,2,3,4/)<br> res@vpWidthF = 0.90 ; change aspect ratio 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 = -116<br> res@mpMaxLonF = -90.1<br><br> res@mpPerimOn = True ; draw box around map<br>res@mpGeophysicalLineThicknessF = 3.0<br>res@mpGeophysicalLineColor = "Black"; (/22/)<br>;res@mpNationalLineThicknessF = 3.0<br>res@mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state boundaries<br>res@mpNationalLineColor = res@mpGeophysicalLineColor<br>res@mpUSStateLineThicknessF = 3.0<br>res@mpUSStateLineColor = res@mpGeophysicalLineColor<br><br>res@gsnAddCyclic = False<br><br>res@gsnCenterStringFontHeightF = 0.02<br>res@gsnCenterString = "Obs"<br>plot(0) = gsn_csm_contour_map_ce(wks,grid,res)<br>;************************************************<br>; create panel<br>;************************************************<br> resP = True ; modify the panel plot<br> resP@gsnFrame = False ; don't advance the frame, so we can use gsn_text_ndc<br> resP@gsnPanelLabelBar = True ; add common colorbar<br> resP@lbLabelFontHeightF = 0.015 ; set font height of Label Bar labels<br>resP@gsnPanelBottom = 0.2 ; shrink panel plot by setting bottom edge of plot<br> resP@gsnPanelTop = 0.9 ; shrink panel plot by setting top edge of plot<br> resP@pmLabelBarWidthF = 0.3 ; make thinner<br> resP@pmLabelBarHeightF = 0.05<br> resP@gsnPanelYWhiteSpacePercent = 5. ; increase spacing along Y-axis between panel plots<br> resP@cnLinesOn = False ; turn off contour lines<br>; resP@cnFillOn = True ; color plot desired<br>; resP@lbTitleOn = True ; turn on title<br> resP@lbTitleString = "degC"<br> resP@lbTitleFontHeightF= .012 ; make title smaller<br> resP@cnLineLabelsOn = False<br> resP@txString = "Climatemn_Temp_1965-2005"<br>resP@txFontHeightF = 0.019<br> gsn_panel(wks,plot,(/1,1/),resP) ; now draw as one plot<br><br><br>; txres = True<br>; txres@txFontHeightF = 0.015<br>; gsn_text_ndc(wks,"Figure 16: A smaller panel plot",0.5,0.16,txres)<br> frame(wks)<br><br>end<br><br></div></div></div></div></div>
</div><br></div>
<br></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div><div dir="ltr"><div>Danny Barandiaran<br></div><div>Ph.D. Candidate<br></div><div><div>Department of Plants, Soils, and Climate</div><div>Utah State University</div><div><br><div><br></div></div></div></div></div>
</font></span></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>