[ncl-talk] Missing value in data variable

Dennis Shea shea at ucar.edu
Sat May 25 10:43:08 MDT 2019


re: "fill in these values using the *poisson_grid_fill *procedure, however
the procedure was too slow and I couldn't obtain the filled in data. I also
used * ..."*

Using interpolated values for something like 'space-time' spectra should be
done with extreme caution.

Filling an occasional day or two will likely not have any substantive
effect on the resulting spectra. However, filling large numbers of grid
points with interpolated values could affect the spectra substantially.

D



On Sat, May 25, 2019 at 8:57 AM Nishtha Agrawal <agrawal.nishtha3 at gmail.com>
wrote:

> Hi,
>
> Thanks for replying!
>
> I understand that FFT is not allowing missing values. I therefore tried to
> fill in these values using the poisson_grid_fill procedure, however the
> procedure was too slow and I couldn't obtain the filled in data. I also
> used linmsg to get linearly interpolated values in place of the missing
> data, it was fast enough but I was obtaining the errors while using
> mjo_wavenum_freq_season, it reported that division by 0 is taking place
> somewhere and hence it couldn't proceed.
>
> Thanks and Regards,
> Nishtha
>
> On Saturday, May 25, 2019, Dennis Shea <shea at ucar.edu> wrote:
>
>> Sorry: I do not understand what you are attempting to do.
>>
>> The code within the *mjo_wavenum_freq_season*
>> <http://www.ncl.ucar.edu/Document/Functions/Diagnostics/mjo_wavenum_freq_season.shtml>:
>> function uses a (complex)  FFT and FFT's do not allow missing values.
>>
>> If you have an array with daily values: var(time,level,lat,lon)
>>
>> var2d = var(:,0,0,:)                        ; for clarity, explicitly
>> extract the 2-dimensional subset
>> *printVarSummary(*var2d)
>> *printMinMax*(var2d,0)
>> nmsg =*num*(*ismissing*(var2d))
>> if (nmsg.eq.0) then
>>     wf = *mjo_wavenum_freq_season* (var2d , date, "summer" , False)
>>   ;;wf = *mjo_wavenum_freq_season* (var(:,0,0,:) , date, "summer" ,
>> False)
>> else
>>     print(nmsg+" missing values. *mjo_wavenum_freq_season not invoked")*
>>     exit
>> end if
>>
>> On Fri, May 24, 2019 at 6:23 AM Nishtha Agrawal <
>> agrawal.nishtha3 at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I have recently started using NCL, here I intend to use
>>> mjo_wavenum_freq_season to obtain the frequency-wavelet spectrum of my
>>> variable. But I am getting the missing value error while accessing the
>>> function.
>>>
>>> I am using the following code for my 4D variable 'var'
>>>
>>> date=(/20170315, 20170330, 20170415, 20170430, 20170515, 20170530,
>>> 20170615, 20170630/)
>>> arr=ndtooned(var)
>>> indi=ind_resolve(ind(ismissing(arr)),dimsizes(var))
>>> ind_size=dimsizes(indi)
>>> npts     = ind_size(0)       ; number of missing elements
>>> ndim     = ind_size(1)       ; rank of var
>>> print(ind_size)
>>> print(npts)
>>> print(ndim)
>>> var at _FillValue = -999.9
>>> do n=0,npts-1
>>>   var(indi(n,0),indi(n,1),indi(n,2),indi(n,3)) = var at _FillValue
>>> end do
>>> wave=mjo_wavenum_freq_season(var(:,0,180,:),date, "summer",False)
>>>
>>> And I am getting
>>>
>>> (0) mjo_wavenum_freq_season: currently, missing data not allowed:
>>> nMsg=308355
>>>
>>> I don't understand what else should I keep in place of -999.9. Please
>>> provide any solution to this problem.
>>>
>>> Thanks and Regards,
>>> Nishtha
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190525/58f310ac/attachment.html>


More information about the ncl-talk mailing list