[ncl-talk] Fwd: Sub : Objective analysis

Dennis Shea shea at ucar.edu
Mon Jan 25 15:12:50 MST 2016


Adv: I suggest that the original papers be read.

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.

The *deprecated* function [ obj_anal_ic_deprecated ] you used allows the
user to associate with the optional argument various 1st guess options. You
used

     grid   = obj_anal_ic_deprecated(lon, lat, z1, lonn, latt, rscan, True)

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.

opt=True
opt at zonal = True

Really, there is no substitute for data points. Further ...lots of data
points


FYI: 'deprecated' means we suggest that other functions be used.


===
One example of an alternative method

https://www.ncl.ucar.edu/Applications/ESMF.shtml
Example 21.

This will *not* extrapolated beyond the scope of the data.





On Sat, Jan 23, 2016 at 4:32 PM, Daniel Barandiaran <dbarandiaran at gmail.com>
wrote:

> 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.
>
> On Sat, Jan 23, 2016 at 4:24 PM, Adv <advita6 at gmail.com> wrote:
>
>>
>> Hi Ncl users,
>>
>> 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.
>>
>> I would appreciate any help and suggestions.
>> Thank you,
>> Adv
>>
>> ;****************************************************
>> ;****************************************************
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> ;***************************************************
>>
>> ;***************************************************
>> begin
>> ;***************************************************
>> strll  = asciiread("stationmac.txt", -1, "string") ;
>>   print(strll)   ; STATION","STATION_NAME", "LAT", "LON"
>>   print("=====")
>>
>> sloc = str_get_field(strll , 2, ",")
>>   lat  = tofloat( str_get_field(strll , 3, ",")  )
>>   lon  = tofloat( str_get_field(strll , 4, ",")  )
>>   print(sloc +" : "+lat+" "+lon)
>> mnlat=(min(lat))
>> mxlat=(max(lat))
>> mnlon=(min(lon))
>> mxlon=(max(lon))
>> ;print(lon)
>> print(mnlon)
>> print(mxlon)
>> print(mnlat)
>> print(mxlat)
>> mlon = 390
>> dlon = -90.35 / mlon
>> lonn  = fspan (-116, (mlon - 1) * dlon, mlon)
>> print(lonn)
>> mlat = 390
>> dlon = -90.35 / mlon
>> lonn  = fspan (-116, (mlon - 1) * dlon, mlon)
>> print(lonn)
>> mlat = 390
>> dlat = 49.0 / mlat
>> latt  = fspan (40.01, (mlat - 1) * dlat, mlat)
>> print(latt)
>> diri="/home/dailysimms/prec-obs/"
>> z1 = asciiread(diri+"t_avg_Jan-Dec1965-2005",-1,"float")
>> print(z1)
>> printVarSummary(z1)
>> ;a = (/1,2,3,4,5,6,7,8/)
>> ;Dimensions and sizes:  [192372]
>> ;390 rows by 50 columns
>> a0 = onedtond(z1,(/390,492/))
>> printVarSummary(a0)
>> v = ispan (0,390,1)
>> print(v)
>> ;tenth of mm
>> x=(regCoef(v,z1))*492
>> print(x)
>> set_default_fillvalue("string",  "")
>>   opt    = True
>>   rscan  = (/5,3,1 /)
>> grid   = obj_anal_ic_deprecated(lon, lat, z1, lonn, latt, rscan, True)
>> printVarSummary(grid)
>> ;return
>> ;print(grid)
>> print(min(grid))
>> print(max(grid))
>> ;return
>> grid&lat at units="degrees_north"
>> grid&lon at units="degrees_east"
>> printVarSummary(grid)
>> ;return
>> ;**************************************************
>> ; plot parameters
>> ;**************************************************
>>
>>   wks = gsn_open_wks("x11","Climatemn_Temp_1965-2005")                  ;
>> Open ps file
>>  gsn_define_colormap(wks,"testcmap")
>>   plot = new(1,graphic)
>>
>>  res                       = True
>> res at gsnDraw             = False           ; don't draw
>> res at gsnFrame            = False           ; don't advance frame
>> res at cnInfoLabelOn       = False           ; turn off cn info label
>>  res at cnLinesOn       = False                   ; turn off contour lines
>>    res at cnFillOn        = True               ; color plot desired
>>    res at cnLineLabelsOn  = False
>>  res at lbLabelBarOn        = False           ; turn off individual cb's
>> ;res at txFontHeightF = 0.015                   ; adjust font height of
>> gsnLeftString/gsnRightString titles
>> ;res at cnLevelSelectionMode = "ExplicitLevels"                     ; set
>> explicit contour levels
>> ;res at cnLevels    = (/-2,-1,0,1,2,3,4/)
>>  res at vpWidthF              = 0.90                ; change aspect ratio
>> of plot
>>   res at vpHeightF             = 0.90
>>   res at vpXF                  = 0.05
>>   res at vpYF                  = 0.95
>>
>> ; map resources for projection
>> res at mpGridAndLimbOn       = False
>> res at gsnTickMarksOn = False
>> ;***************************************************
>> res at mpLimitMode           = "LatLon"
>>   res at mpMinLatF             =   40.
>>   res at mpMaxLatF             =   49.
>>   res at mpMinLonF             = -116
>>   res at mpMaxLonF             =  -90.1
>>
>>    res at mpPerimOn              = True                    ; draw box
>> around map
>> res at mpGeophysicalLineThicknessF = 3.0
>> res at mpGeophysicalLineColor = "Black"; (/22/)
>> ;res at mpNationalLineThicknessF  = 3.0
>> res at mpOutlineBoundarySets = "GeophysicalAndUSStates" ; add state
>> boundaries
>> res at mpNationalLineColor  = res at mpGeophysicalLineColor
>> res at mpUSStateLineThicknessF = 3.0
>> res at mpUSStateLineColor  = res at mpGeophysicalLineColor
>>
>> res at gsnAddCyclic            = False
>>
>> res at gsnCenterStringFontHeightF     = 0.02
>> res at gsnCenterString     = "Obs"
>> plot(0) = gsn_csm_contour_map_ce(wks,grid,res)
>> ;************************************************
>> ; create panel
>> ;************************************************
>>   resP                  = True                   ; modify the panel plot
>>   resP at gsnFrame         = False                  ; don't advance the
>> frame, so we can use gsn_text_ndc
>>   resP at gsnPanelLabelBar = True                   ; add common colorbar
>>   resP at lbLabelFontHeightF = 0.015                ; set font height of
>> Label Bar labels
>> resP at gsnPanelBottom   = 0.2                    ; shrink panel plot by
>> setting bottom edge of plot
>>   resP at gsnPanelTop      = 0.9                    ; shrink panel plot by
>> setting top edge of plot
>>  resP at pmLabelBarWidthF  = 0.3                 ; make thinner
>>   resP at pmLabelBarHeightF = 0.05
>>   resP at gsnPanelYWhiteSpacePercent = 5.           ; increase spacing
>> along Y-axis between panel plots
>>  resP at cnLinesOn       = False                   ; turn off contour lines
>> ;   resP at cnFillOn        = True               ; color plot desired
>> ;  resP at lbTitleOn        = True                  ; turn on title
>>   resP at lbTitleString    = "degC"
>>   resP at lbTitleFontHeightF= .012                 ; make title smaller
>>    resP at cnLineLabelsOn  = False
>>   resP at txString    = "Climatemn_Temp_1965-2005"
>> resP at txFontHeightF   = 0.019
>>   gsn_panel(wks,plot,(/1,1/),resP)               ; now draw as one plot
>>
>>
>> ;  txres               = True
>> ;  txres at txFontHeightF = 0.015
>> ;  gsn_text_ndc(wks,"Figure 16: A smaller panel plot",0.5,0.16,txres)
>>   frame(wks)
>>
>> end
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
> --
> Danny Barandiaran
> Ph.D. Candidate
> Department of Plants, Soils, and Climate
> Utah State University
>
>
>
> _______________________________________________
> 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/20160125/c3e827e2/attachment.html 


More information about the ncl-talk mailing list