[ncl-talk] Missing value in data variable
Dennis Shea
shea at ucar.edu
Sat May 25 08:41:16 MDT 2019
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/79275e96/attachment.html>
More information about the ncl-talk
mailing list