<P> </P>
<P>Hello,</P>
<P>I'm regridding AMSR-E L3 daily snow following the examples on NCL website <A href="http://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_13.ncl" target="_blank">http://www.ncl.ucar.edu/Applications/Scripts/ESMF_regrid_13.ncl</A> and hdf website <A href="http://hdfeos.org/zoo/index_openNSIDC_Examples.php#AMSR_E" target="_blank">http://hdfeos.org/zoo/index_openNSIDC_Examples.php#AMSR_E</A>. </P>
<P>All is fine,but there are missing values along 90°E and 90°W after regridding while there are no missing values in original data along and near 90°E and 90°W 。</P>
<P>Below is my script. I also attached the AMSR-E data file in case.</P>
<P>----------------------</P>
<P>----------------------</P>
<P>load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"</P>
<P>begin<BR>;-----read data<BR> srcFileName = "AMSR_E_L3_DailySnow_V09_20100311.hdf" ; Source file<BR> eos_file = addfile(srcFileName + ".he2","r")<BR> lon2d = eos_file->GridLon_Northern_Hemisphere<BR> lat2d = eos_file->GridLat_Northern_Hemisphere<BR> ; Process NAN (1e51) fillValue for LAMAZ geolocation.<BR> lon2d=where(lon2d .gt. 1000, -999.0, lon2d)<BR> lat2d=where(lat2d .gt. 1000, -999.0, lat2d)<BR> <A href="mailto:lon2d@_FillValue" target="_blank">lon2d@_FillValue</A> = -999.0<BR> <A href="mailto:lat2d@_FillValue" target="_blank">lat2d@_FillValue</A> = -999.0</P>
<P><BR> hdf_file = addfile(srcFileName, "r")<BR> ; Read the dataset.<BR> hdf_data = hdf_file->SWE_NorthernDaily</P>
<P> ; Filter out invalid range values.<BR> ; See "Table 2. Pixel Values ofr the SWE Feids" from [2].<BR> hdf_data = where(hdf_data .gt. 240, <A href="mailto:hdf_data@_FillValue" target="_blank">hdf_data@_FillValue</A>, hdf_data)</P>
<P> ; Prepare data for plotting by converting type.<BR> swe2d = tofloat(hdf_data)<BR> <A href="mailto:swe2d@_FillValue" target="_blank">swe2d@_FillValue</A> = tofloat(<A href="mailto:hdf_data@_FillValue" target="_blank">hdf_data@_FillValue</A>)</P>
<P> ; Multiply by two according to data spec [2].<BR> swe2d = 2 * swe2d</P>
<P> ; You can get the description of data set from the data spec [2].<BR> <A href="mailto:swe2d@long_name" target="_blank">swe2d@long_name</A> = "Northern Hemisphere 5-day Snow Water Equivalent ~C~ (" + <A href="mailto:hdf_data@hdf_name" target="_blank">hdf_data@hdf_name</A> + ")"<BR> <A href="mailto:swe2d@units" target="_blank">swe2d@units</A> = "mm"<BR> ; Associate data with lat/lon.<BR> <A href="mailto:swe2d@lon2d" target="_blank">swe2d@lon2d</A> = lon2d<BR> <A href="mailto:swe2d@lat2d" target="_blank">swe2d@lat2d</A> = lat2d</P>
<P>;-----ESMF regridding<BR> Opt = True ; Options for regridding</P>
<P> <A href="mailto:Opt@SrcFileName" target="_blank">Opt@SrcFileName</A> = "EASE_SCRIP.nc" ; Output files<BR> <A href="mailto:Opt@DstFileName" target="_blank">Opt@DstFileName</A> = "NH_SCRIP.nc"<BR> <A href="mailto:Opt@WgtFileName" target="_blank">Opt@WgtFileName</A> = "EASE_2_NH_patch.nc"<BR> <A href="mailto:Opt@ForceOverwrite" target="_blank">Opt@ForceOverwrite</A> = True<BR> <A href="mailto:Opt@SrcMask2D" target="_blank">Opt@SrcMask2D</A> = where(ismissing(lat2d),0,1)<BR> <A href="mailto:Opt@SrcGridLat" target="_blank">Opt@SrcGridLat</A> = lat2d<BR> <A href="mailto:Opt@SrcGridLon" target="_blank">Opt@SrcGridLon</A> = lon2d</P>
<P> <A href="mailto:Opt@DstGridType" target="_blank">Opt@DstGridType</A> = "0.25deg" ; Destination grid<BR> <A href="mailto:Opt@DstTitle" target="_blank">Opt@DstTitle</A> = "Northern Hemisphere 0.25 resolution"<BR> <A href="mailto:Opt@DstLLCorner" target="_blank">Opt@DstLLCorner</A> = (/ 0.25d, 0.25d/)<BR> <A href="mailto:Opt@DstURCorner" target="_blank">Opt@DstURCorner</A> = (/89.75d, 179.75d/)</P>
<P> <A href="mailto:Opt@InterpMethod" target="_blank">Opt@InterpMethod</A> = "bilinear" ; Careful! Patch method takes a long time</P>
<P> <A href="mailto:Opt@Debug" target="_blank">Opt@Debug</A> = True</P>
<P> swe_regrid = ESMF_regrid(swe2d,Opt) ; Regrid swe<BR> printVarSummary(swe_regrid)</P>
<P>;----------------------------------------------------------------------<BR>; Plotting section<BR>;----------------------------------------------------------------------<BR> wks = gsn_open_wks("x11","ESMF_regrid") ; send graphics to PNG file</P>
<P> res = True ; Plot mods desired.<BR> <A href="mailto:res@gsnMaximize" target="_blank">res@gsnMaximize</A> = True ; Maximize plot</P>
<P> <A href="mailto:res@gsnDraw" target="_blank">res@gsnDraw</A> = False<BR> <A href="mailto:res@gsnFrame" target="_blank">res@gsnFrame</A> = False</P>
<P> <A href="mailto:res@cnFillOn" target="_blank">res@cnFillOn</A> = True ; color plot desired<BR> <A href="mailto:res@cnFillPalette" target="_blank">res@cnFillPalette</A> = "amwg" ; set color map<BR> <A href="mailto:res@cnLinesOn" target="_blank">res@cnLinesOn</A> = False ; turn off contour lines<BR> <A href="mailto:res@cnLineLabelsOn" target="_blank">res@cnLineLabelsOn</A> = False ; turn off contour labels<BR> <A href="mailto:res@cnFillMode" target="_blank">res@cnFillMode</A> = "RasterFill" ; turn raster on</P>
<P> <A href="mailto:res@cnLevelSelectionMode" target="_blank">res@cnLevelSelectionMode</A>= "ExplicitLevels" ; set explicit contour levels<BR> <A href="mailto:res@cnLevels" target="_blank">res@cnLevels</A> = (/-300,-250,-200,-150,-100, \<BR> 0,1,5,10,25,100,200,300,400/)</P>
<P> <A href="mailto:res@lbLabelBarOn" target="_blank">res@lbLabelBarOn</A> = False ; turn on in panel</P>
<P> <A href="mailto:res@trGridType" target="_blank">res@trGridType</A> = "TriangularMesh" ; allow missing coordinates</P>
<P><BR> <A href="mailto:res@gsnPolar" target="_blank">res@gsnPolar</A> = "NH" ; specify the hemisphere<BR> <A href="mailto:res@mpMinLatF" target="_blank">res@mpMinLatF</A> = 35</P>
<P>;---Plot original data.<BR> <A href="mailto:res@gsnAddCyclic" target="_blank">res@gsnAddCyclic</A> = False<BR> <A href="mailto:res@sfXArray" target="_blank">res@sfXArray</A> = lon2d<BR> <A href="mailto:res@sfYArray" target="_blank">res@sfYArray</A> = lat2d<BR> <A href="mailto:res@tiMainString" target="_blank">res@tiMainString</A> = "Original EASE grid (" + str_join(dimsizes(lat2d),",") + ")"<BR> <A href="mailto:res@trGridType" target="_blank">res@trGridType</A> = "TriangularMesh"<BR> <A href="mailto:res@cnFillMode" target="_blank">res@cnFillMode</A> = "RasterFill"</P>
<P> plot_orig = gsn_csm_contour_map_polar(wks,swe2d,res)</P>
<P> delete(<A href="mailto:res@sfXArray" target="_blank">res@sfXArray</A>)<BR> delete(<A href="mailto:res@sfYArray" target="_blank">res@sfYArray</A>)</P>
<P>;---Plot regridded data.<BR> <A href="mailto:res@gsnAddCyclic" target="_blank">res@gsnAddCyclic</A> = True</P>
<P> dims = tostring(dimsizes(swe_regrid))<BR> <A href="mailto:res@tiMainString" target="_blank">res@tiMainString</A> = "Regridded to 0.25 degree grid (" + \<BR> str_join(dims," x ") + ")"</P>
<P> plot_regrid = gsn_csm_contour_map_polar(wks,swe_regrid,res)</P>
<P>;---Compare the plots in a panel<BR> pres = True<BR> <A href="mailto:pres@gsnMaximize" target="_blank">pres@gsnMaximize</A> = True<BR> <A href="mailto:pres@gsnPanelLabelBar" target="_blank">pres@gsnPanelLabelBar</A> = True<BR> <A href="mailto:pres@lbLabelFontHeightF" target="_blank">pres@lbLabelFontHeightF</A> = 0.01<BR> <A href="mailto:pres@pmLabelBarWidthF" target="_blank">pres@pmLabelBarWidthF</A> = 0.8</P>
<P> gsn_panel(wks,(/plot_orig,plot_regrid/),(/1,2/),pres)<BR>end</P>
<P>---------------------------</P>
<P>---------------------------</P>
<P>Any suggestions are appreciated! Thank you!</P>
<P>Best,</P>
<P>Qingyun</P>
<P> </P>