Re: Why I only get the half data after regridding?

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed, 16 Sep 2009 13:15:18 -0600

Hi Lin,
Whenever you are regridding, you need to make sure that the longitudinal
extent of your input data matches that of your output data. In your
script, the hadisst data runs from -180:180 longitude, and the NCEP
reanalysis data runs from 0:357.5. Use lonFlip to flip the longitudes of
the hadisst data, and you should be good to go:
http://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml
Best regards,
Adam

leo.aries.g wrote:
> Hi, all
>
> I am using the following scripts to regrid the HadISST sst data with
> 1 degree into
>
> the grids of NCEP (2.5 degree). But the plot show that half field were
> blank in the plot
>
> of regridded data. Anyone can show me the where the error is. Thanks!
>
>
>
> Lin
>
>
>
> ;************************************************
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> ;************************************************
> begin
> ;************************************************
> ; read in netCDF file
> ;************************************************
> in = addfile("/dgpfs/fs1/HadISST/HadISST_sst.nc","r")
> ;************************************************
> ; read in SST
>
> sst = in->sst(:,{-89.5:89.5},{-179.5:179.5}) ; remove cyclic point
> lon = in->lon
> ;************************************************
> ; interpolate to new grid
> ;***********************************************
> newlat = fspan(-90.,90.,73)
> newlon = fspan(0.,357.5,144)
> newlat_at_units = "degrees_north"
> newlon_at_units = "degrees_east"
> print("xi: " + lon(0) + " " + lon(dimsizes(lon)-1))
> print("yi: " + sst&lat(0) + " " + sst&lat(dimsizes(sst&lat)-1))
> print("x0: " + newlon(0) + " " + newlon(dimsizes(newlon)-1))
> print("y0: " + newlat(0) + " " + newlat(dimsizes(newlat)-1))
>
>
> newsst = linint2(lon,sst&lat,sst,False,newlon,newlat,0)
> printVarSummary(newsst)
> newsst!0 = "time"
> newsst!1 = "lat"
> newsst!2 = "lon"
> newsst&time= sst&time
> newsst&lat = newlat
> newsst&lon = newlon
> wks = gsn_open_wks("eps","regrid") ; open a ps file
> gsn_define_colormap(wks,"gui_default") ; choose colormap
> res = True ; plot mods desired
> res_at_cnFillOn = True ; turn on color
> res_at_gsnSpreadColors = True ; use full color map
> res_at_cnLinesOn = False ; no contour lines
> res_at_cnLineLabelsOn = False ; no line labels
> res_at_mpMaxLatF = 90 ; choose map range
> res_at_mpMinLatF = -90
> res_at_gsnDraw = False ; don't draw yet
> res_at_gsnFrame = False ; don't advance frame yet
> ;res_at_cnLevelSelectionMode = "ManualLevels" ; manual levels
> ;res_at_cnMinLevelValF = 4 ; min level
> ;res_at_cnMaxLevelValF = 32 ; max level
> ;res_at_cnLevelSpacingF = 2 ; interval
> res_at_tmXBLabelFontHeightF = 0.014 ; adjust some font heights
> res_at_tmYLLabelFontHeightF = 0.014
> res_at_tiMainFontHeightF = 0.022
> res_at_txFontHeightF = 0.017
> res_at_lbLabelBarOn = False ; turn off label bar
> ;************************************************
> ; create plots
> ;************************************************
> plot = new(2,graphic)
> res_at_tiMainString = "Original Grid"
> plot(0) = gsn_csm_contour_map_ce(wks,sst(1,:,:),res) ; create the plot
> printVarSummary(newsst)
> res_at_tiMainString = "Grid after linint2"
> plot(1) = gsn_csm_contour_map_ce(wks,newsst(1,:,:),res) ; create the plot
> ;************************************************
> ; create panel
> ;************************************************
> pres = True
> pres_at_gsnPanelLabelBar = True ; common label bar
> gsn_panel(wks,plot,(/2,1/),pres)
> end
> 2009-09-17
> ------------------------------------------------------------------------
> leo.aries.g
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 16 2009 - 13:15:18 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 18 2009 - 15:36:15 MDT