<div dir="ltr"><div>Jetal, you are using linint2 regridding.  This and most other regridders will naturally compute fractional averages from the surrounding ones and zeros.  I can think of several strategies to reduce down to your desired ones and zeros.</div><div><br></div><div>1.  This is the simplest and quickest.  Trust that the numerical averaging is an accurate representation of the desired outcome.  Apply a simple numeric threshold to convert to ones and zeros.  Do this right after linint2 and the print statements.  The first line is necessary to handle the missing values that you showed, and you might want to adjust this for the desired missing value outcome.</div><div><br></div><div>     flh   = where ( ismissing (flh), 0, flh )</div><div>     flh2 = where ( (flh .ge. 0.5), 1, 0 )</div><div dir="ltr"><br></div>2.  Write your own regridding algorithm that decides ones and zeros based on nearby input grid points, and your choice of decision criteria.  For example, weighted or unweighted averages or counts, of input grid points within a given radius of each output grid point.<div><br></div><div>This could also be as simple as "copy the nearest input grid point value to the output grid point".<br><div><br></div><div>3.  Search NCL docs for a regridding method specifically designed for ones and zeros.  I doubt that there is one, but maybe.  ESMF could possibly have something like this, for the same reason as yours.</div><div><br></div><div>4.  Look at NCO operators and CDO for the same thing.</div><div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 1, 2022 at 5:52 PM JETAL SUTARIYA via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi NCL Community, <br></div><div><br></div><div>
<div>I am trying to 
regrid the SMAP L3 Freeze thaw 36 km data to NLDAS grid (1/8th degree). I have already converted data from EASE grid to regular lat/lon grids separately. <br></div><div>But SMAP freeze thaw contains binary data i.e. 0 if grid is non-frozen and 1 if grid is frozen so when I regrid the file; I get different values between 0 and 1,</div><div>for eg., 0.05755893, 0.3908837, 0.7242084,<br>    0.8300187, 0.496694, 0.1633693, 0, 0, 0, 0, 0, 0, _, _, _, _, _, 0, 0, 0,<br>    0.007007165, 0.02686451, 0.04672185, 0.045869, 0.02601166, 0.006154316,<br>    0.01370303, 0.03356037, 0.05341771, 0.03917314, 0.0193158, 0, 0, 0, 0, 0,<br>    0, 0.007237409, 0.02709475, 0.04695209, 0.04563876, 0.02578142. <br></div><div>This is incorrect since the data should be binary in the regridded freeze thaw variable. <br></div>Does anybody have an idea how to reflect that while regridding? <br></div><div><br><div></div><div>I
 have attached a few files here: 1) <span>ncl</span> script that I used to complete 
this task, 2) Screenshots of the PrintVarSummary error of input and gridded variable 3) Screenshot of output variable which is not binary.<br></div><div><br></div><div>Any suggestions are very helpful. <br></div><div>Thanks,</div><div>Jetal</div></div></div></blockquote></div></div></div></div></div>