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

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,

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
>
>
>
> ;************************************************
> ;************************************************
> begin
> ;************************************************
> ; read in netCDF file
> ;************************************************
> ;************************************************
>
> 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

```--
--------------------------------------------------------------