[ncl-talk] How to combine many separate nc files together and convert them to monthly?

Dennis Shea shea at ucar.edu
Tue Jun 28 12:53:05 MDT 2022


NCL's *systemfunc* is invoking the Unix/Linux system 'ls'. It is
*independent* of NCL.

>From directory your NCL script is located, enter the following at the
command line:

%>  ls [1-2][8-9-0-1]*/*nc


On Tue, Jun 28, 2022 at 11:46 AM Setareh Rahimi <setareh.rahimi at gmail.com>
wrote:

> Dear Dennis,
> Many thanks for your email. I run the attached script and received the
> attached error.
> What is wrong, please?
>
> On Tue, Jun 28, 2022 at 10:07 PM Dennis Shea <shea at ucar.edu> wrote:
>
>> As indicated before, your path is wrong.
>> ====
>> The attached works just fine.
>>
>> %>  ncl NDVI_TimeSeries.ncl >&! NDVI.Daily_to_Monthly.txt
>>
>> On Tue, Jun 28, 2022 at 10:25 AM Setareh Rahimi via ncl-talk <
>> ncl-talk at mailman.ucar.edu> wrote:
>>
>>> Dear all,
>>>
>>> I have downloaded the Normalized Difference Vegetation Index (NDVI),
>>> from the Advanced Very High-Resolution Radiometer (AVHRR) sensor from
>>> the link below:
>>>
>>> https://www.ncei.noaa.gov/metadata/geoportal/rest/metadata/item/gov.noaa.ncdc:C01558/html
>>>
>>> As you can see this link provides daily data. And I have downloaded
>>> daily data from 1986 to 2021. I put the daily data for each year in a
>>> separate folder.
>>> Now I tend to calculate the monthly anomaly of NDVI and do not know how
>>> to combine all these files.
>>>
>>> I used the below commands to call the files:
>>> ========================================
>>> fils = systemfunc("ls [1-2][8-9-0-1]*/*nc")
>>>    print(fils)
>>>
>>>    f   = addfiles (fils, "r")
>>>
>>>    x   = short2flt(f[:]->NDVI)
>>>
>>>    printVarSummary(x)
>>> =========================================
>>> but got the attached error! Please have a look at the attached
>>> screenshot.
>>> How can I combine all those files together, please?
>>> I really appreciate any help you can provide.
>>> Best wishes,
>>>
>>> --
>>> S.Rahimi
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at mailman.ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>
> --
> S.Rahimi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220628/997e46a1/attachment.htm>


More information about the ncl-talk mailing list