[ncl-talk] Removing annual cycle and nth harmonics from one dimensional data
Dennis Shea
shea at ucar.edu
Fri Aug 6 19:56:45 MDT 2021
Not tested
Explicit approach
prc1d(time)
ntim = dimsizes(prc1d)
nlat = 1
mlon = 1
; expand 1D to 3D
prc3d = *conform_dims*((/ntim,nlat,mlon/), prc1d, 0)
printVarSummary(prc3d)
yyyyddd =
prc3d_ClmDay = *clmDayTLL*
<http://www.ncl.ucar.edu/Document/Functions/Contributed/clmDayTLL.shtml>(prc3d,
yyyyddd)
printVarSummary(prc_3d)
prc3d_ClmDay = *clmDayTLL*
<http://www.ncl.ucar.edu/Document/Functions/Contributed/clmDayTLL.shtml>(prc3d,
yyyyddd)
prc3d_Anom = *calcDayAnomTLL* (prc3d, yyyyddd, prc3d_ClmDay)
:
:
======================
2nd approach, cleaner and easier
there are *undocumented functions* *clmDayT*, *calcDayAnomT*
prc1d_ClmDay = *clmDayT*(prc1d, yyyyddd)
printVarSummary(prc1d_ClmDay )
prc1d_AnomDay =* calcDayAnomT*(prc1d, yyyyddd, prc1d_ClmDay)
printVarSummary(prc1d_AnomDay)
Look at *contributed.ncl*
search for the above functions if you want
On Fri, Aug 6, 2021 at 12:20 PM Lyndz via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:
> Dear NCL-Experts,
>
> I have daily rainfall data from 1979-2017.
>
> I would like to:
>
> [a] Remove the annual cycle
> [b] Then remove the seasonal cycle (3rd harmonics).
>
> I saw this function in NCL which computes the daily climatology first
> before getting the anomalies (including smoothed anomalies).
>
> *http://www.ncl.ucar.edu/Document/Functions/Contributed/calcDayAnomTLL.shtml
> <http://www.ncl.ucar.edu/Document/Functions/Contributed/calcDayAnomTLL.shtml>*
>
> But this can only be applied for *time x lat x lon data*.
>
> Is there an equivalent function of one-dimationsal (time series) data like
> this?
> If none, do you have any suggestions on how I can do this in NCL?
>
>
> I'll appreciate any help.
>
> -Lyndz
>
> _______________________________________________
> 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/20210806/05638008/attachment.html>
More information about the ncl-talk
mailing list