[ncl-talk] lanczos filter

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Tue Sep 13 12:48:22 MDT 2016


"entire grid undefined" in Grads just means that the data grid at the
current time step is all missing values.

With Lanczos filter, and more generally with running average filters,
please remember that there is a spin-up time and a spin-down time, so to
speak.  With opt=0, the first (nwgts-1)/2 time steps will be all missing
values.  The last (nwgts-1)/2 time steps will also be all missing values.

So Marilia, you probably just need to look at your output starting at time
step 101.  HTH.

--Dave


On Tue, Sep 13, 2016 at 12:32 PM, Dennis Shea <shea at ucar.edu> wrote:

> Not sure what the issue is with GrADS. That is between you and GrADS.
>
> ==
> Attached is 'my' script to produce the netCDF. 'ncdump -h' has no problem
> with the resulting file.
>
> ===
> netcdf xBPF {
> dimensions:
>     time = UNLIMITED ; // (3652 currently)
>     lat = 73 ;
>     lon = 144 ;
> variables:
>     float xBPF(time, lat, lon) ;
>         xBPF:_FillValue = 32766.f ;
>         xBPF:long_name = "Anomalies: mean Daily U-wind" ;
>         xBPF:units = "m/s" ;
>         xBPF:wgt_runave_op_ncl = "wgt_runave_n" ;
>     double time(time) ;
>         time:units = "hours since 1-1-1 00:00:0.0" ;
>         time:long_name = "Time" ;
>         time:actual_range = 17259936., 17268672. ;
>         time:delta_t = "0000-00-01 00:00:00" ;
>         time:avg_period = "0000-00-01 00:00:00" ;
>     float lat(lat) ;
>         lat:units = "degrees_north" ;
>         lat:actual_range = 90.f, -90.f ;
>         lat:long_name = "Latitude" ;
>     float lon(lon) ;
>         lon:units = "degrees_east" ;
>         lon:long_name = "Longitude" ;
>         lon:actual_range = 0.f, 357.5f ;
>
> // global attributes:
>         :creation_date = "Tue Sep 13 12:25:42 MDT 2016" ;
>         :Conventions = "None" ;
>         :NCL = "filwgts_lanczos: ihp=2 nWgt=201 sigma=1 fca=0.01
> fcb=0.05" ;
>         :source_file = "./xBPF.nc" ;
>         :title = "Lanczos Band Pass Filtered" ;
> }
>
>
> On Tue, Sep 13, 2016 at 7:07 AM, <marilia.gregorio at cptec.inpe.br> wrote:
>
>> Oi Denis...
>>
>> I did what you told to me. But when I try to open the nc file at GRADS, I
>> have the message:
>>
>> "entire grid undefined" .
>>
>> To write an output file I did this:
>>
>> ;***************************************************
>> ; Writing OUTPUT
>> ;***************************************************
>>
>>        diro="/home2/valesca/Documentos/ncl_filtrolanczos/"
>>
>> ;      print(""+eof_ts)
>>
>>       system("/bin/rm -f xBPF.nc") ; ao criar netcdf coloque sempre esta
>> linha
>>
>>       fout=addfile("xBPF.nc","c")
>>
>>       ;fout->xVarWinterBPF= xVarWinterBPF
>>       ;fout->xVarSummerBPF=xVarSummerBPF
>>       ;fout->yVarWinterBPF=yVarWinterBPF
>>       fout->xBPF=xBPF
>>       ;fout-> yVarSummerBPF= yVarSummerBPF
>>
>> Thanks
>>
>> Marilia
>>
>>
>> Em 2016-09-12 18:34, Dennis Shea escreveu:
>>
>>> Oi Marilia
>>>
>>> [SNIP]
>>>
>>> ;************************************************
>>> ; create BandPass Filter
>>> ;************************************************
>>>   ihp      = 2                                    ; bpf=>band pass
>>> filter => (BPF)
>>>   nWgt     = 201
>>>   sigma    = 1.0                              ; Lanczos sigma
>>>   fca      = 1./100.
>>>   fcb      = 1./20.
>>>   wgt      = filwgts_lanczos (nWgt, ihp, fca, fcb, sigma )
>>>
>>> ;***********************************************************
>>> ; Read daily U anomalies
>>> ;***********************************************************
>>>
>>>    fili    = "uwnd.day."+plev+".anomalies.1980-2005.nc [2]"
>>>
>>>    f       = addfile (diri+fili , "r")
>>>    TIME    = f->time                          ; days since ...
>>>    YMD     = ut_calendar(TIME, -2)            ; entire (time,6)
>>>
>>>    iStrt   = ind(YMD.eq.ymdStrt)              ; index start
>>>    iLast   = ind(YMD.eq.ymdLast)              ; index last
>>>    delete(TIME)
>>>    delete(YMD )
>>>
>>>    x       = f->U_anom(iStrt:iLast,:,:)       ; U_anom_sm
>>>    printVarSummary(x)
>>>    printMinMax(x, True)
>>>
>>>  [SNIP]
>>>
>>> ;************************************************
>>> ; Apply the Lanczos band pass filter weights to the original anomalies
>>> (time,lat,lon)
>>> ;************************************************
>>>
>>>   xBPF = wgt_runave_n_Wrap (x, wgt, 0, 0)     ; BPF (Band Pass
>>> Filtered)
>>>
>>> [SNIP]
>>>
>>> ==========
>>>
>>> If you do a
>>>
>>>   printVarSummary(xBPF)
>>>
>>>   printMinMax(xBPF,0)
>>>
>>> You will 'see' the xBPF contains the Lanczos filtered daily values.
>>>
>>> ========
>>>
>>> D
>>>
>>> On Mon, Sep 12, 2016 at 12:42 PM, <marilia.gregorio at cptec.inpe.br>
>>> wrote:
>>>
>>> Hello, how are you?
>>>>
>>>> I'm trying to use the mjoclivar_3.ncl script, but would like to
>>>> generate
>>>> a field filtered by lanczos of method for every day, you guys know
>>>> how I
>>>> do it?
>>>>
>>>> Thank you.
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160913/9621e883/attachment.html 


More information about the ncl-talk mailing list