[ncl-talk] [EXT]Re: Error in regridding SMAP Freeze Thaw binary data
JETAL SUTARIYA
jetal164 at email.arizona.edu
Wed Feb 2 00:33:35 MST 2022
Hi Kunal,
Thank you for your comment.
cdo remapbil is regridding with bilinear interpolation and I am using same
interpolation method in NCL but it does not work for binary data as it
provides fraction values.
I used Dave's suggested script lines alongside bilinear interpolation to
obtain binary values and it worked well.
Best regards,
Jetal
On Tue, Feb 1, 2022, 8:51 PM Kunal Bali <kunal.bali9 at gmail.com> wrote:
> *External Email*
> Hi,
> Did you try
>
> cdo remapbil,NLDS.file yourfile.nc output.nc
> (NLDS) = you can use any file (NLDS.file) with 0.125 resolution
>
>
> ---
> Kunal Bali
>
>
>
>
>
>
> On Tue, 1 Feb 2022 at 18:40, JETAL SUTARIYA via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> Hi Dave,
>>
>> Thank you very much for your helpful comment.
>> I tried your first suggestion and it worked out well.
>>
>> I have searched in NCL, CDO and NCO manuals and websites for binary data
>> regridding, but was unable to find something resonating.
>> If anybody finds it, please let me know for future reference.
>>
>> Thanks,
>> Jetal
>>
>>
>>
>> On Tue, Feb 1, 2022 at 6:33 PM Dave Allured - NOAA Affiliate <
>> dave.allured at noaa.gov> wrote:
>>
>>> *External Email*
>>> 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.
>>>
>>> 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.
>>>
>>> flh = where ( ismissing (flh), 0, flh )
>>> flh2 = where ( (flh .ge. 0.5), 1, 0 )
>>>
>>> 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.
>>>
>>> This could also be as simple as "copy the nearest input grid point value
>>> to the output grid point".
>>>
>>> 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.
>>>
>>> 4. Look at NCO operators and CDO for the same thing.
>>>
>>>
>>> On Tue, Feb 1, 2022 at 5:52 PM JETAL SUTARIYA via ncl-talk <
>>> ncl-talk at mailman.ucar.edu> wrote:
>>>
>>>> Hi NCL Community,
>>>>
>>>> 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.
>>>> 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,
>>>> for eg., 0.05755893, 0.3908837, 0.7242084,
>>>> 0.8300187, 0.496694, 0.1633693, 0, 0, 0, 0, 0, 0, _, _, _, _, _, 0,
>>>> 0, 0,
>>>> 0.007007165, 0.02686451, 0.04672185, 0.045869, 0.02601166,
>>>> 0.006154316,
>>>> 0.01370303, 0.03356037, 0.05341771, 0.03917314, 0.0193158, 0, 0, 0,
>>>> 0, 0,
>>>> 0, 0.007237409, 0.02709475, 0.04695209, 0.04563876, 0.02578142.
>>>> This is incorrect since the data should be binary in the regridded
>>>> freeze thaw variable.
>>>> Does anybody have an idea how to reflect that while regridding?
>>>>
>>>> I have attached a few files here: 1) ncl 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.
>>>>
>>>> Any suggestions are very helpful.
>>>> Thanks,
>>>> Jetal
>>>>
>>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at mailman.ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220202/8c4c9154/attachment.html>
More information about the ncl-talk
mailing list