<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Bian,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'm looking into this.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Meanwhile, I see that your original data goes from -180 to 180, but the lower left corner and upper right corner of the destination grid was set to:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><font face="monospace, monospace">    Opt@DstLLCorner       = (/ 0.25d,   0.25d/)</font></div><div class="gmail_default"><font face="monospace, monospace">    Opt@DstURCorner       = (/89.75d, 179.75d/)</font></div><div class="gmail_default"><br></div><div class="gmail_default">This is restricting your data in the longitude direction to go from 0.25 and 179.75. Perhaps you meant for this to be:</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">    Opt@DstLLCorner       = (/ 0.25d, -180.00d/)</font></div><div class="gmail_default"><font face="monospace, monospace">    Opt@DstURCorner       = (/89.75d,  179.75d</font>/)</div><div class="gmail_default"><br></div><div class="gmail_default">However, this still doesn't fix the issue, so I'm looking into it further. I'm wondering if this is a missing value issue, because I noticed that your lat/lon has some missing values in it.</div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 15, 2018 at 2:08 AM, Bian Qingyun <span dir="ltr"><<a href="mailto:bianqy@tea.ac.cn" target="_blank">bianqy@tea.ac.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><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/<wbr>Applications/Scripts/ESMF_<wbr>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_<wbr>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>
</span><p>Below is my script. I also attached the AMSR-E data file in case.</p><div class="HOEnZb"><div class="h5">
<p>----------------------</p>
<p>----------------------</p>
<p>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl"</p>
<p>begin<br>;-----read data<br>    srcFileName = "AMSR_E_L3_DailySnow_V09_<wbr>20100311.hdf"                 <wbr>  ; Source file<br>    eos_file   = addfile(srcFileName + ".he2","r")<br>    lon2d       = eos_file->GridLon_Northern_<wbr>Hemisphere<br>    lat2d       = eos_file->GridLat_Northern_<wbr>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>;-----------------------------<wbr>------------------------------<wbr>-----------<br>; Plotting section<br>;-----------------------------<wbr>------------------------------<wbr>-----------<br>    wks = gsn_open_wks("x11","ESMF_<wbr>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>                              <wbr>  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,<wbr>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,<wbr>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,<wbr>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></div></div><br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>