Contour Smoothing

From: Clark, Brandi L <brandi.clark_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 27 2014 - 13:46:36 MST

I am trying to smooth the surface temperature contours on a cylindrical equidistant map of the CESM RCP 8.5 simulation for July 2020. I don't understand the documentation on the NCL webpage for the function smth9 http://www.ncl.ucar.edu/Document/Functions/Built-in/smth9.shtml. It looks like I will need to use Example 2:

Define g(ntim, nlvl, nlat, mlon) where ntim = 50, nlvl = 30, nlat = 64, mlon = 128.

The rightmost dimension is to be treated as "cyclic". The user should not add a cyclic point for the rightmost dimension; it is accounted for internally. All times and levels will be smoothed and returned in a new arraygsmth.

Note: gsmth will not have any of the attributes or coordinate information of the input g. Note: gsmth will not have any of the attributes or coordinate information of the input g. If this is desired, use the smth9_Wrap<http://www.ncl.ucar.edu/Document/Functions/Contributed/smth9_Wrap.shtml>function instead.

  gsmth = smth9(g, 0.50, 0.25, True) ; heavy local smoothing

I am not sure what the parameters of g represent (ntim, nlvl, nlat, mlon), and I'm not sure what a cyclic point is.

This is the code for my map, and I realize that the smoothing code is wrong. I just don't know what values to use.

; RCP 8.5 Surface Temperature Plot for year 2020
; July Monthly Average
; Cylindrical Equidistant Map

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

begin

 fname = addfile ("b40.rcp8_5.1deg.007.cam2.h0.2020-07.nc", "r") ; read in file from path
  st = fname ->TS

  wks = gsn_open_wks("ps","RCP8.5_ST_2020_Map")

  gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap

  res = True ; plot mods desired

  res@mpFillOn = False ; turn off gray fill
  res@mpOutlineBoundarySets = "geophysicalandusstates" ; turn on countries and US states

  res@cnFillOn = True ; turn on color fill
  res@cnLinesOn = False ; turn off contour lines
  res@cnLevelSelectionMode = "ManualLevels" ; set label bar manually
  res@cnMinLevelValF = 290 ; sets min temp on label bar
  res@cnMaxLevelValF = 310 ; sets max temp on label bar
  res@cnLevelSpacingF = 0.5 ; label bar interval
  res@lbLabelStride = 10
  res@lbBoxLinesOn = True ; draw outline around individual colors
  res@gsnSpreadColors = True ; use full range of colormap

  res@pmTickMarkDisplayMode = "Always"; use NCL default lat/lon labels

  res@gsnAddCyclic = False ; data already has cyclic point
                                                                   ; this must also be set for any zoom

; note that the gsn_csm_*map_ce templates automatically set
; res@mpLimitMode="LatLon" for you. If you are plotting a different projection,
; you may have to set this resource.

  res@mpMinLatF = 20 ; range to zoom in on
  res@mpMaxLatF = 40
  res@mpMinLonF = 250
  res@mpMaxLonF = 270
  res@mpCenterLonF = 260

  g(ntim, nlvl, nlat, mlon)
  gsmth = smth9(g, 0.50, 0.25, True) ; heavy local smoothing

  plot = gsn_csm_contour_map_ce(wks,st(0,{15:45},{250:270}), res)

end

-Brandi
?

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 27 13:46:52 2014

This archive was generated by hypermail 2.1.8 : Mon Mar 03 2014 - 14:26:18 MST