Re: problem regridding

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri, 24 Feb 2006 15:35:56 -0700 (MST)

Ummm, I speculate NCL is doing what it is "told" :=)

newlat = fspan(-90.,90.,90)
newlon = fspan(0.,360.,180) ; <=== this include the cyclic value
; this is not correct

The above are rather novel lat / lon grids. :-)

given the nlat=90 and mlon=180 more conventional would be

newlat = fspan(-89.,89.,90) ; [ -89,-87 ..., 87,89]
newlon = fspan(1.,359.,180) ; [1,3,...,357,359]

though with contributed.ncl, I'd use

newlat = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
newlon = lonGlobeFo(mlon, "lon", "longitude", "degrees_east")

===
If u want pole pts [note 91 and 181]

newlat = fspan(-90.,90.,91)
newlon = fspan(0.,359.,181)

or better

newlat = latGlobeFo( 91 , "lat", "latitude", "degrees_north")
newlon = lonGlobeFo(181 , "lon", "longitude", "degrees_east")

====

;^^^^^^^^^^^^^^^^^
begin
in =
00001_200912_diff.nc","r")

sst = in->tas(0,:,:)
printVarSummary(sst) ; always send this ... it helps

newlat = latGlobeFo(nlat, "lat", "latitude", "degrees_north")
newlon = lonGlobeFo(mlon, "lon", "longitude", "degrees_east")

newsst = linint2_Wrap(sst&lon,sst&lat,sst,True,newlon,newlat,0)
printVarSummary(newsst)

good luck

>Delivered-To: shea_at_ucar.edu
>Delivered-To: ncl-talk_at_ucar.edu
>Date: Fri, 24 Feb 2006 13:58:46 -0800 (PST)
>From: brownmc_at_uci.edu
>To: ncl-talk_at_ucar.edu
>User-Agent: SquirrelMail/1.4.5
>MIME-Version: 1.0
>Content-Transfer-Encoding: 8bit
>X-Virus-Scanned: amavisd-new at ucar.edu
>Subject: problem regridding
>X-BeenThere: ncl-talk_at_ucar.edu
>X-Mailman-Version: 2.1.1
>List-Id: NCAR Command Language User Group <ncl-talk.ucar.edu>
>List-Unsubscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request_at_ucar.edu?subject=unsubscribe>
>List-Post: <mailto:ncl-talk_at_ucar.edu>
>List-Help: <mailto:ncl-talk-request_at_ucar.edu?subject=help>
>List-Subscribe: <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>,
<mailto:ncl-talk-request_at_ucar.edu?subject=subscribe>
>X-Virus-Scanned: amavisd-new at ucar.edu
>
>Hi all,
>I have been trying to regrid some model data, but when I use the bilinear
>interpolation (linint2) it keeps plotting the data 180 degrees off the
>orginal grid (ex. temp data for australia is now plotted over south
>america). I have put my script below. Any help is greatly appreciated.
>
>Mike
>
>p.s. if I am not describing the problem fully, I have posted a plot of the
>orginal grid and of the new grid that is off at dust.ess.uci.edu/brownmc
>it is called regrid_problem.pdf
>
>begin
>in =
200001_200912_diff.nc","r")
>
>sst = in->tas(0,:,:)
>lon = in->lon({0.:360})
>
>newlat = fspan(-90.,90.,90)
>newlon = fspan(0.,360.,180)
>newsst = linint2(lon,sst&lat,sst,True,newlon,newlat,0)
>
>newsst!0 ="lat"
>newsst!1 = "lon"
>newsst&lat = newlat
>newsst&lon = newlon
>
>wks = gsn_open_wks("X11","regrid") ; open a ps file
> gsn_define_colormap(wks,"gui_default") ; choose colormap
> res = True ; plot mods desired
> res@cnFillOn = True ; turn on color
> res@gsnSpreadColors = True ; use full color map
> res@cnLinesOn = False ; no contour lines
> res@cnLineLabelsOn = False ; no line labels
> ;res@mpMaxLatF = 60 ; choose map range
> ;res@mpMinLatF = -60
> res@gsnDraw = False ; don't draw yet
> res@gsnFrame = False ; don't advance frame yet
> ;res@cnLevelSelectionMode = "ManualLevels" ; manual levels
> ;res@cnMinLevelValF = 4 ; min level
> ;res@cnMaxLevelValF = 32 ; max level
> ;res@cnLevelSpacingF = 2 ; interval
> ;res@tmXBLabelFontHeightF = 0.014 ; adjust some font heights
> ;res@tmYLLabelFontHeightF = 0.014
> ;res@tiMainFontHeightF = 0.022
> ;res@txFontHeightF = 0.017
>
> res@lbLabelBarOn = False ; turn off label bar
>;************************************************
>; create plots
>;************************************************
> plot = new(2,graphic)
> res@tiMainString = "Original Grid"
> plot(0) = gsn_csm_contour_map_ce(wks,sst,res) ; create the plot
>
> res@tiMainString = "Grid after linint2"
> plot(1) = gsn_csm_contour_map_ce(wks,newsst,res) ; create the plot
>;************************************************
>; create panel
>;************************************************
> pres = True
> pres@gsnPanelLabelBar = True ; common label bar
> gsn_panel(wks,plot,(/2,1/),pres)
>
>end
>
>
>
>
>
>
>_______________________________________________
>ncl-talk mailing list
>ncl-talk_at_ucar.edu
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Feb 24 2006 - 15:35:56 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 27 2006 - 09:24:31 MST